aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/_snippet.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-07-07 18:27:18 +0200
committerGitHub <noreply@github.com>2022-07-07 18:27:18 +0200
commitaa4f9c5341f5280f16cce0630ea54b84eef717b3 (patch)
tree52e82a04b3f364f50b810c92c0e0a3378ccd17a0 /runtime/lua/vim/lsp/_snippet.lua
parent34d41baf8a8e4ab8c006b7f29a8106e60e311aa2 (diff)
downloadrneovim-aa4f9c5341f5280f16cce0630ea54b84eef717b3.tar.gz
rneovim-aa4f9c5341f5280f16cce0630ea54b84eef717b3.tar.bz2
rneovim-aa4f9c5341f5280f16cce0630ea54b84eef717b3.zip
refactor(lua): reformat with stylua 0.14.0 (#19264)
* reformat Lua runtime to make lint CI pass * reduce max line length to 100
Diffstat (limited to 'runtime/lua/vim/lsp/_snippet.lua')
-rw-r--r--runtime/lua/vim/lsp/_snippet.lua71
1 files changed, 57 insertions, 14 deletions
diff --git a/runtime/lua/vim/lsp/_snippet.lua b/runtime/lua/vim/lsp/_snippet.lua
index 910deba556..3488639fb4 100644
--- a/runtime/lua/vim/lsp/_snippet.lua
+++ b/runtime/lua/vim/lsp/_snippet.lua
@@ -255,7 +255,13 @@ S.format = P.any(
S.int,
S.colon,
S.slash,
- P.any(P.token('upcase'), P.token('downcase'), P.token('capitalize'), P.token('camelcase'), P.token('pascalcase')),
+ P.any(
+ P.token('upcase'),
+ P.token('downcase'),
+ P.token('capitalize'),
+ P.token('camelcase'),
+ P.token('pascalcase')
+ ),
S.close
),
function(values)
@@ -272,7 +278,12 @@ S.format = P.any(
S.open,
S.int,
S.colon,
- P.seq(S.question, P.opt(P.take_until({ ':' }, { '\\' })), S.colon, P.opt(P.take_until({ '}' }, { '\\' }))),
+ P.seq(
+ S.question,
+ P.opt(P.take_until({ ':' }, { '\\' })),
+ S.colon,
+ P.opt(P.take_until({ '}' }, { '\\' }))
+ ),
S.close
),
function(values)
@@ -285,7 +296,14 @@ S.format = P.any(
end
),
P.map(
- P.seq(S.dollar, S.open, S.int, S.colon, P.seq(S.plus, P.opt(P.take_until({ '}' }, { '\\' }))), S.close),
+ P.seq(
+ S.dollar,
+ S.open,
+ S.int,
+ S.colon,
+ P.seq(S.plus, P.opt(P.take_until({ '}' }, { '\\' }))),
+ S.close
+ ),
function(values)
return setmetatable({
type = Node.Type.FORMAT,
@@ -296,7 +314,15 @@ S.format = P.any(
end
),
P.map(
- P.seq(S.dollar, S.open, S.int, S.colon, S.minus, P.opt(P.take_until({ '}' }, { '\\' })), S.close),
+ P.seq(
+ S.dollar,
+ S.open,
+ S.int,
+ S.colon,
+ S.minus,
+ P.opt(P.take_until({ '}' }, { '\\' })),
+ S.close
+ ),
function(values)
return setmetatable({
type = Node.Type.FORMAT,
@@ -306,14 +332,17 @@ S.format = P.any(
}, Node)
end
),
- P.map(P.seq(S.dollar, S.open, S.int, S.colon, P.opt(P.take_until({ '}' }, { '\\' })), S.close), function(values)
- return setmetatable({
- type = Node.Type.FORMAT,
- capture_index = values[3],
- if_text = '',
- else_text = values[5] and values[5].esc or '',
- }, Node)
- end)
+ P.map(
+ P.seq(S.dollar, S.open, S.int, S.colon, P.opt(P.take_until({ '}' }, { '\\' })), S.close),
+ function(values)
+ return setmetatable({
+ type = Node.Type.FORMAT,
+ capture_index = values[3],
+ if_text = '',
+ else_text = values[5] and values[5].esc or '',
+ }, Node)
+ end
+ )
)
S.transform = P.map(
@@ -359,7 +388,14 @@ S.tabstop = P.any(
S.placeholder = P.any(
P.map(
- P.seq(S.dollar, S.open, S.int, S.colon, P.opt(P.many(P.any(S.toplevel, S.text({ '$', '}' }, { '\\' })))), S.close),
+ P.seq(
+ S.dollar,
+ S.open,
+ S.int,
+ S.colon,
+ P.opt(P.many(P.any(S.toplevel, S.text({ '$', '}' }, { '\\' })))),
+ S.close
+ ),
function(values)
return setmetatable({
type = Node.Type.PLACEHOLDER,
@@ -419,7 +455,14 @@ S.variable = P.any(
}, Node)
end),
P.map(
- P.seq(S.dollar, S.open, S.var, S.colon, P.many(P.any(S.toplevel, S.text({ '$', '}' }, { '\\' }))), S.close),
+ P.seq(
+ S.dollar,
+ S.open,
+ S.var,
+ S.colon,
+ P.many(P.any(S.toplevel, S.text({ '$', '}' }, { '\\' }))),
+ S.close
+ ),
function(values)
return setmetatable({
type = Node.Type.VARIABLE,