DavidAnson / vscode-markdownlint

Markdown linting and style checking for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
MIT License
930 stars 170 forks source link

Linter is incorrectly recognised by VSCode as a formatter #243

Closed wolf99 closed 2 years ago

wolf99 commented 2 years ago

I noticed this morning that VSCode has started showing me this for markdown files that I edit:

image

This is because I have two extensions related to markdown installed and enabled. If I click the configure in the above image, I see the following:

image

To me this is because VSCode thinks that this extension is a formatter, where actually it is a linter. The difference being that a formatter makes changes to a file as you type, whereas a linter points out mistakes (but does not remedy them itself).

Is there some way that this extension can indicate this difference to the IDE?

(If there is no method to do this in VSCode then this is actually an issue on VSCode rather than this extension)

DavidAnson commented 2 years ago

This behavior is correct. By request, the markdownlint extension registers itself as a formatter so it can apply fixes automatically. You can read more here: https://github.com/DavidAnson/vscode-markdownlint#fix

wolf99 commented 2 years ago

Hmmm. That's a fair enough explanation.

But at the same time, this fix functionality will only fix lint issues, correct? It doesn't, and I don't propose that it should, format all the many things the other extension does. (And vice versa)

Thus maybe this is a feature request to vscode to allow multiple formatters to work together... What do you think?

DavidAnson commented 2 years ago

Right, each extension will only fix the issues it knows about. It looks like Code is encouraging you to pick one as the default, but I believe it will still allow you to run either or both if you wish.