Skip to content

Commit

Permalink
chore: capture whitespaces for meta-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-semenov committed May 15, 2024
1 parent 858c890 commit 6283166
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/support.YAML-tmLanguage.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ repository:
meta-commands:
patterns:
-
match: '^\s*(##(?!\b)|#(?!\b)|\{{ scopes["support.function"] | join("|\\") }})'
match: '^(\s*)(##(?=\s*$)|#(?=\s*$)|\{{ scopes["support.function"] | join("|\\") }})'
captures:
1:
name: constant.character.whitespace.parigp
2:
name: support.function.parigp
4 changes: 3 additions & 1 deletion src/type-hints.YAML-tmLanguage.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ repository:
type-hints:
patterns:
-
match: '\s*\b({{ scopes["support.type"] | join("|") }})\b'
match: '(\s*)\b({{ scopes["support.type"] | join("|") }})\b'
captures:
1:
name: keyword.operator.cardinality.parigp
2:
name: support.type.parigp
5 changes: 3 additions & 2 deletions tests/functions.test.gp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@
## ^^ source.parigp meta.parens.parigp constant.numeric.int.parigp
## ^ source.parigp meta.parens.parigp punctuation.section.parens.end.parigp

\q
##^^ source.parigp support.function.parigp
\q
##^^ source.parigp constant.character.whitespace.parigp
## ^^ source.parigp support.function.parigp

\w "output.txt"
##^^ source.parigp support.function.parigp
Expand Down
1 change: 0 additions & 1 deletion tests/others/subgroups.test.gp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
## ^ source.parigp meta.block.parigp meta.parens.parigp meta.parens.parigp punctuation.section.parens.end.parigp
,
##^ source.parigp meta.block.parigp meta.parens.parigp markup.punctuation.separator.parigp
## ^ source.parigp meta.block.parigp meta.parens.parigp constant.character.whitespace.parigp
M = G[1];
##^^ ^ ^ source.parigp meta.block.parigp meta.parens.parigp constant.character.whitespace.parigp
## ^ ^ source.parigp meta.block.parigp meta.parens.parigp variable.name.parigp
Expand Down

0 comments on commit 6283166

Please sign in to comment.