From 7159a23d19fb982269dae2e8147ebbe34965095b Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sun, 2 Jun 2024 18:14:13 -0700 Subject: fix(format-queries): update query formatter for breaking changes in nvim-treesitter --- lua/conform/formatters/format-queries.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lua') 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, } -- cgit v1.2.3-70-g09d2