From 901d35682f2a75bfd6c748319d9da258b4dc82a0 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 1 Jul 2024 00:21:08 +0200 Subject: [PATCH 1/3] fix(queries): use absolute path --- src/luarocks/build/treesitter-parser.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/luarocks/build/treesitter-parser.lua b/src/luarocks/build/treesitter-parser.lua index 7d91a6f..da08e0a 100644 --- a/src/luarocks/build/treesitter-parser.lua +++ b/src/luarocks/build/treesitter-parser.lua @@ -114,7 +114,7 @@ function treesitter_parser.run(rockspec, no_install) local queries_dir = dir.path("queries", build.lang) fs.make_dir(queries_dir) for name, content in pairs(build.queries) do - local queries_file = dir.path(queries_dir, name) + local queries_file = fs.absolute_name(dir.path(queries_dir, name)) local fd = io.open(queries_file, "w+") if not fd then return nil, "Could not open " .. queries_file .. " for writing" From 17c65f3f01c9851d82d9f8c6254971c2adceede4 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 1 Jul 2024 00:21:22 +0200 Subject: [PATCH 2/3] fix(queries): better error messages --- src/luarocks/build/treesitter-parser.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/luarocks/build/treesitter-parser.lua b/src/luarocks/build/treesitter-parser.lua index da08e0a..52a4375 100644 --- a/src/luarocks/build/treesitter-parser.lua +++ b/src/luarocks/build/treesitter-parser.lua @@ -111,8 +111,14 @@ function treesitter_parser.run(rockspec, no_install) pcall(fs.delete, "queries") end fs.make_dir("queries") + if not fs.exists("queries") then + return nil, "Could not create directory: queries" + end local queries_dir = dir.path("queries", build.lang) fs.make_dir(queries_dir) + if not fs.exists(queries_dir) then + return nil, "Could not create directory: " .. queries_dir + end for name, content in pairs(build.queries) do local queries_file = fs.absolute_name(dir.path(queries_dir, name)) local fd = io.open(queries_file, "w+") From 19d0309387c83f0a3bf726f41906ba2f4c9d8422 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 1 Jul 2024 00:21:40 +0200 Subject: [PATCH 3/3] build: update typecheck config --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index f7d7750..d4153e5 100644 --- a/flake.nix +++ b/flake.nix @@ -46,10 +46,10 @@ type-check = pre-commit-hooks.lib.${system}.run { src = self; hooks = { - lua-ls.enable = true; - }; - settings = { - lua-ls.config = luarc; + lua-ls = { + enable = true; + settings.configuration = luarc; + }; }; };