diff options
| author | Tristan Knight <tris203@gmail.com> | 2025-02-01 19:06:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-01 20:06:26 +0100 |
| commit | 39bf51ff68800a78156258fd3beca81a87895103 (patch) | |
| tree | dcbd679e375be57368e2771faa7b370cf25b693b /queries | |
| parent | bot(lockfile): update bash, desktop, haskell, julia, nix, objc, typst (diff) | |
| download | nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.tar nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.tar.gz nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.tar.bz2 nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.tar.lz nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.tar.xz nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.tar.zst nvim-treesitter-39bf51ff68800a78156258fd3beca81a87895103.zip | |
feat(razor): add parser and queries (#7545)
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/razor/folds.scm | 14 | ||||
| -rw-r--r-- | queries/razor/highlights.scm | 58 | ||||
| -rw-r--r-- | queries/razor/injections.scm | 11 |
3 files changed, 83 insertions, 0 deletions
diff --git a/queries/razor/folds.scm b/queries/razor/folds.scm new file mode 100644 index 000000000..f026cb8ec --- /dev/null +++ b/queries/razor/folds.scm @@ -0,0 +1,14 @@ +[ + (razor_if) + (razor_switch) + (razor_for) + (razor_foreach) + (razor_while) + (razor_do_while) + (razor_try) + (razor_catch) + (razor_finally) + (razor_compound_using) + (razor_section) + (razor_block) +] @fold diff --git a/queries/razor/highlights.scm b/queries/razor/highlights.scm new file mode 100644 index 000000000..2050bde9c --- /dev/null +++ b/queries/razor/highlights.scm @@ -0,0 +1,58 @@ +; inherits: c_sharp + +[ + (razor_comment) + (html_comment) +] @comment @spell + +[ + "at_page" + "at_using" + "at_model" + "at_rendermode" + "at_inject" + "at_implements" + "at_layout" + "at_inherits" + "at_attribute" + "at_typeparam" + "at_namespace" + "at_preservewhitespace" + "at_block" + "at_at_escape" + "at_colon_transition" +] @constant.macro + +[ + "at_lock" + "at_section" +] @keyword + +[ + "at_if" + "at_switch" +] @keyword.conditional + +[ + "at_for" + "at_foreach" + "at_while" + "at_do" +] @keyword.repeat + +[ + "at_try" + "catch" + "finally" +] @keyword.exception + +[ + "at_implicit" + "at_explicit" +] @variable + +"at_await" @keyword.coroutine + +(razor_rendermode) @property + +(razor_attribute_name) @function diff --git a/queries/razor/injections.scm b/queries/razor/injections.scm new file mode 100644 index 000000000..fe28d8611 --- /dev/null +++ b/queries/razor/injections.scm @@ -0,0 +1,11 @@ +; inherits: c_sharp + +([ + (html_comment) + (razor_comment) +] @comment + (#set! injection.language "comment")) + +((element) @injection.content + (#set! injection.language "html") + (#set! injection.combined)) |
