by duped · 3y ago · 0 comments
In fact LSP is mostly configuration agnostic. It might use configuration for a particular query like autoformatting, but it's still request/response in terms of text edits.
The textDocument/diagnostic[1] is far beyond "the language model behind the text" and includes linting which many LSP servers implement (TS and python for example), and it can also happen as a "push" as opposed to "request/response"
[1]: https://microsoft.github.io/language-server-protocol/specifi...
That’s just one example, not the lone thing users would likely configure.
Edit: More concretely, here are some of the config knobs you can twiddle via LSP for the particular server I’ve been discussing: https://github.com/python-lsp/python-lsp-server/blob/develop...
There are other plugins around with settings that aren’t documented there, but are still configured through the same mechanism.
In many cases the right tool is something like treesitter. Treesitter paired with an LSP is an incredible combination.
But yes, I understand your frustration. And if the best implementation happens to be inside the LSP then so be it.
The examples I gave were around lint-y types of things, but the same problem affects more LSP-y things, too. The link I gave has lots of tweakable knobs for refactoring plugins and other stuff that’s more philosophically in-scope for language servers.
LSP supports refactoring with "Code Action Request":
https://microsoft.github.io/language-server-protocol/specifi...
That's more than simply answering queries about the model.