Languageclient-neovim: [feature-request] Ignoring certain warnings

Created on 26 Oct 2017  ·  4Comments  ·  Source: autozimu/LanguageClient-neovim

I'm using this plugin (which I love btw) with palantir/python-language-server and it seems to love complaining about my line lengths with a certain warning. Now I can ignore it personally, but I would like the option of being able to filter out certain warnings from being surfaced. If this isn't the best place to add that feature, then I'd be happy to look elsewhere, but it seems to me that modifying the language server itself would be more difficult and would require individually requesting a PR for each server to support that option, so this seems like a good place to add it.

Most helpful comment

python-language-server has already support loading linting rules from config, https://github.com/palantir/python-language-server/blob/develop/pyls/plugins/pycodestyle_lint.py

For me, with

[pycodestyle]
max-line-length = 100

in ~/.config/pycodestyle, the warnings from pyls are gone.

All 4 comments

To be frank, I bothered by the same issue.

But I don't think the work is within this plugin scope. From implementation wise, every language have their own linting error messages/ids. Some have localized messages. From the perspective of one language, they usually have clearly defined linting config conventions, such as the place to store those configs, inheritence of configs, lint rules/ids, etc, which can be understand by different tools. Follow this path, the language server has a more preferable standpoint to implement this.

BTW, I vaguely remember python language server added the support not long ago. But I'm too lazy/busy to get it properly configured.

cc @gatesn

How about filtering the location list results based on pattern matching with a regex? That would be simple enough. Although there may be a way to do this in vim without involving this plugin. But I understand either way. I've noticed myself ignoring potential errors because there is a warning nearby. Honestly I could even just add that feature myself locally and make a PR.

The plug-in vim-qf which enhances quickfix/locaction list already offers similar functionality.
It gives you the command Reject to drop errors from the list. However there are two issues: it doesn't affect the sings, and after every change it is overwritten by the LanguageClient.

But maybe the idea can be adapted for this problem. The second issue should be easily solvable by remembering the reject and adding an autocmd to always trigger the command after changes.

But this is only an idea, sadly I don't really know how vimscript works.

python-language-server has already support loading linting rules from config, https://github.com/palantir/python-language-server/blob/develop/pyls/plugins/pycodestyle_lint.py

For me, with

[pycodestyle]
max-line-length = 100

in ~/.config/pycodestyle, the warnings from pyls are gone.

Was this page helpful?
0 / 5 - 0 ratings