From 9b5d24111e7ce6bce56ebb2771f6468bb0fb00ea Mon Sep 17 00:00:00 2001 From: Shawon Date: Mon, 26 May 2025 00:33:50 +0600 Subject: [PATCH 1/9] feat(parsers): Add qf(quickfix0 --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 ++++++++ runtime/queries/qf/highlights.scm | 26 ++++++++++++++++++++++++++ runtime/queries/qf/injections.scm | 15 +++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 runtime/queries/qf/highlights.scm create mode 100644 runtime/queries/qf/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 94e105085..c411f6285 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -226,6 +226,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [purescript](https://github.com/postsolar/tree-sitter-purescript) | unstable | `H  JL` | | @postsolar [pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | unstable | `H  J ` | | @ObserverOfTime [python](https://github.com/tree-sitter/tree-sitter-python) | unstable | `HFIJL` | | @stsewd, @theHamsta +[qf](https://github.com/OXY2DEV/tree-sitter-qf) | stable | `H  J ` | | @OXY2DEV [ql](https://github.com/tree-sitter/tree-sitter-ql) | unstable | `HFIJL` | | @pwntester [qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | unstable | `H  J ` | | @amaanq [qmljs](https://github.com/yuja/tree-sitter-qmljs) | unstable | `HF J ` | | @Decodetalkers diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6583bd3b9..86bd80d28 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1763,6 +1763,14 @@ return { maintainers = { '@stsewd', '@theHamsta' }, tier = 2, }, + qf = { + install_info = { + revision = 'v1.0.0', + url = 'https://github.com/OXY2DEV/tree-sitter-qf' + }, + maintainers = { '@OXY2DEV' }, + tier = 1 + }, ql = { install_info = { revision = '1fd627a4e8bff8c24c11987474bd33112bead857', diff --git a/runtime/queries/qf/highlights.scm b/runtime/queries/qf/highlights.scm new file mode 100644 index 000000000..17dee7b18 --- /dev/null +++ b/runtime/queries/qf/highlights.scm @@ -0,0 +1,26 @@ +"|" @punctuation.delimiter + +" col " @keyword + +[ + (row) + (col) +] @number + +(filename) @string.special.path + +((code_block) @markup.raw.block + (#set! priority 90)) + +(code_block + (language_delimiter) @markup.raw.block + (#set! conceal "")) + +((item_type) @comment.error + (#eq? @comment.error "error")) + +((item_type) @comment.warning + (#eq? @comment.warning "warning")) + +((item_type) @comment.note + (#eq? @comment.note "note")) diff --git a/runtime/queries/qf/injections.scm b/runtime/queries/qf/injections.scm new file mode 100644 index 000000000..9959f1b91 --- /dev/null +++ b/runtime/queries/qf/injections.scm @@ -0,0 +1,15 @@ +; Specified language. +; filename.lua | 10 col 5 | >!lua!< local value = 10; +(code_block + (language_delimiter) @injection.language + (content) @injection.content + (#offset! @injection.language 0 2 0 -2)) + +; Automatic language(slightly inaccurate). +; filename.lua | 10 col 5 | local value = 10; +(quickfix_item + (filename) @injection.filename + (range) + (code_block + . + (content) @injection.content .)) From 6ddc5768bb6a3f6eb8ce3d3129a71e5b7e68b8e6 Mon Sep 17 00:00:00 2001 From: Shawon Date: Mon, 26 May 2025 07:55:45 +0600 Subject: [PATCH 2/9] chore: Fixed stylua check issues --- lua/nvim-treesitter/parsers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 86bd80d28..65192b97e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1766,10 +1766,10 @@ return { qf = { install_info = { revision = 'v1.0.0', - url = 'https://github.com/OXY2DEV/tree-sitter-qf' + url = 'https://github.com/OXY2DEV/tree-sitter-qf', }, maintainers = { '@OXY2DEV' }, - tier = 1 + tier = 1, }, ql = { install_info = { From c67ca6929b2625c6e241a6e6462dc18a8c21960e Mon Sep 17 00:00:00 2001 From: Shawon Date: Mon, 26 May 2025 14:05:37 +0600 Subject: [PATCH 3/9] fix(parsers): Update qf - Updated parser version, + Removed extra whitespaces for `col` - Added note --- lua/nvim-treesitter/parsers.lua | 4 +++- runtime/queries/qf/highlights.scm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 65192b97e..4a5484501 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1765,11 +1765,13 @@ return { }, qf = { install_info = { - revision = 'v1.0.0', + revision = 'v1.1.0', url = 'https://github.com/OXY2DEV/tree-sitter-qf', }, maintainers = { '@OXY2DEV' }, tier = 1, + + readme_note = 'Vim quickfix', }, ql = { install_info = { diff --git a/runtime/queries/qf/highlights.scm b/runtime/queries/qf/highlights.scm index 17dee7b18..899614ae4 100644 --- a/runtime/queries/qf/highlights.scm +++ b/runtime/queries/qf/highlights.scm @@ -1,6 +1,6 @@ "|" @punctuation.delimiter -" col " @keyword +"col" @keyword [ (row) From 24b0d435823cd1822136b52d0dbf28680c4286f0 Mon Sep 17 00:00:00 2001 From: Shawon Date: Mon, 26 May 2025 14:08:04 +0600 Subject: [PATCH 4/9] chore: Updated note chore: Updated supported language list --- SUPPORTED_LANGUAGES.md | 3 ++- lua/nvim-treesitter/parsers.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index c411f6285..b0520c6b6 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -226,7 +226,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [purescript](https://github.com/postsolar/tree-sitter-purescript) | unstable | `H  JL` | | @postsolar [pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | unstable | `H  J ` | | @ObserverOfTime [python](https://github.com/tree-sitter/tree-sitter-python) | unstable | `HFIJL` | | @stsewd, @theHamsta -[qf](https://github.com/OXY2DEV/tree-sitter-qf) | stable | `H  J ` | | @OXY2DEV +[qf](https://github.com/OXY2DEV/tree-sitter-qf)[^qf] | stable | `H  J ` | | @OXY2DEV [ql](https://github.com/tree-sitter/tree-sitter-ql) | unstable | `HFIJL` | | @pwntester [qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | unstable | `H  J ` | | @amaanq [qmljs](https://github.com/yuja/tree-sitter-qmljs) | unstable | `HF J ` | | @Decodetalkers @@ -352,6 +352,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [^php_only]: PHP without embedded HTML [^poe_filter]: Path of Exile item filter [^properties]: Java properties files +[^qf]: Vim quickfix list [^query]: Tree-sitter query language [^sflog]: Salesforce debug log [^slang]: Shader Slang diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4a5484501..99d4e22c3 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1771,7 +1771,7 @@ return { maintainers = { '@OXY2DEV' }, tier = 1, - readme_note = 'Vim quickfix', + readme_note = 'Vim quickfix list', }, ql = { install_info = { From f75193b2a48feffbb4970ea004d9971777fbfbff Mon Sep 17 00:00:00 2001 From: Mouinul Hossain <122956967+OXY2DEV@users.noreply.github.com> Date: Mon, 26 May 2025 14:11:21 +0600 Subject: [PATCH 5/9] chore(parsers): Remove empty line from note Co-authored-by: Christian Clason --- lua/nvim-treesitter/parsers.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 99d4e22c3..e3f33d142 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1770,7 +1770,6 @@ return { }, maintainers = { '@OXY2DEV' }, tier = 1, - readme_note = 'Vim quickfix list', }, ql = { From 57657a350707c2eefb404c2a739ec1c21db58654 Mon Sep 17 00:00:00 2001 From: Shawon Date: Thu, 29 May 2025 08:28:14 +0600 Subject: [PATCH 6/9] fix(parsers): Update qf revision tag Adds child nodes for the `row` & `col`, - `value` when the value is a number. - `from` & `to` when the value is a range. --- lua/nvim-treesitter/parsers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index e3f33d142..a44aaff96 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1765,7 +1765,7 @@ return { }, qf = { install_info = { - revision = 'v1.1.0', + revision = 'v1.2.0', url = 'https://github.com/OXY2DEV/tree-sitter-qf', }, maintainers = { '@OXY2DEV' }, From 3ff8adb2bbc36e0376118b3993878fc0402f9b45 Mon Sep 17 00:00:00 2001 From: Shawon Date: Thu, 29 May 2025 08:29:48 +0600 Subject: [PATCH 7/9] fix(parsers): Updated qf query files - Adds highlighting for new node(s). - Removes non-standard injection rule. --- runtime/queries/qf/highlights.scm | 36 ++++++++++++++++++++----------- runtime/queries/qf/injections.scm | 7 ------ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/runtime/queries/qf/highlights.scm b/runtime/queries/qf/highlights.scm index 899614ae4..5f0b31e95 100644 --- a/runtime/queries/qf/highlights.scm +++ b/runtime/queries/qf/highlights.scm @@ -1,20 +1,25 @@ -"|" @punctuation.delimiter - -"col" @keyword - [ - (row) - (col) -] @number + "|" + "-" +] @punctuation.delimiter (filename) @string.special.path -((code_block) @markup.raw.block - (#set! priority 90)) +(row + [ + (value) + (from) + (to) + ] @number) -(code_block - (language_delimiter) @markup.raw.block - (#set! conceal "")) +"col" @keyword + +(col + [ + (value) + (from) + (to) + ] @number) ((item_type) @comment.error (#eq? @comment.error "error")) @@ -24,3 +29,10 @@ ((item_type) @comment.note (#eq? @comment.note "note")) + +((code_block) @markup.raw.block + (#set! priority 90)) + +(code_block + (language_delimiter) @markup.raw.block + (#set! conceal "")) diff --git a/runtime/queries/qf/injections.scm b/runtime/queries/qf/injections.scm index 9959f1b91..15e65f77a 100644 --- a/runtime/queries/qf/injections.scm +++ b/runtime/queries/qf/injections.scm @@ -1,10 +1,3 @@ -; Specified language. -; filename.lua | 10 col 5 | >!lua!< local value = 10; -(code_block - (language_delimiter) @injection.language - (content) @injection.content - (#offset! @injection.language 0 2 0 -2)) - ; Automatic language(slightly inaccurate). ; filename.lua | 10 col 5 | local value = 10; (quickfix_item From 5fa2088ff8a9cfb6dc0853898adc06d35fa63042 Mon Sep 17 00:00:00 2001 From: Shawon Date: Thu, 29 May 2025 14:19:51 +0600 Subject: [PATCH 8/9] refactor(parsers): change qf parser tier Reason, - Parser grammar may be subject to change. --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index b0520c6b6..e3683bfe5 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -226,7 +226,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [purescript](https://github.com/postsolar/tree-sitter-purescript) | unstable | `H  JL` | | @postsolar [pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | unstable | `H  J ` | | @ObserverOfTime [python](https://github.com/tree-sitter/tree-sitter-python) | unstable | `HFIJL` | | @stsewd, @theHamsta -[qf](https://github.com/OXY2DEV/tree-sitter-qf)[^qf] | stable | `H  J ` | | @OXY2DEV +[qf](https://github.com/OXY2DEV/tree-sitter-qf)[^qf] | unstable | `H  J ` | | @OXY2DEV [ql](https://github.com/tree-sitter/tree-sitter-ql) | unstable | `HFIJL` | | @pwntester [qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | unstable | `H  J ` | | @amaanq [qmljs](https://github.com/yuja/tree-sitter-qmljs) | unstable | `HF J ` | | @Decodetalkers diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index a44aaff96..d23c3a0ae 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1769,7 +1769,7 @@ return { url = 'https://github.com/OXY2DEV/tree-sitter-qf', }, maintainers = { '@OXY2DEV' }, - tier = 1, + tier = 2, readme_note = 'Vim quickfix list', }, ql = { From f88a9bafccf5afb8d645fcff60b9cf0d4e449a0b Mon Sep 17 00:00:00 2001 From: Shawon Date: Thu, 29 May 2025 14:37:05 +0600 Subject: [PATCH 9/9] refactor(parsers): Updated qf revision value --- lua/nvim-treesitter/parsers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index d23c3a0ae..55ed9c830 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1765,7 +1765,7 @@ return { }, qf = { install_info = { - revision = 'v1.2.0', + revision = '6a9d1deb934749720aa3bc525f1506f7d2ae4d0a', url = 'https://github.com/OXY2DEV/tree-sitter-qf', }, maintainers = { '@OXY2DEV' },