Skip to content
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

feat: set default capabilities on 0.11 #897

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

lopi-py
Copy link
Contributor

@lopi-py lopi-py commented Jan 5, 2025

See :help vim.lsp.config on nightly.

Changing vim.version to vim.fn.has improved the startup time by about 2-3 ms

@lopi-py
Copy link
Contributor Author

lopi-py commented Jan 5, 2025

Maybe this could be located at plugin/blink-cmp.lua to load as soon as possible. For example I might want to load the plugin at startup (so capabilities are set first) but call the setup function on InsertEnter or VeryLazy

@mathjiajia
Copy link

I guess this is only needed when lsp source is enabled?

@Saghen
Copy link
Owner

Saghen commented Jan 6, 2025

Maybe this could be located at plugin/blink-cmp.lua to load as soon as possible

Yeah, sounds like a good idea

@lopi-py lopi-py force-pushed the 0.11-capabilities branch from 526ab98 to 220baad Compare January 6, 2025 19:18
@Saghen Saghen merged commit af1febb into Saghen:main Jan 6, 2025
2 checks passed
@Saghen
Copy link
Owner

Saghen commented Jan 6, 2025

Thanks!

@antoineco
Copy link
Contributor

antoineco commented Jan 7, 2025

Note that this only works on nightlies more recent than neovim/neovim@3f1d09b.

I was still on neovim/neovim@146b830, and got hit by the following error on startup:

Failed to source `.../blink.cmp/plugin/blink-cmp.lua`

vim/_editor.lua:0: BufReadPre Autocommands for "*"..script nvim_exec2() called at BufReadPre Autocommands for "*":0../.../blink.cmp/plugin/blink-cmp.lua: Vim(source):E5113: Error while calling lua chunk: ...en/.../blink.cmp/plugin/blink-cmp.lua:2: attempt to call field 'config' (a nil value)

In general, it is more robust to check for the function being nil rather than relying on vim.fn.has(). Two examples:

antoineco added a commit to antoineco/dotfiles that referenced this pull request Jan 7, 2025
Allows using the current tip of blink.cmp[1].

[1]: Saghen/blink.cmp#897
@lopi-py lopi-py deleted the 0.11-capabilities branch January 8, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants