aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Choly <ilia.choly@gmail.com>2024-05-31 11:47:32 -0400
committerLewis Russell <me@lewisr.dev>2024-06-01 12:56:43 +0100
commit9eb0426002696fba4a7c5b9cadd8799a8ae18e6a (patch)
tree3d28bf75fdebbc11f39c1b4d1b9006618bd762a1
parentf2083bd55cafe861e9dffb1c1658e5b0983c5ef6 (diff)
downloadrneovim-9eb0426002696fba4a7c5b9cadd8799a8ae18e6a.tar.gz
rneovim-9eb0426002696fba4a7c5b9cadd8799a8ae18e6a.tar.bz2
rneovim-9eb0426002696fba4a7c5b9cadd8799a8ae18e6a.zip
fix(luacats): allow all types inside tuples
-rw-r--r--scripts/luacats_grammar.lua2
-rw-r--r--test/functional/script/luacats_grammar_spec.lua4
2 files changed, 3 insertions, 3 deletions
diff --git a/scripts/luacats_grammar.lua b/scripts/luacats_grammar.lua
index 6742eab5e9..9360eb9417 100644
--- a/scripts/luacats_grammar.lua
+++ b/scripts/luacats_grammar.lua
@@ -180,7 +180,7 @@ local grammar = P {
fun_param = lname * opt(colon * v.ltype),
ty_fun = Pf('fun') * paren(comma(lname * opt(colon * v.ltype))) * opt(colon * comma1(v.ltype)),
ty_generic = P('`') * letter * P('`'),
- ty_tuple = Pf('[') * comma(v.ty_opt) * fill * P(']'),
+ ty_tuple = Pf('[') * comma(v.ltype) * fill * P(']'),
}
return grammar --[[@as nvim.luacats.grammar]]
diff --git a/test/functional/script/luacats_grammar_spec.lua b/test/functional/script/luacats_grammar_spec.lua
index d6fff3f409..9c6417f7bf 100644
--- a/test/functional/script/luacats_grammar_spec.lua
+++ b/test/functional/script/luacats_grammar_spec.lua
@@ -160,10 +160,10 @@ describe('luacats grammar', function()
type = '`T`',
})
- test('@param type [number,string] this is a tuple type', {
+ test('@param type [number,string,"good"|"bad"] this is a tuple type', {
desc = 'this is a tuple type',
kind = 'param',
name = 'type',
- type = '[number,string]',
+ type = '[number,string,"good"|"bad"]',
})
end)