michaellzc / vscode-hadolint

VSCode extension to integrate hadolint, a Dockerfile linter, into VSCode
https://marketplace.visualstudio.com/items?itemName=exiasr.hadolint
MIT License
77 stars 5 forks source link

Adding link to rule documentation in linter warning #53

Closed solkaz closed 3 years ago

solkaz commented 3 years ago

When an lint rule is violated, it would be helpful if the rule identifier linked to the relevant documentation page. As an example, given the following scenario:

Screen Shot 2021-07-07 at 12 01 12 PM

If DL3007 could function as a link to https://github.com/hadolint/hadolint/wiki/DL3007, that would be beneficial, as I can more easily understand the context. This would be akin to what ESLint does:

Screen Shot 2021-07-07 at 12 04 39 PM

Here, I can click on the eol-last text to open https://eslint.org/docs/rules/eol-last in the browser.

michaellzc commented 3 years ago

@solkaz

This has been on my todo list for a long time and it's currently blocked by VS Code itself. The editor or language-server-protocol lacks support for better formatting of diagnostics message with markdown or reference external link.

I do understand vscode-eslint extension has such feature, but the implementation seems rather hacky to me. I don't want to invest time on something could have been stupid easy to implement.

That said, I am open to contribution.

Learn more

Update:

nvm. They actually added a special handling to reference external resource for diagnostics.

solkaz commented 3 years ago

@michaellzc Thank you so much for taking a look and implementing this!