-
Notifications
You must be signed in to change notification settings - Fork 23k
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
Allow easier overriding of default filetypes for LSP #373
Conversation
This looks good to me, would you please add an example use case to the README under Configuration And Extension Thanks a bunch! |
init.lua
Outdated
@@ -424,12 +424,16 @@ end | |||
-- | |||
-- Add any additional override configuration in the following tables. They will be passed to | |||
-- the `settings` field of the server config. You must look up that documentation yourself. | |||
-- | |||
-- If you want to override the default filetypes that your language server will attach too you can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be a pest, but you want 'attach to' not 'attach to' otherwise looks great!
Hi I'm sorry but rather than correcting the spelling error you removed the docs entirely. |
Hi @feoh Sorry its late in the evening for me and I accidentally rebased my PR on the wrong branch because i was not paying attention :) I fixed it now! |
No worries! Thanks for your patience and thanks for the contribution! I've actually got a couple use cases for this myself :) |
Hi. Unfortunately after laboriously merging down your PR into my fork, I discovered it breaks if you don't do any of these overrides. I now get:
On startup, which isn't great :( Unless you make a new PR with a fix in a few hours, I'll revert your commit this evening. Thanks and apoligies to anyone who gets this broken kickstart. My bad for not testing it thoroughly outside my fork. |
I filed #375 to track this issue. Please resolve it with details if you make the fix, or I'll include reversion details if I end up doing that this evening. |
Allow easier overriding of default filetypes for LSP
Allow easier overriding of default filetypes for LSP
Hi,
For some language servers it makes sense to override the default filetypes that they attach too. For example when editing a twig file it is nice to have the html language server attached to the buffer.
With this little addition to the setup_handlers function you can just put the filetypes configuration in the server configuration defined above and it will work. If you don't specify filetypes on your lsp config the value set will be nil and the default behavior will occur.