mattn / efm-langserver

General purpose Language Server
MIT License
1.37k stars 62 forks source link

Question: Need help with format #102

Closed ajitid closed 3 years ago

ajitid commented 3 years ago

Is there a reference sheet which I can use to understand and use %f, %l and other formats?

I am using a linter that emits message in this form:

Emojis should be wrapped in <span>. [Warning/jsx-a11y/accessible-emoji]

Is there a way to parse "Warning" out of it but combine both of its sides to make the message appear as

Emojis should be wrapped in <span>. [jsx-a11y/accessible-emoji]

and to tag it as a warning?

I tried %m [%tarning/%m but it is wrong as the second %m overrides the first one.

mattn commented 3 years ago

Hmm, as far as I know, combining are not supported on https://github.com/reviewdog/errorformat

https://reviewdog.github.io/errorformat-playground/?efms=%25m+%5B%25tarning%2F%25m&text=Emojis+should+be+wrapped+in+%3Cspan%3E.+%5BWarning%2Fjsx-a11y%2Faccessible-emoji%5D

(If I 'd say), you can make wrapper-script that substitute messages as you want.

ajitid commented 3 years ago

you can make wrapper-script

I'm not able to understand this. I'm using this lang server with NeoVim. Are you saying that I can pass a function to lintFormats property? If not, where do I need to create a wrapper script and what part will call this script?

Update: I went with compact format of ESLint to solve the issue. I believe unix format which is mentioned in the doc, while be able to parse the problems, will incorrectly report warnings as errors as no detection is applied there.

ajitid commented 3 years ago

Is it possible to receive a code action or a line range fix from ESLint to nvim-lspconfig with the help of EFM Lang Server? Usually in VSCode we get a quick fix/lightbulb for rules like react-hooks/exhaustive-deps.

mattn commented 3 years ago

Unfortunately, currently, efm-langserver does not support dynamic codeAction.

ajitid commented 3 years ago

Okay, thanks for the help!