Skip to content

Commit

Permalink
feat(snippet): snippets may be marked as hidden.
Browse files Browse the repository at this point in the history
They won't show up in completion results of engines respecting the key.
  • Loading branch information
L3MON4D3 committed Oct 13, 2021
1 parent b2e08b7 commit b3e60e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ entries:
`dscr`. Overrides docstrings loaded from json.
- `docTrig`: string, for snippets triggered using a lua pattern: define the
trigger that is used during docstring-generation.
- `hidden`: hint for completion-engines, if set, the snippet should not show
up when querying snippets.

`s` can also be a single string, in which case it is used instead of `trig`, all
other values being defaulted:
Expand Down
1 change: 1 addition & 0 deletions lua/luasnip/nodes/snippet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ local function S(context, nodes, opts)
dependents = {},
active = false,
type = types.snippet,
hidden = context.hidden,
})
-- is propagated to all subsnippets, used to quickly find the outer snippet
snip.snippet = snip
Expand Down

0 comments on commit b3e60e1

Please sign in to comment.