Skip to content

Commit 45b43c6

Browse files
committed
modules/lsp: hardcode blink capabilities to allow it to lazy-load
1 parent 55d6b3d commit 45b43c6

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

docs/manual/release-notes/rl-26.12.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
[soliprem](https://github.com/soliprem):
7878

7979
- Lazy load a bunch of stuff:
80+
- `autocomplete/blink-cmp`: lazy-load on insert or command-line entry.
8081
- `git/hunk-nvim`: lazy-load on `DiffEditor`.
8182
- `utility/crazy-coverage`: lazy-load on coverage commands.
8283
- `utility/yanky-nvim`: lazy-load after UI initialization.

modules/plugins/lsp/config.nix

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,56 @@ in {
215215
''}
216216
217217
${optionalString usingBlinkCmp ''
218-
capabilities = require('blink.cmp').get_lsp_capabilities()
218+
-- HACK: copied from blink.cmp so the plugin can remain lazy-loaded. Biding our
219+
-- time until dynamic registration comes to save us (i.e. blink v2)
220+
capabilities = {
221+
textDocument = {
222+
completion = {
223+
completionItem = {
224+
snippetSupport = true,
225+
commitCharactersSupport = false,
226+
documentationFormat = {
227+
"markdown",
228+
"plaintext",
229+
},
230+
deprecatedSupport = true,
231+
preselectSupport = false,
232+
tagSupport = {
233+
valueSet = {
234+
1, -- Deprecated
235+
},
236+
},
237+
insertReplaceSupport = true,
238+
resolveSupport = {
239+
properties = {
240+
"documentation",
241+
"detail",
242+
"additionalTextEdits",
243+
"command",
244+
"data",
245+
},
246+
},
247+
insertTextModeSupport = {
248+
valueSet = {
249+
1, -- asIs
250+
},
251+
},
252+
labelDetailsSupport = true,
253+
},
254+
completionList = {
255+
itemDefaults = {
256+
"commitCharacters",
257+
"editRange",
258+
"insertTextFormat",
259+
"insertTextMode",
260+
"data",
261+
},
262+
},
263+
contextSupport = true,
264+
insertTextMode = 1, -- asIs
265+
},
266+
},
267+
}
219268
''}
220269
'';
221270
};

0 commit comments

Comments
 (0)