diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2024-06-02 18:14:13 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2024-06-02 18:14:17 -0700 |
commit | 7159a23d19fb982269dae2e8147ebbe34965095b (patch) | |
tree | 732a0a8893a9ba57f2af74724e3ba1848f75060b /lua/conform/formatters | |
parent | 584adfe7c665827601f4245c0c40273e8bc9e7cb (diff) |
fix(format-queries): update query formatter for breaking changes in nvim-treesitter
Diffstat (limited to 'lua/conform/formatters')
-rw-r--r-- | lua/conform/formatters/format-queries.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lua/conform/formatters/format-queries.lua b/lua/conform/formatters/format-queries.lua index 6f7da25..42b4efa 100644 --- a/lua/conform/formatters/format-queries.lua +++ b/lua/conform/formatters/format-queries.lua @@ -15,7 +15,12 @@ return { end, command = "nvim", args = function() - return { "-l", get_format_script(), "$FILENAME" } + local script = get_format_script() + assert(script) + -- Manually set the runtimepath to put nvim-treesitter first. The format-queries script relies + -- on the nvim-treesitter parser; the one bundled with Neovim may be outdated. + local rtp = vim.fn.fnamemodify(script, ":h:h") + return { "-c", "set rtp^=" .. rtp, "-l", script, "$FILENAME" } end, stdin = false, } |