Skip to content

Commit 1888b7b

Browse files
committed
chore(luasnip): deprecate opts.prefer_doc_trig
This setting, which prefers `docTrig` over the trigger, is confusing and has seen little adoption despite its usefulness. Users can still opt out in v1.0, but the option will be removed in v2.0 to simplify the codebase.
1 parent 3fc1815 commit 1888b7b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/configuration/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ sources.providers = {
581581
-- Whether to show autosnippets in the completion list
582582
show_autosnippets = true,
583583
-- Whether to prefer docTrig placeholders over trig when expanding regTrig snippets
584-
prefer_doc_trig = false,
584+
prefer_doc_trig = true,
585585
-- Whether to put the snippet description in the label description
586586
use_label_description = false,
587587
}

lua/blink/cmp/sources/snippets/luasnip.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local kind_snippet = require('blink.cmp.types').CompletionItemKind.Snippet
77
--- @class blink.cmp.LuasnipSourceOptions
88
--- @field use_show_condition? boolean Whether to use show_condition for filtering snippets
99
--- @field show_autosnippets? boolean Whether to show autosnippets in the completion list
10-
--- @field prefer_doc_trig? boolean When expanding `regTrig` snippets, prefer `docTrig` over `trig` placeholder
10+
--- @field prefer_doc_trig? boolean When expanding `regTrig` snippets, prefer `docTrig` over `trig` placeholder (deprecated)
1111
--- @field use_label_description? boolean Whether to put the snippet description in the label description
1212

1313
--- @class blink.cmp.LuasnipSource : blink.cmp.Source
@@ -55,13 +55,13 @@ function source.new(opts)
5555
opts = vim.tbl_deep_extend('keep', opts or {}, {
5656
use_show_condition = true,
5757
show_autosnippets = true,
58-
prefer_doc_trig = false,
58+
prefer_doc_trig = true, -- TODO: Remove in v2.0
5959
use_label_description = false,
6060
})
6161
require('blink.cmp.config.utils').validate('sources.providers.snippets.opts', {
6262
use_show_condition = { opts.use_show_condition, 'boolean' },
6363
show_autosnippets = { opts.show_autosnippets, 'boolean' },
64-
prefer_doc_trig = { opts.prefer_doc_trig, 'boolean' },
64+
prefer_doc_trig = { opts.prefer_doc_trig, 'boolean' }, -- TODO: Remove in v2.0
6565
use_label_description = { opts.use_label_description, 'boolean' },
6666
}, opts)
6767

0 commit comments

Comments
 (0)