-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Ability to add links to diagnostics and render them as links in problems view #11847
Comments
Like the idea of having a link in the problems panel to point to documentation. @sandy081 |
@dbaeumer Does the problem diganostics have information about these external links? |
@sandy081 no we would need to add it. |
I would like to take a stab at this if no work has already been done. FYI looks the Atom linter-eslint folks pulled this logic out into a standalone module we could use pretty easily: https://github.com/jfmengels/eslint-rule-documentation |
@bpugh That would be great. No work has not been started. Let me know if you need any assistance. |
Thanks! I did have one question though. It looks pretty straightforward to add the url to the message from |
+1 |
@sandy081 I believe @bpugh was asking you that question but didn't tag you. p.s. @rmartins90 @kuschti You can thumbs up a comment directly instead of adding spam. |
@bpugh Yes, this needs to be implemented in VS Code too, to detect and render links in Problems view. |
No progress on this one? |
I'd be a fan, too, including linking to optional external URLs... for example, I have an extension that integrates with known vulnerabilities for certain components; I'd love to be able to link in the problem space to the actual advisory URL with more details... today folks have to copy/paste from the |
+1 |
Hey guys, how are things going |
I would like to work on this if no one else is. I stumbled upon this as part of Microsoft's Hacktoberfest participation! This is my first time working in the vscode codebase so I spent a bit of time looking into how to achieve this. Here is my progress so far. Reference implementation – Atom and its
|
Progress update – I think I figured out all of the places that would/could support those links:
If anyone has thoughts on how to handle the URLs in each of these, please let me know. |
wrt to the API proposal, we should use |
In SonarLint we are already allowing users to open rule description (using a code action), so this feature would be useful as a replacement. But we are displaying rule description directly inside VSCode (using a web view panel). Do you know if this feature would support URI with custom scheme, so that we could use our own handler and not open an external browser? |
Yeah, using whatever uri-scheme should be supported by this but I do wonder why SonarLint uses a web view and not just a browser? Is that your help text is dynamic or private? |
Our help text is indeed dynamically generated from metadata coming from the embedded analyzer (rule name, severity, markdown description converted to HTML, ...). This is better for us to rely on embedded analyzer metadata than trying to host online content, since it will perfectly match the analyzer version, and also this will work when user has no internet connexion. |
Ok, that makes sense. For us it is important that the link has a direct connection to the error-code, hence the shape of the API and that it isn't a generic link |
👋 would this be added to the language server protocol? This is a very useful feature for surfacing documentation for errors. |
Yes, this will be added to the LSP as well. |
Steps:
|
For example, linting
var test = 1
results in these warnings in the Problems panel:
My suggestion:
the
no-unused-vars
andsemi
to be clickable and to link tohttp://eslint.org/docs/rules/no-unused-vars and to
http://eslint.org/docs/rules/semi
respectively.
(I've found this feature in AtomLinter and it's really useful)
cc: @dbaeumer
PS. Using vscode-eslint 1.10.18 with ESLint 3.5.0 in VSCode 1.5.1 using win10 x64.
The text was updated successfully, but these errors were encountered: