-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Feature: migrate builtin commands #3734
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
Feature: migrate builtin commands #3734
Conversation
I don't think if type(config.root_dir) == 'function' then
---@param root_dir string
config.root_dir(bufnr, function(root_dir)
config.root_dir = root_dir
vim.schedule(function()
vim.lsp.start(config, {
bufnr = bufnr,
reuse_client = config.reuse_client,
_root_markers = config.root_markers,
})
end)
end)
else
vim.lsp.start(config, {
bufnr = bufnr,
reuse_client = config.reuse_client,
_root_markers = config.root_markers,
})
end Inspiration taken from neovim source code, in |
This comment was marked as resolved.
This comment was marked as resolved.
49c5dc0
to
63962b4
Compare
Opened a PR at neovim/neovim#33578 to make |
@justinmk On further thinking, probably these commands do not suit We could use EDIT: or we could have enable + start as LspStart and disable + stop as LspStop |
What's the current situation of this after neovim/neovim#33702? @justinmk It should simplify logic as:
Probably it would be useful to rename the commands when (and if) they're upstreamed to neovim core. |
yes, exactly 👍
yeah, most likely the upstreamed form will be |
It probably makes sense to add a nvim-lspconfig/plugin/lspconfig.lua Line 68 in 94d0fec
which defines the commands for Nvim 0.11.2+, and then |
63962b4
to
bb259b5
Compare
Is there a way to provide completion for |
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.
looks like a good starting point, we can improve it if needed
oh, we could copy the logic from here: https://github.com/neovim/neovim/blob/97a6259442526e33a73201557b1cb74ccdb64eef/runtime/lua/vim/lsp.lua#L443-L454 |
That would be fine for getting configs under |
right, but we can think about that later. |
652462b
to
d846349
Compare
d846349
to
950e3d6
Compare
fix #3714
fix #2216
Things to note:
LspStart
starts the selected LSP and attaches to every buffer which has the right filetype. Should I only attach it to the current buffer?LspStop
stops the selected LSP.LspRestart
restart the selected LSPs, but I don't get how and why it used a timer.Should we add
LspEnable
? Maybe in a future PR.EDIT:
Should I add checks for neovim 0.11?
Something like: