dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.89k stars 4.01k forks source link

The Quick info (Codelens) xml comment only open external URL other URI not #54050

Open vsfeedback opened 3 years ago

vsfeedback commented 3 years ago

This issue has been moved from a ticket on Developer Community.


Dear Support,

In quick info the http, https, mailto URI -s working fine.

I would like to use the xml comments with our ticket management software, but the visual studio does not open custom URIs on click, in either the quick info window or the code.

Sample code:

/// <summary>
/// This is C# XML Documentation Website Link
/// <para><a href="https://github.com/dotnet/roslyn/pull/35667/files">Http(s) url (working)</a></para>
/// <para><a href="mailto*@yyy>Mailto url (working)</a></para>
/// <para><a href="cm://RibbonAttribute%3A%2F%2FDokumentumtar%3Fiktatoszam%3D21030900001">Custom (registered URI) not working!</a></para>
/// <para><a href="SkypeURL://test.com">e.g SkypeURL not working!</a></para>
/// <para><a href="Skype://test.com">e.g Skype not working!</a></para>
/// </summary>
public class Test
{
}

Sample image: ! [image.png] (https://aka.ms/dc/image?name=B6f9b505fd3ed41d3b3ce1591cde8f4b8637533139006209558_20210406-155140-image.png&tid=6f9b505fd3ed41d3b3ce1591cde8f4b8637533139006209558)

It would be nice if it worked like in any browser or text editor.

Thanks, Best Regards Gabor


Original Comments

Feedback Bot on 4/6/2021, 07:05 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 4/7/2021, 04:34 PM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

Gábor Kalmár on 4/8/2021, 11:16 PM:

Thank you for investigating this issue!

I think this is a bug, because opening these links works properly in all Microsoft programs (Edge, Word, Excel, Skype etc),
and so in the entire Windows system in general.

Visual Studio alone is not able to open these links!

It would be nice if link management worked consistently with the rest of the windows system.
Thanks!


Original Solutions

(no solutions)

Youssef1313 commented 3 years ago

https://github.com/dotnet/roslyn/blob/67dcb23a55d4930ad19fe436a0e90dac41f8d9d0/src/EditorFeatures/Core/Implementation/IntelliSense/Helpers.cs#L141

First issue is that Uri.TryCreate is failing for cm://RibbonAttribute%3A%2F%2FDokumentumtar%3Fiktatoszam%3D21030900001, specifically, it doesn't like the % (possible they url-encoded characters should be decoded in the doc comment itself?).

(Note that the same happens in Edge, it doesn't seem to consider this url valid valid (i.e, it does a search on the default search engine rather than showing "can't reach this page")

Second issue is that navigation is made for http and https only (so actually mailto doesn't work):

https://github.com/dotnet/roslyn/blob/35b58a828f964887fac32355262a847cfa2b6afc/src/VisualStudio/Core/Def/Implementation/Utilities/VisualStudioNavigateToLinkService.cs#L35-L38