-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add documentFormattingProvider to server capabilities response #1307
add documentFormattingProvider to server capabilities response #1307
Conversation
The LSP server does register a document formatter provider but in a dynamic way. This ensures that if the formatter gets disabled ESLint formatter will not show up in the list of default formatters. Does NeoVim not support dynamic registration? |
Related: neovim/neovim#13634 |
We have not implemented dynamic registration in neovim. Most of the time users are setting up options declaratively in their init.vim/init.lua, so it hasn't yet made sense to enable dynamic registration for anything. |
Thanks! For those who don't know how to enable/disable features in their
It is working as expected, I just learnt this imperative way, I don't know about the declarative approach yet. |
Go, great to hear that this exist. I will close the PR then since the servers recommended way is to have dynamic registration. |
Thanks everyone for jumping in! Apologies if I'm continuing the discussion in the wrong repo, but @mjlbach would you say the snippets @sassanh provided is the recommended way to "toggle" the registered capabilities of LSP clients (e.g., disable document formatting for |
Also a question for @dbaeumer: For ESLint LSP - would you say that the |
|
Apparently we have to tell neovim that eslint can format microsoft/vscode-eslint#1307 (comment)
Enable formatting capabilities to eslint LSP as neovim is currently incapable of handling dynamic capabilities from LSP server. Ref: microsoft/vscode-eslint#1307
Hey! Seeing as this LSP does support the
textDocument/formatting
command - I figured we could add it to the server capabilities response. Currently struggling to get neovim's LSP client to recognize the fact that the ESLint LSP server does in fact support formatting - this ought to fix it.