mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
feat(treesitter): support for snakemake (#316)
* add snakemake, based off of python * add snakemake test file * add example (but currently incorrect) test file * fix tests
This commit is contained in:
parent
ffdda791c0
commit
c306ffcf34
4 changed files with 79 additions and 0 deletions
19
queries/snakemake/aerial.scm
Normal file
19
queries/snakemake/aerial.scm
Normal file
|
@ -0,0 +1,19 @@
|
|||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @type
|
||||
|
||||
(class_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @type
|
||||
|
||||
(assignment
|
||||
left: (_) @name
|
||||
(#set! "kind" "Variable")
|
||||
) @type
|
||||
|
||||
(rule_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @type
|
|
@ -9,6 +9,7 @@ vim.filetype.add({
|
|||
norg = "norg", -- Neovim doesn't have built-in norg filetype detection
|
||||
usd = "usd", -- Neovim doesn't have built-in USD filetype detection
|
||||
usda = "usd", -- Neovim doesn't have built-in USD filetype detection
|
||||
smk = "snakemake", -- Neovim doesn't have built-in Snakemake filetype detection
|
||||
},
|
||||
})
|
||||
|
||||
|
|
47
tests/symbols/snakemake_test.json
Normal file
47
tests/symbols/snakemake_test.json
Normal file
|
@ -0,0 +1,47 @@
|
|||
[
|
||||
{
|
||||
"col": 0,
|
||||
"end_col": 27,
|
||||
"end_lnum": 7,
|
||||
"kind": "Class",
|
||||
"level": 0,
|
||||
"lnum": 1,
|
||||
"name": "all",
|
||||
"selection_range": {
|
||||
"col": 5,
|
||||
"end_col": 8,
|
||||
"end_lnum": 1,
|
||||
"lnum": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"col": 0,
|
||||
"end_col": 8,
|
||||
"end_lnum": 10,
|
||||
"kind": "Function",
|
||||
"level": 0,
|
||||
"lnum": 9,
|
||||
"name": "f",
|
||||
"selection_range": {
|
||||
"col": 4,
|
||||
"end_col": 5,
|
||||
"end_lnum": 9,
|
||||
"lnum": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"col": 0,
|
||||
"end_col": 10,
|
||||
"end_lnum": 12,
|
||||
"kind": "Variable",
|
||||
"level": 0,
|
||||
"lnum": 12,
|
||||
"name": "var",
|
||||
"selection_range": {
|
||||
"col": 0,
|
||||
"end_col": 3,
|
||||
"end_lnum": 12,
|
||||
"lnum": 12
|
||||
}
|
||||
}
|
||||
]
|
12
tests/treesitter/snakemake_test.smk
Normal file
12
tests/treesitter/snakemake_test.smk
Normal file
|
@ -0,0 +1,12 @@
|
|||
rule all:
|
||||
input:
|
||||
"b.txt"
|
||||
output:
|
||||
"c.txt"
|
||||
shell:
|
||||
"ls -la > {output}"
|
||||
|
||||
def f():
|
||||
pass
|
||||
|
||||
var = 'hi'
|
Loading…
Reference in a new issue