mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 14:14:03 +02:00
feat: support for fish
This commit is contained in:
parent
27a725e034
commit
2d1dadab5c
2 changed files with 83 additions and 0 deletions
10
queries/fish/context.scm
Normal file
10
queries/fish/context.scm
Normal file
|
@ -0,0 +1,10 @@
|
|||
([
|
||||
(function_definition)
|
||||
(while_statement)
|
||||
(for_statement)
|
||||
(switch_statement)
|
||||
(case_clause)
|
||||
(if_statement)
|
||||
(else_if_clause)
|
||||
(else_clause)
|
||||
]) @context
|
73
test/test.fish
Normal file
73
test/test.fish
Normal file
|
@ -0,0 +1,73 @@
|
|||
#!/usr/bin/env fish
|
||||
function foo
|
||||
|
||||
while true
|
||||
|
||||
|
||||
|
||||
|
||||
echo 'foo'
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
switch (uname)
|
||||
case 'Linux'
|
||||
echo 'Linux'
|
||||
case 'Darwin'
|
||||
echo 'Mac'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
otherwise
|
||||
echo 'Windows'
|
||||
end
|
||||
|
||||
if grep fish /etc/shells
|
||||
echo Found fish
|
||||
else if grep bash /etc/shells
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo Found bash
|
||||
else
|
||||
echo Got nothing
|
||||
end
|
||||
|
||||
for file in *.txt
|
||||
|
||||
|
||||
|
||||
cp $file $file.bak
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue