Skip to content

Commit 8d455d5

Browse files
authored
feat: update more keywords and highlighting (#42)
* feat: update more keywords and highlighting * try my best to make params colored in function calls * fix: drop duplicates * feat: update upstream yaml as debugger do
1 parent 24d7afc commit 8d455d5

File tree

6 files changed

+552
-105
lines changed

6 files changed

+552
-105
lines changed

languages/snakemake.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
],
9595
"onEnterRules": [
9696
{
97-
"beforeText": "\\s*(?:(?:rule|subworkflow|checkpoint|async|class|def|elif|except|for|if|while|with)\\s.*|(?:input|output|params|priority|shadow|group|log|benchmark|message|threads|resources|version|run|shell|script|cwl|container|shellcmd|name|norun|conda_env|container_img|containerized|is_containerized|env_modules|shadow_depth|docstring|notebook|template_engine|cache|path_modifier|handover|default_target|localrule|pepfile|pepschema|conda|singularity|wildcard_constraints|wrapper|else|finally|try))\\s*:\\s*(?:#.*)?$",
97+
"beforeText": "\\s*(?:(?:checkpoint|rule|module|subworkflow|async|class|def|elif|except|for|if|while|with)\\s.*|(?:envvars|include|workdir|configfile|pepfile|pepschema|report|ruleorder|localrules|onsuccess|onerror|onstart|wildcard_constraints|singularity|container|containerized|conda|scattergather|inputflags|outputflags|storage|resource_scopes|name|input|output|params|threads|resources|retries|priority|log|message|benchmark|envmodules|shadow|group|cache|handover|default_target|localrule|version|run|shell|script|notebook|wrapper|template_engine|cwl|snakefile|meta_wrapper|config|skip_validation|replace_prefix|prefix|else|finally|try))\\s*:\\s*(?:#.*)?$",
9898
"action": {
9999
"indent": "indent"
100100
}

src/js/keywords-regex.json

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
2-
"configs": "configfile|envvars|module|scattergather|include|localrules|onerror|onstart|onsuccess|ruleorder|snakefile|workdir|container|containerized|pepfile|pepschema",
3-
"rules": "checkpoint|rule|subworkflow",
4-
"ruleparams": "benchmark|conda|cwl|container|pepfile|pepschema|shellcmd|name|norun|conda_env|container_img|is_containerized|env_modules|shadow_depth|docstring|notebook|template_engine|cache|path_modifier|handover|default_target|localrule|group|input|log|message|notebook|output|params|priority|resources|run|script|shadow|shell|singularity|threads|version|wildcard_constraints|wrapper|default_target|handover|container|containerized|retries",
5-
"functions": "ancient|directory|expand|pipe|protected|report|temp|touch|unpack"
6-
}
2+
"configs": "envvars|include|workdir|configfile|pepfile|pepschema|report|ruleorder|localrules|onsuccess|onerror|onstart|wildcard_constraints|singularity|container|containerized|conda|scattergather|inputflags|outputflags|storage|resource_scopes",
3+
"rules": "checkpoint|rule",
4+
"modules": "module|subworkflow",
5+
"ruleparams": "name|input|output|params|threads|resources|retries|priority|log|message|benchmark|conda|singularity|container|containerized|envmodules|wildcard_constraints|shadow|group|cache|handover|default_target|localrule|version|container_img|is_containerized|shellcmd|norun|conda_env|env_modules|shadow_depth|docstring|path_modifier",
6+
"rulerunparams": "run|shell|script|notebook|wrapper|template_engine|cwl",
7+
"moduleparams": "name|snakefile|meta_wrapper|config|skip_validation|replace_prefix|prefix",
8+
"classes": "Path|WorkflowError",
9+
"objects": "snakemake|rules|workflow|checkpoints|storage|access|scatter|gather",
10+
"ruleargs": "input|output|params|wildcards|threads|resources|log|config",
11+
"functions": "shell|github|gitlab|gitfile|from_queue|protected|temp|temporary|ancient|directory|expand|glob_wildcards|flag|touch|unpack|local|pipe|service|repeat|report|multiext|ensure|update|before_update|lookup|evaluate|branch|collect|exists|subpath|parse_input|extract_checksum|flatten"
12+
}

src/keywords.yaml

+106-44
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,143 @@
11
configs:
2-
- configfile
2+
- envvars
33
- include
4+
- workdir
5+
- configfile
6+
- pepfile
7+
- pepschema
8+
- report
9+
- ruleorder
410
- localrules
11+
- onsuccess
512
- onerror
613
- onstart
7-
- onsuccess
8-
- ruleorder
9-
- scattergather
10-
- snakefile
11-
- workdir
12-
- envvars
13-
- module
14+
- wildcard_constraints
15+
- singularity
16+
- container
1417
- containerized
15-
- pepfile
16-
- pepschema
18+
- conda
19+
- scattergather
20+
- inputflags
21+
- outputflags
22+
- storage
23+
- resource_scopes
1724

1825
rules:
1926
- checkpoint
2027
- rule
28+
29+
modules:
30+
- module
2131
- subworkflow
2232

2333
ruleparams:
24-
- benchmark
25-
- conda
26-
- container
27-
- cwl
28-
- group
34+
- name
2935
- input
30-
- log
31-
- message
32-
- notebook
3336
- output
3437
- params
35-
- priority
38+
- threads
3639
- resources
3740
- retries
38-
- run
39-
- script
40-
- shadow
41-
- shell
41+
- priority
42+
- log
43+
- message
44+
- benchmark
45+
- conda
4246
- singularity
43-
- threads
44-
- version
45-
- wildcard_constraints
46-
- wrapper
47-
- default_target
48-
- pepfile
49-
- pepschema
50-
- template_engine
51-
- handover
5247
- container
5348
- containerized
49+
- envmodules
50+
- wildcard_constraints
51+
- shadow
52+
- group
53+
- cache
54+
- handover
55+
- default_target
56+
- localrule
57+
- version
58+
- container_img
59+
- is_containerized
5460
- shellcmd
55-
- name
5661
- norun
5762
- conda_env
58-
- container_img
59-
- is_containerized
6063
- env_modules
6164
- shadow_depth
6265
- docstring
63-
- notebook
64-
- template_engine
65-
- cache
6666
- path_modifier
67-
- handover
68-
- default_target
69-
- localrule
67+
68+
rulerunparams:
69+
- run
70+
- shell
71+
- script
72+
- notebook
73+
- wrapper
7074
- template_engine
75+
- cwl
76+
77+
moduleparams:
78+
- name
79+
- snakefile
80+
- meta_wrapper
81+
- config
82+
- skip_validation
83+
- replace_prefix
84+
- prefix
85+
86+
classes:
87+
- Path
88+
- WorkflowError
89+
90+
objects:
91+
- snakemake
92+
- rules
93+
- workflow
94+
- checkpoints
95+
- storage
96+
- access
97+
- scatter
98+
- gather
99+
100+
ruleargs:
101+
- input
102+
- output
103+
- params
104+
- wildcards
105+
- threads
106+
- resources
107+
- log
108+
- config
71109

72110
functions:
111+
- shell
112+
- github
113+
- gitlab
114+
- gitfile
115+
- from_queue
116+
- protected
117+
- temp
118+
- temporary
73119
- ancient
74120
- directory
75121
- expand
76-
- pipe
77-
- protected
78-
- temp
122+
- glob_wildcards
123+
- flag
79124
- touch
80125
- unpack
126+
- local
127+
- pipe
128+
- service
129+
- repeat
81130
- report
131+
- multiext
132+
- ensure
133+
- update
134+
- before_update
135+
- lookup
136+
- evaluate
137+
- branch
138+
- collect
139+
- exists
140+
- subpath
141+
- parse_input
142+
- extract_checksum
143+
- flatten

src/yaml/snakemake.language.yaml

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
comments:
2-
lineComment: '#'
2+
lineComment: "#"
33
blockComment: ['"""', '"""']
44

55
brackets:
6-
- ['{', '}']
7-
- ['[', ']']
8-
- ['(', ')']
6+
- ["{", "}"]
7+
- ["[", "]"]
8+
- ["(", ")"]
99

1010
autoClosingPairs:
11-
- ['{', '}']
12-
- ['[', ']']
13-
- ['(', ')']
11+
- ["{", "}"]
12+
- ["[", "]"]
13+
- ["(", ")"]
1414
- ['"""', '"""']
1515
- ['"', '"']
1616
- ['r"', '"']
@@ -22,9 +22,9 @@ autoClosingPairs:
2222
- ["b'", "'"]
2323

2424
surroundingPairs:
25-
- ['{', '}']
26-
- ['[', ']']
27-
- ['(', ')']
25+
- ["{", "}"]
26+
- ["[", "]"]
27+
- ["(", ")"]
2828
- ['"', '"']
2929
- ["'", "'"]
3030

@@ -36,9 +36,7 @@ surroundingPairs:
3636
# decreaseIndentPattern: ^\s*(?:else|finally|(?:elif|except)\b.*)\s*:\s*(#.*)?$
3737

3838
onEnterRules:
39-
- beforeText: >-
40-
\s*(?:(?:rule|subworkflow|checkpoint|async|class|def|elif|except|for|if|while|with)\s.*|(?:input|output|params|priority|shadow|group|log|benchmark|message|threads|resources|version|run|shell|script|cwl|conda|singularity|pepfile|pepschema|container|shellcmd|name|norun|conda_env|container_img|containerized|is_containerized|env_modules|shadow_depth|docstring|notebook|template_engine|cache|path_modifier|handover|default_target|localrule|wildcard_constraints|wrapper|else|finally|try))\s*:\s*(?:#.*)?$
39+
- beforeText: \s*(?:(?:checkpoint|rule|module|subworkflow|async|class|def|elif|except|for|if|while|with)\s.*|(?:envvars|include|workdir|configfile|pepfile|pepschema|report|ruleorder|localrules|onsuccess|onerror|onstart|wildcard_constraints|singularity|container|containerized|conda|scattergather|inputflags|outputflags|storage|resource_scopes|name|input|output|params|threads|resources|retries|priority|log|message|benchmark|envmodules|shadow|group|cache|handover|default_target|localrule|version|run|shell|script|notebook|wrapper|template_engine|cwl|snakefile|meta_wrapper|config|skip_validation|replace_prefix|prefix|else|finally|try))\s*:\s*(?:#.*)?$
4140

4241
action:
43-
4442
indent: indent

0 commit comments

Comments
 (0)