Commit Graph

18 Commits

Author SHA1 Message Date
Folke Lemaitre
3964433062 feat(lsp): refactor lsp code to use Snacks.util.lsp.on 2025-10-25 16:56:19 +02:00
Folke Lemaitre
e9bc6074d1 fix(ai.copilot): disable copilot lsp if installed. copilot.lua needs its own version of the LSP 2025-09-26 15:55:32 +02:00
Zhou Fang
13069f2018 feat(copilot): use blink-copilot as blink.cmp copilot source (#5551)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

After reviewing and fixing bugs in blink-cmp-copilot, I realized that
there is significant room for improvement in its codebase. So I created
a new copilot source `blink-copilot` for `blink.cmp` that introduces
many new features, enhanced performance, and official `copilot.vim`
backend support. (`copilot.lua` is supported by default)

The plugin has been starred by over 30 users, and it is growing faster
than blink-cmp-copilot. After more than two weeks of gathering feedback
and addressing bugs, the plugin has become very stable, and I believe
it’s time to share it with a broader audience.

`blink-copilot` register the kind `Copilot` by default, so there is no
need to do extra transforming on the completion items.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-09-21 14:40:15 +02:00
Folke Lemaitre
f4e64eea45 refactor(lsp): remove LazyVim.lsp.get_clients 2025-09-16 17:34:17 +02:00
Baptiste GAZÉ
55e9944e2b fix(extras.ai.copilot): update status retrieval for lualine (#5900)
## Description

Following copilot.lua refactoring in
https://github.com/zbirenbaum/copilot.lua/pull/431, lualine is unable to
refresh.

We face the following error

```
  Error  15:55:22 msg_show.lua_error Error executing vim.schedule lua callback: ...share/nvim/lazy/lualine.nvim/lua/lualine/utils/utils.lua:211: lualine: Failed to refresh statusline:
.../.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:415: Error executing lua: ...m/lazy/LazyVim/lua/lazyvim/plugins/extras/ai/copilot.lua:54: attempt to index field 'status' (a nil value)
stack traceback:
	...m/lazy/LazyVim/lua/lazyvim/plugins/extras/ai/copilot.lua:54: in function 'status'
	...cal/share/nvim/lazy/LazyVim/lua/lazyvim/util/lualine.lua:17: in function 'cond'
	...l/share/nvim/lazy/lualine.nvim/lua/lualine/component.lua:275: in function 'draw'
	...are/nvim/lazy/lualine.nvim/lua/lualine/utils/section.lua:26: in function 'draw_section'
	.../.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:167: in function 'statusline'
	.../.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:309: in function <...gaze/.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:290>
	[C]: in function 'nvim_win_call'
	.../.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:415: in function 'refresh'
	.../.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:491: in function <.../.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:490>
	[C]: in function 'pcall'
	...share/nvim/lazy/lualine.nvim/lua/lualine/utils/utils.lua:214: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
```

## Related Issue(s)

#5899 

## Screenshots

![Screenshot 2025-04-05 at 16 16
56](https://github.com/user-attachments/assets/3dc28dc6-1622-41ef-9e70-380a37064da4)


## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-09-15 07:15:34 +02:00
Folke Lemaitre
8f4e9b8c1e fix(copilot): remove load on BufReadPost instead of InsertEnter 2025-01-31 20:10:50 +01:00
Folke Lemaitre
6bc56e4e81 feat(blink): boost results from ai providers and enable async, to get much faster completions 2024-12-15 18:33:50 +01:00
Folke Lemaitre
a9a273d041 fix: fqn for nvim-cmp 2024-12-12 14:45:47 +01:00
Folke Lemaitre
34d2bdcac6 fix(copliot): restructure copilot-cmp spec 2024-12-12 13:47:29 +01:00
Folke Lemaitre
439340bd8a fix(blink): config breaking changes. Fixes #4990 2024-12-11 10:57:09 +01:00
Stefan Boca
f841ecf6bd feat(extras.ai): blink.cmp integration and kind overrides for menu drawing (#4942)
## Description

blink.cmp integration for codeium and copilot, and correct menu drawing
for codeium, copilot, and supermaven.

I've simplified the blink.cmp config a bit for these extras (especially
for copilot, which was extremely nested) by only including the blink.cmp
spec if vim.g.ai_cmp is true.

Multiple AI extras can now be enabled at the same time with blink.cmp.

blink.cmp ghost text is now always enabled. Although some ai plugins
always display virtual text, at worst it overlaps with blink's ghost
text and is not noticable.

Lastly, I can't test copilot because I don't have a subscription, nor do
I want to sign up for one, but it should work just as well as the
others.

## Screenshots

With Codeium:

![image](https://github.com/user-attachments/assets/1485ee3f-1cba-440f-8a82-ec69b4a3f473)

Multiple extras enabled at the same time:

![image](https://github.com/user-attachments/assets/4364ee45-d79b-4f97-a4c0-cf2a2b6433c6)

## Checklist

- [X] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-12-03 21:06:58 +01:00
Folke Lemaitre
30f556d17a fix(copilot): remove tmp nightly fix 2024-11-20 09:48:30 +01:00
Folke Lemaitre
59615281f8 fix(copilot): work-around to get copilot working again on nightly 2024-11-19 08:49:53 +01:00
Folke Lemaitre
07a046867d fix(copilot): don't enable blink when using copilot when blink is not installed. Fixes #4795 2024-11-15 06:25:26 +01:00
Folke Lemaitre
a7eca05609 feat(copilot): added support for blink.cmp source 2024-11-13 18:28:58 +01:00
Folke Lemaitre
5df382765b refactor(lualine): status component 2024-11-13 17:20:50 +01:00
Folke Lemaitre
fbf881f80b feat(ai): better completion/suggestions of AI engines (#4752)
## Description

The whole completion / snippets / AI is very tricky:
- multiple snippet engines
- native snippets on > 0.11 set their own keymaps, but not on 0.10
- multiple completion engines, like `nvim-cmp` and `blink.cmp`
- multiple ai completion engines that have a different API
- user's preference of showing ai suggestions as completion or not
- none of the ai completion engines currently set undo points, which is
bad

Solution:
- [x] added `LazyVim.cmp.actions`, where snippet engines and ai engines
can register their action.
- [x] an action returns `true` if it succeeded, or `false|nil` otherwise
- [x] in a completion engine, we then try running multiple actions and
use the fallback if needed
- [x] so `<tab>` runs `{"snippet_forward", "ai_accept", "fallback"}`
- [x] added `vim.g.ai_cmp`. When `true` we try to integrate the AI
source in the completion engine.
- [x] when `false`, `<tab>` should be used to insert the AI suggestion
- [x] when `false`, the completion engine's ghost text is disabled
- [x] luasnip support for blink (only works with blink `main`)
- [x] create undo points when accepting AI suggestions 

## Test Matrix

| completion   | snippets     | ai          | ai_cmp | tested? |
|--------------|--------------|-------------|--------|---------|
| nvim-cmp     | native       | copilot     | true   |       |
| nvim-cmp     | native       | copilot     | false  |       |
| nvim-cmp     | native       | codeium     | true   |       |
| nvim-cmp     | native       | codeium     | false  |       |
| nvim-cmp     | luasnip      | copilot     | true   |       |
| nvim-cmp     | luasnip      | copilot     | false  |       |
| nvim-cmp     | luasnip      | codeium     | true   |       |
| nvim-cmp     | luasnip      | codeium     | false  |       |
| blink.cmp    | native       | copilot     | true   |       |
| blink.cmp    | native       | copilot     | false  |       |
| blink.cmp    | native       | codeium     | true   |       |
| blink.cmp    | native       | codeium     | false  |       |
| blink.cmp    | luasnip      | copilot     | true   |       |
| blink.cmp    | luasnip      | copilot     | false  |       |
| blink.cmp    | luasnip      | codeium     | true   |       |
| blink.cmp    | luasnip      | codeium     | false  |       |


## Related Issue(s)

- [ ] Closes #4702

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-11 10:50:57 +01:00
Folke Lemaitre
86904d2fb1 feat(ai): move ai related extras from coding to ai (#4751)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-10 11:27:21 +01:00