diff options
| author | Teddytrombone <github@tmk-stgeorgen.at> | 2023-10-24 09:48:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-24 07:48:33 +0000 |
| commit | 16af5ef490ff37407cc4241d7b8b8798d5b3a726 (patch) | |
| tree | 76a164dc751f46e5f5cb38a724ce55957b5786e2 | |
| parent | Update parsers: liquidsoap, wing (#5568) (diff) | |
| download | nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.tar nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.tar.gz nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.tar.bz2 nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.tar.lz nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.tar.xz nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.tar.zst nvim-treesitter-16af5ef490ff37407cc4241d7b8b8798d5b3a726.zip | |
feat(typoscript) Added parser and queries for TypoScript (#5564)
* Added configuration for TypoScript
* Removed duplicated code; Applied folding suggestion
* Applied suggestions
* Update queries/typoscript/highlights.scm
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
---------
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 8 | ||||
| -rw-r--r-- | queries/typoscript/folds.scm | 1 | ||||
| -rw-r--r-- | queries/typoscript/highlights.scm | 46 | ||||
| -rw-r--r-- | queries/typoscript/indents.scm | 5 | ||||
| -rw-r--r-- | queries/typoscript/injections.scm | 2 |
6 files changed, 65 insertions, 0 deletions
diff --git a/lockfile.json b/lockfile.json index a16b49b05..8d206fef4 100644 --- a/lockfile.json +++ b/lockfile.json @@ -638,6 +638,9 @@ "typescript": { "revision": "d847898fec3fe596798c9fda55cb8c05a799001a" }, + "typoscript": { + "revision": "43b221c0b76e77244efdaa9963e402a17c930fbc" + }, "ungrammar": { "revision": "debd26fed283d80456ebafa33a06957b0c52e451" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3e4e39006..c9ba50b37 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1874,6 +1874,14 @@ list.typescript = { maintainers = { "@steelsojka" }, } +list.typoscript = { + install_info = { + url = "https://github.com/Teddytrombone/tree-sitter-typoscript", + files = { "src/parser.c" }, + }, + maintainers = { "@Teddytrombone" }, +} + list.ungrammar = { install_info = { url = "https://github.com/Philipp-M/tree-sitter-ungrammar", diff --git a/queries/typoscript/folds.scm b/queries/typoscript/folds.scm new file mode 100644 index 000000000..fd7d23999 --- /dev/null +++ b/queries/typoscript/folds.scm @@ -0,0 +1 @@ +(block) @fold diff --git a/queries/typoscript/highlights.scm b/queries/typoscript/highlights.scm new file mode 100644 index 000000000..9ce80c680 --- /dev/null +++ b/queries/typoscript/highlights.scm @@ -0,0 +1,46 @@ +(identifier) @field + +(constant) @constant + +(modifier_function) @function +(modifier_predefined) @function.builtin + +[ + (condition) + (condition_end) + (condition_else) +] @conditional + +(cobject) @type.builtin + +[ + "@import" + "INCLUDE_TYPOSCRIPT" +] @include + +[ + (comment) + (single_line_comment) +] @comment @spell + +[ + (string) + (multiline_value) +] @string + +[ + "=" + ">" + "<" + ":=" + "=<" + (condition_bool) +] @operator + +"," @punctuation.delimiter + +[ + "(" + ")" + (block_punctuation) + ] @punctuation.bracket diff --git a/queries/typoscript/indents.scm b/queries/typoscript/indents.scm new file mode 100644 index 000000000..f3d15b720 --- /dev/null +++ b/queries/typoscript/indents.scm @@ -0,0 +1,5 @@ +(block) @indent.begin + +"}" @indent.branch @indent.end + +(comment) @indent.ignore diff --git a/queries/typoscript/injections.scm b/queries/typoscript/injections.scm new file mode 100644 index 000000000..6adae45a2 --- /dev/null +++ b/queries/typoscript/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
