Skip to content

Commit

Permalink
Fix a raw string replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Mar 11, 2024
1 parent 8ed7c04 commit 0727c26
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
49 changes: 24 additions & 25 deletions build-flavored-queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,22 @@
# Old nvim-treesitter before updates
REPLACEMENTS_NVIM_OLD = [
# Changes to local captures
(r"@local.definition", "@definition"),
(r"@local.reference[\w.]*", "@reference"),
(r"@local.scope", "@scope"),
(r"@local.definition", r"@definition"),
(r"@local.reference[\w.]*", r"@reference"),
(r"@local.scope", r"@scope"),
# Changes to highlight queries
(r"@comment.line", "@comment"),
(r"@comment.around", "@comment.outer"),
(r"@constant.builtin.boolean", "@boolean"),
(r"@comment.line", r"@comment"),
(r"@constant.builtin.boolean", r"@boolean"),
(r"@constant.character.escape", "@string.escape"),
(r"@keyword.control.conditional", "@conditional"),
(r"@keyword.control.import", "@keyword"),
(r"@keyword.module", "@keyword"),
(r"@variable.parameter", "@parameter"),
(r"@keyword.control.conditional", r"@conditional"),
(r"@keyword.control.import", r"@keyword"),
(r"@keyword.module", r"@keyword"),
(r"@variable.parameter", r"@parameter"),
# Changes to indent queries
(r"@indent\s+@extend", "@indent.begin"),
(r"@indent\s+@extend", r"@indent.begin"),
# Changes to textobject queries
(r"(@[\w.]+.)inside", r"\1inner"),
(r"(@[\w.]+.)around", r"\1outer"),
(r"(@[\w.]+\.)inside", r"\1inner"),
(r"(@[\w.]+\.)around", r"\1outer"),
# nvim uses `var` rather than `variable`
(r"(@[\w.]+)\.variable", r"\1.var"),
]
Expand Down Expand Up @@ -326,17 +325,17 @@
# Old nvim-treesitter before updates
REPLACEMENTS_NVIM = [
# Changes to highlight queries
(r"@comment.line", "@comment"),
(r"@constant.builtin.boolean", "@boolean"),
(r"@constant.character.escape", "@string.escape"),
(r"@keyword.module", "@module"),
(r"@keyword.control.", "@keyword."),
(r"@namespace", "@module"),
(r"@comment.line", r"@comment"),
(r"@constant.builtin.boolean", r"@boolean"),
(r"@constant.character.escape", r"@string.escape"),
(r"@keyword.module", r"@module"),
(r"@keyword.control.", r"@keyword."),
(r"@namespace", r"@module"),
# Changes to indent queries
(r"@indent\s+@extend", "@indent.begin"),
(r"@indent\s+@extend", r"@indent.begin"),
# Changes to textobject queries
(r"(@[\w.]+).inside", "\1.inner"),
(r"(@[\w.]+).around", "\1.outer"),
(r"(@[\w.]+\.)inside", r"\1inner"),
(r"(@[\w.]+\.)around", r"\1outer"),
# nvim uses `var` rather than `variable`
(r"(@[\w.]+)\.variable", r"\1.var"),
# nothing more specific than reference
Expand Down Expand Up @@ -443,9 +442,9 @@
}

REPLACEMENTS_HELIX = [
(r"@keyword.module", "@keyword.directive"),
(r"@function.call", "@function"),
(r"@spell ?", ""),
(r"@keyword.module", r"@keyword.directive"),
(r"@function.call", r"@function"),
(r"@spell ?", r""),
# nothing more specific than reference
(r"(@local.reference)[\w.]+", r"\1"),
]
Expand Down
10 changes: 5 additions & 5 deletions queries-flavored/nvim-next/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
; Specify how to navigate around logical blocks in code

(recipe
(recipe_body) .inner) .outer
(recipe_body) @function.inner) @function.outer

(parameters
((_) .inner . ","? .outer)) .outer
((_) @parameter.inner . ","? @parameter.outer)) @parameter.outer

(dependency_expression
(_) .inner) .outer
(_) @parameter.inner) @parameter.outer

(function_call
arguments: (sequence
(expression) .inner) .outer) .outer
(expression) @parameter.inner) @parameter.outer) @function.outer

(comment) .outer
(comment) @comment.outer

0 comments on commit 0727c26

Please sign in to comment.