-
-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Looking at this:
rustaceanvim/lua/rustaceanvim/lsp/init.lua
Lines 43 to 48 in 10efd4d
| local function find_vscode_settings(bufname) | |
| local settings = {} | |
| local found_dirs = vim.fs.find({ '.vscode' }, { upward = true, path = vim.fs.dirname(bufname), type = 'directory' }) | |
| if vim.tbl_isempty(found_dirs) then | |
| return settings | |
| end |
If I run this:
vim.fs.find({ '.vscode' }, { upward = true, path = vim.fs.dirname(bufname), type = 'directory' })It returns an empty table. Which then returns an empty table here:
rustaceanvim/lua/rustaceanvim/lsp/init.lua
Lines 46 to 48 in 10efd4d
| if vim.tbl_isempty(found_dirs) then | |
| return settings | |
| end |
That is used here:
rustaceanvim/lua/rustaceanvim/lsp/init.lua
Lines 69 to 72 in 10efd4d
| if config.server.load_vscode_settings then | |
| local json_settings = find_vscode_settings(bufname) | |
| require('rustaceanvim.config.json').override_with_rust_analyzer_json_keys(evaluated_settings, json_settings) | |
| end |
Which triggers this:
rustaceanvim/lua/rustaceanvim/config/json.lua
Lines 75 to 79 in 10efd4d
| function M.override_with_rust_analyzer_json_keys(tbl, json_tbl) | |
| M.override_with_json_keys(tbl, json_tbl, function(key) | |
| return vim.startswith(key, 'rust-analyzer') | |
| end) | |
| end |
Which triggers this:
rustaceanvim/lua/rustaceanvim/config/json.lua
Lines 64 to 71 in 10efd4d
| function M.override_with_json_keys(tbl, json_tbl, key_predicate) | |
| is_json_config_loaded = true | |
| for json_key, value in pairs(json_tbl) do | |
| if not key_predicate or key_predicate(json_key) then | |
| override_tbl_values(tbl, json_key, value) | |
| end | |
| end | |
| end |
Which then sets is_json_config_loaded = true, even though it was an empty table because there was no JSON.
That then triggers the "loaded vscode json" message in the healthcheck. So I don't believe that's relevant in this case, unless the fact that it things an (empty) vscode file was loaded makes it not inject the check config, but I haven't checked if that's the case.
Originally posted by @JeanMertz in #652 (reply in thread)