-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Neovim 0.11 migration #3659
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
Neovim 0.11 migration #3659
Conversation
I think we should skip to Phase 2. The old configs have already been quasi-frozen for a few months. Now it's time to formalize that. So I suggest:
|
Ok, that's probably better. What about descriptions? Should I annotate the config table with them? |
Descriptions should probably be luadoc comments at the top of the config. Then we'll need to update the generator in this repo to read those. WDYT @lewis6991 ? |
sgtm |
UpdateNow I'll port the LSPs that I usually use first, just because I can test them more easily. I added the For the LuaDoc: should I annotate a |
Sorry, I just remembered something:
The point of the wrapper was to not have to create configs under If that's possible, then that's still the least-risk approach to start with. |
I didn't find a feasible approach to it, so I figured we could just port the configs. In the meanwhile I baked in some modifications that wuold fit the new configuration, but I'm more than happy to break things down in separate PRs. If you prefer a more conservative approach, I could also remove the new I also thought would be smart to use builtin neovim 0.11 in the migrated configs, because those would be used obviously just in neovim>=0.11, but I could just make a really simple migration with little to no effect to the current configurations. This was also meant to use less functions from |
if a wrapper that works automatically isn't possible, then yes we should skip to Phase 2 and start migrating configs. and the old configs are frozen.
why is there a new Command interface? where did that requirement come from? |
Just because the old Commands had a weird syntax which required more complicated parsing (why is there a opt_alias table?). I get it was probably for compatibility issues, but now we can change things more freely. That being said, I could revert it no problem. For context, I'm referring to this (probably) over complicated function: This was my suggested solution: |
The The entire purpose of this exercise is to stop depending on framework code in lspconfig, not to replace it with a new flavor. If the new configs want to have "commands", then for now they will need to hardcode calls to Or else figure out a way to do Phase 1 only, and pause Phase 2 until we have a proper answer for the |
Fine with me to hardcode What about These types of things are required in order to port more complicated configs (e.g. |
Update
Needs #3666 Started to port in alphabetical order. Skipping the ones with |
Probably LSPs which {
...
root_dir = function (bufnr, done_callback)
local root = -- compute root
done_callback(root or vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr))) -- either
-- done_callback(root or vim.fn.getcwd()) -- or
end,
... |
4b56f60
to
1173e0f
Compare
@TheRealLorenz hey and thank you for your awesome work here. Today, in the {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = <function 1>,
single_file_support = true
} Do you know what the equivalent will be to query these new lsp defaults? |
Well, I don't think there's a way that is as straightforward as the old one, but in the majority of cases it isn't needed. To enable a config you simply The problem with getting a default config like in the old ones is that the contents of the |
@justinmk Sorry to bother. The "easier" migration is done, now there are just the LSPs which have Is it feasibile to move What's the suggested way to handle I had an idea which consisted of:
Which shouldn't start the server given that EDIT: Probably this PR could wait until those features are sorted out and implemented in neovim. |
Co-authored-by: Aliou Diallo <[email protected]>
Thank you for the insight! Should be fixed by now. |
This comment was marked as resolved.
This comment was marked as resolved.
Since we are nearing the end, please avoid force-pushing, just push "fixup" commits instead. I'll squash merge the final PR. (Separating commits for "bisectability" is good, but all of these files are independent, and live in 1 directory, so there is no need for separate commits.) |
command 'echohl None' | ||
end | ||
|
||
---@brief |
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.
the @brief
comments should start at top of file. they describe the file (module), not a particular symbol. that might also make docgen a bit easier.
LGTM. Only blocker is the failing lint CI. The rest can be in a followup PR. Thanks again for doing this. Very helpful. |
@TheRealLorenz thanks a lot for your hard work! |
…nfig See: - neovim/nvim-lspconfig#3659 - neovim/nvim-lspconfig#3494 Instead of calling `lspconfig['some language server'].setup({})`, call Neovim built-in `vim.lsp.config('some language server', {})` and it will automatically load the config from the `lsp/` directory inside the nvim-lspconfig submodule. Global config that should apply to all language servers is now set up using `vim.lsp.config('*', {})`. Moved the handler overrides into the `vim.lsp.config('*', { handlers = {} })` call instead of overwriting the value of `vim.lsp.handlers['some handler']`. * aspects/nvim/files/.config/nvim/pack/bundle/opt/nvim-lspconfig 5f395bfe...b6936cb8 (32): > docs: update configs.md skip-checks: true > fix(docs): docgen.lua reads from `lua/*.lua` #3708 > feat(typos-lsp): support pyproject.toml and Cargo.toml #3707 > feat: migrate to vim.lsp.config #3659 > refactor: replace vim.loop with vim.uv #3703 > docs: update configs.md skip-checks: true > fix(stylelint): update root_file, filetypes #3702 > docs: update configs.md skip-checks: true > feat(tinymist): workspace commands #3639 > fix(openedge_ls): update configuration #3623 > docs: update configs.md skip-checks: true > feat: bqls #3486 > docs: update configs.md skip-checks: true > feat: rpmspec #3568 > refactor: deprecate get_active_client_by_name #3697 > docs: cleanup #3696 > refactor: deprecate add_hook_before/after #3695 > refactor: deprecate util.get_lsp_clients #3694 > refactor: deprecate util functions #3691 > feat: require Nvim 0.10+ #3692 > docs: update configs.md skip-checks: true > feat: "just" lsp #3655 > docs: update configs.md skip-checks: true > feat(svelte): command to migrate to svelte 5 #3638 > docs: update configs.md skip-checks: true > Revert "fix(eslint): find closest ESLint directory to avoid version mismatch …" #3689 > docs: update configs.md skip-checks: true > fix(eslint): find closest ESLint directory to avoid version mismatch #3686 > docs: update configs.md skip-checks: true > fix(tblgen): find tablegen_compile_commands.yml #3649 > docs: update configs.md skip-checks: true > feat(ada_ls): alire.toml #3667
Closes #3494
This PR introduces the minimal effort to port every configuration to neovim 0.11.The
default_configuration
field has most of the times everything that's needed, but there are come exceptions that where changed:commands
field became raw calls tovim.api.nvim_buf_create_user_command
insideon_attach
.root_dir
became:root_markers
whenever the file list was simple didn't need to mach*
vim.lsp.Config
'sroot_dir
.on_config_change
becamebefore_init
. I don't actually know if this is the correct approach, but looking around the documentation ofnvim-lspconfig
a saw that it was defined as the function that gets called as soon as the config haveroot_dir
, and so I thoughtbefore_init
might be the closest alternative.docs.description
became a luadoc annotation prefaced by@brief
.single_file_support = false
?Needs #3666