Skip to content

Commit 2c8346d

Browse files
L3MON4D3github-actions[bot]
authored andcommitted
Format with stylua
1 parent 42c8b09 commit 2c8346d

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

lua/luasnip/init.lua

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ end
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.
@@ -305,7 +305,7 @@ end
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
@@ -352,7 +351,7 @@ end
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()
914913
end
915914

916-
917915
---Get the snippet corresponding to some id.
918916
---@param id LuaSnip.SnippetID
919917
---@return LuaSnip.Snippet id_snip
@@ -926,7 +924,7 @@ end
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.
@@ -935,7 +933,7 @@ end
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`.
@@ -975,7 +973,7 @@ end
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.

lua/luasnip/nodes/choiceNode.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ end
5353
---@field restore_cursor boolean? If set, the currently active node is looked up
5454
---in the switched-to choice, and the cursor restored to preserve the current
5555
---position relative to that node. The node may be found if a `restoreNode` is
56-
---present in both choice.
57-
---`false` by default, as enabling might lead to decreased performance.
56+
---present in both choice.
57+
---`false` by default, as enabling might lead to decreased performance.
5858
---
5959
---It's possible to override the default by wrapping the `choiceNode`
6060
---constructor in another function that sets `opts.restore_cursor` to `true` and
@@ -79,11 +79,11 @@ end
7979
---[Basics-Jump-Index](../../../DOC.md#jump-index)).
8080
---@param choices table<integer, LuaSnip.Node|LuaSnip.Node[]> A list of nodes
8181
---that can be switched between. If a list of nodes is passed as a choice, it
82-
---will be turned into a snippetNode.
82+
---will be turned into a snippetNode.
8383
---Jumpable nodes that generally need a jump-index don't need one when used as a
8484
---choice, they inherit the choiceNode's jump-index. Additionally, one should
8585
---make sure the cursor has a position to stop at inside every choice, since
86-
---changing the choice is generally only possible when inside the choiceNode.
86+
---changing the choice is generally only possible when inside the choiceNode.
8787
---This means that in `sn(nil, {...nodes...})` `nodes` has to contain an
8888
---`i(1)`, otherwise LuaSnip will just "jump through" the nodes, making it
8989
---impossible to change the choice after switching to it. Using an `insertNode`

lua/luasnip/nodes/node.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local Node = {}
1919
---@field merge_node_ext_opts boolean? Whether to use the parents' `ext_opts` to
2020
---compute this nodes' `ext_opts`.
2121
---@field key any? Some unique value (strings seem useful) to identify this
22-
---node.
22+
---node.
2323
---This is useful for [Key Indexer](../../../DOC.md#key-indexer) or for finding the node at
2424
---runtime (See [Snippets-API](../../../DOC.md#snippets-api)
2525
---These keys don't have to be unique across the entire lifetime of the snippet,

0 commit comments

Comments
 (0)