209209--- Find the node the next jump will end up at. This will not work always,
210210--- because we will not update the node before jumping, so if the jump would eg.
211211--- insert a new node between this node and its pre-update jump target, this
212- --- would not be registered.
212+ --- would not be registered.
213213--- Thus, it currently only works for simple cases.
214214--- @param dir 1| -1 ` 1`: find the next node , ` -1`: find the previous node.
215215--- @return LuaSnip.Node target The destination.
305305--- variables of the expanded snippet (Defaults to `{}`).
306306
307307--- @class LuaSnip.Opts.Expand
308- --- @field jump_into_func (fun ( snip : LuaSnip.Snippet ): LuaSnip.Node )?
308+ --- @field jump_into_func (fun ( snip : LuaSnip.Snippet ): LuaSnip.Node )?
309309--- Callback responsible for jumping into the snippet. The returned node is
310310--- set as the new active node, i.e. it is the origin of the next jump.
311311--- The default is basically this:
@@ -324,22 +324,21 @@ end
324324--- end
325325--- ```
326326
327-
328327-- This can also use `jump_into_func`.
329328--- @class LuaSnip.Opts.SnipExpand : LuaSnip.Opts.Expand
330329--- @field clear_region ? LuaSnip.BufferRegion A region of text to clear after
331330--- populating env-variables, but before jumping into `snip`. If `nil`, no
332- --- clearing is performed.
331+ --- clearing is performed.
333332--- Being able to remove text at this point is useful as clearing before calling
334333--- this function would populate `TM_CURRENT_LINE` and `TM_CURRENT_WORD` with
335- --- wrong values (they would miss the snippet trigger).
334+ --- wrong values (they would miss the snippet trigger).
336335--- The actual values used for clearing are `region.from` and `region.to`, both
337- --- (0,0)-indexed byte-positions in the buffer.
336+ --- (0,0)-indexed byte-positions in the buffer.
338337--- @field expand_params LuaSnip.Opts.SnipExpandExpandParams ? Override various
339- --- fields of the expanded snippet. Don't override anything by default.
338+ --- fields of the expanded snippet. Don't override anything by default.
340339--- This is useful for manually expanding snippets where the trigger passed
341340--- via `trig` is not the text triggering the snippet, or those which expect
342- --- `captures` (basically, snippets with a non-plaintext `trigEngine`).
341+ --- `captures` (basically, snippets with a non-plaintext `trigEngine`).
343342---
344343--- One Example:
345344--- ```lua
352351--- @field pos [integer , integer] ? Position at which the snippet should be
353352--- inserted. Pass as `(row,col)`, both 0-based, the `col` given in bytes.
354353--- @field indent boolean ? Whether to prepend the current lines ' indent to all
355- --- lines of the snippet. `true` by default.
354+ --- lines of the snippet. `true` by default.
356355--- Turning this off is a good idea when a LSP server already takes indents into
357356--- consideration. In such cases, LuaSnip should not add additional indents. If
358357--- you are using `nvim-cmp`, this could be used as follows:
@@ -913,7 +912,6 @@ function API.get_snip_env()
913912 return session .get_snip_env ()
914913end
915914
916-
917915--- Get the snippet corresponding to some id.
918916--- @param id LuaSnip.SnippetID
919917--- @return LuaSnip.Snippet id_snip
926924--- not defined for an individual snippet. Defaults to `"snippets"`.
927925--- @field key ? string This key uniquely identifies this call to ` add_snippets` .
928926--- If another call has the same `key`, the snippets added in this call will be
929- --- removed.
927+ --- removed.
930928--- This is useful for reloading snippets once they are updated.
931929--- @field override_priority integer Override the priority of individual
932930--- snippets.
935933--- @field refresh_notify boolean ? Whether to call ` refresh_notify` once the
936934--- snippets are added. Defaults to true.
937935
938- --- Add snippets to luasnip's snippet-collection.
936+ --- Add snippets to luasnip's snippet-collection.
939937--- This also calls `refresh_notify`.
940938--- @param ft string ? The filetype to add the snippets to , or nil if the filetype
941939--- is specified in `snippets`.
975973--- @field inv_limit integer ? If set , invalidated snippets are only cleared if
976974--- their number exceeds `inv_limit`.
977975
978- --- Clean invalidated snippets from internal snippet storage.
976+ --- Clean invalidated snippets from internal snippet storage.
979977--- Invalidated snippets are still stored; it might be useful to actually remove
980978--- them as they still have to be iterated during expansion.
981979--- @param opts LuaSnip.Opts.CleanInvalidated ? Additional , optional arguments.
0 commit comments