From 8d05fcaaeb1442c709f148ff934d92900743f051 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Fri, 26 Apr 2024 00:50:04 +0300 Subject: feat: command to edit variants If there is no cmake-variants.yaml file in current directory, command creates it with default variants --- lua/cmake/fileapi.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lua/cmake/fileapi.lua') diff --git a/lua/cmake/fileapi.lua b/lua/cmake/fileapi.lua index 2f61677..47a7459 100644 --- a/lua/cmake/fileapi.lua +++ b/lua/cmake/fileapi.lua @@ -47,6 +47,8 @@ function FileApi.read_reply(path, callback) if object.kind == "codemodel" then utils.read_file(Path:new(reply_dir, object.jsonFile):absolute(), function(codemodel_data) local codemodel = vim.json.decode(codemodel_data) + --FIX: this loop does not read all files if codemodel contains many targets. This is because libuv (or some external settings) forbids to open files + -- in async mode more than some limit number. Seems like the solution is to queue these calls and limit max number for opened files per time for _, target in ipairs(codemodel.configurations[1].targets) do utils.read_file( Path:new(reply_dir, target.jsonFile):absolute(), -- cgit v1.2.3