-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
base: master
Are you sure you want to change the base?
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 |
Thank you, I totally missed that. The |
49c5dc0
to
63962b4
Compare
Opened a PR at neovim/neovim#33578 to make |
}) | ||
|
||
api.nvim_create_user_command('LspStop', function(info) | ||
vim.api.nvim_create_user_command('LspStop', function(info) |
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.
Nvim 0.11+, LspStop
can do this, to "disable" the configs :
vim.lsp.enable(..., false)
Requested in #2216
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.
Yes, I'll add it. Should I re-enable the config in LspStart
?
@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 |
See #3714
CC @justinmk
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: