Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] "View source" links to Azure DevOps do not highlight line in source code #10447

Open
vbluhme opened this issue Dec 3, 2024 · 0 comments
Labels
bug A bug to fix

Comments

@vbluhme
Copy link

vbluhme commented Dec 3, 2024

Describe the bug
When clicking a "View source" link to an Azure DevOps remote repository, there is no line highlighting in the Azure DevOps source code viewer.

The links currently append &line={source.Line} to the URL which does not achieve anything in the Azure DevOps source code viewer. To highlight a line of code, Azure DevOps requires:

&line={source.Line}&lineEnd={source.Line+1}&lineStartColumn=1&lineEndColumn=1&lineStyle=plain

This is the pattern generated when copying the link to a line within Azure DevOps and is also described here. Result with source.Line = 7:

Image

The link seems to be generated here: https://github.com/dotnet/docfx/blob/main/src/Docfx.Common/Git/GitUtility.cs#L77

To Reproduce

  1. Set up a DocFX project linked to an Azure DevOps remote repo.
  2. Build the project and click "View source" on a member in the API documentation.
  3. No lines are highlighted.

Expected behavior
I expect startLine in the API YAML file to be highlighted within Azure DevOps.

Context (please complete the following information):

  • OS: Windows 10
  • Docfx version: 2.78.2
@vbluhme vbluhme added the bug A bug to fix label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

1 participant