diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 695171c1..0000baa6 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -148,7 +148,7 @@ html_tags (queries only)[^html_tags] | unstable | `H IJ ` | @TravonteD [jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | unstable | `H  J ` | @cathaysia [jq](https://github.com/flurie/tree-sitter-jq) | unstable | `H  JL` | @ObserverOfTime [jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | unstable | `H    ` | @steelsojka -[json](https://github.com/tree-sitter/tree-sitter-json) | unstable | `HFI L` | @steelsojka +[json](https://github.com/tree-sitter/tree-sitter-json) | unstable | `HFIJL` | @steelsojka [json5](https://github.com/Joakker/tree-sitter-json5) | unstable | `H  J ` | @Joakker [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | unstable | `HF JL` | @nawordar jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index 5e23adff..7759c1f5 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -24,6 +24,7 @@ local filetypes = { ini = { 'confini', 'dosini' }, janet_simple = { 'janet' }, javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' }, + json = { 'jsonc' }, glimmer_javascript = { 'javascript.glimmer' }, latex = { 'tex' }, linkerscript = { 'ld' }, diff --git a/runtime/queries/json/highlights.scm b/runtime/queries/json/highlights.scm index 85915285..61f08716 100644 --- a/runtime/queries/json/highlights.scm +++ b/runtime/queries/json/highlights.scm @@ -36,3 +36,5 @@ ((escape_sequence) @conceal (#eq? @conceal "\\\"") (#set! conceal "\"")) + +(comment) @comment @spell diff --git a/runtime/queries/json/indents.scm b/runtime/queries/json/indents.scm index 8274ee3d..3680289b 100644 --- a/runtime/queries/json/indents.scm +++ b/runtime/queries/json/indents.scm @@ -7,3 +7,5 @@ "}" "]" ] @indent.branch + +(comment) @indent.ignore diff --git a/runtime/queries/json/injections.scm b/runtime/queries/json/injections.scm new file mode 100644 index 00000000..2f0e58eb --- /dev/null +++ b/runtime/queries/json/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment"))