Skip to content

Commit ea837cc

Browse files
committed
Refactor: Remove Debug logs
1 parent 8d06f2d commit ea837cc

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

lua/cmake-tools/scanner.lua

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ local function toolchain_candidates(prefix)
1414
return {}
1515
end
1616

17-
-- strip trailing dash for the filename
1817
local triplet = prefix:gsub("%-$", "")
1918

2019
return {
@@ -47,7 +46,6 @@ local function match_c_compiler(exe)
4746
if prefix then
4847
return prefix, c_name
4948
end
50-
-- Without prefix: "gcc"
5149
if exe == c_name then
5250
return "", c_name
5351
end
@@ -68,7 +66,6 @@ local function derive_toolchain(prefix, c_name)
6866
c = (prefix or "") .. c_name,
6967
cxx = (prefix or "") .. companions.cxx,
7068
linker = (prefix or "") .. companions.linker,
71-
-- preserve prefix so we can use it in the kit name
7269
prefix = prefix or "",
7370
}
7471
end
@@ -77,11 +74,11 @@ local function get_path_executables()
7774
local path_dirs = vim.split(vim.env.PATH or "", ":", { plain = true })
7875
local executables = {}
7976
for _, dir in ipairs(path_dirs) do
80-
local entries = vim.fn.readdir(dir) -- returns {} on error / missing dir
77+
local entries = vim.fn.readdir(dir)
8178
for _, entry in ipairs(entries) do
8279
local full = dir .. "/" .. entry
8380
if vim.fn.executable(full) == 1 then
84-
executables[entry] = true -- deduplicate by name
81+
executables[entry] = true
8582
end
8683
end
8784
end
@@ -104,7 +101,6 @@ local function discover_toolchains(executables)
104101
end
105102
end
106103
end
107-
vim.notify("Discovered toolchains: " .. vim.inspect(chains))
108104
return chains
109105
end
110106

@@ -156,14 +152,10 @@ function scanner.scan_for_kits()
156152

157153
if has_cxx then
158154
kit.compilers.CXX = get_executable_path(tc.cxx)
159-
else
160-
vim.notify("No C++ compiler found for: " .. tc.c)
161155
end
162156

163157
if check_executable_exists(tc.linker) then
164158
kit.linker = get_executable_path(tc.linker)
165-
else
166-
vim.notify("No linker found for: " .. tc.c)
167159
end
168160
local toolchain_file = find_toolchain_file(tc.prefix)
169161
if toolchain_file then
@@ -174,10 +166,7 @@ function scanner.scan_for_kits()
174166
vim.notify("No toolchain file found for prefix: " .. tc.prefix, vim.log.levels.WARN)
175167
end
176168
end
177-
178169
table.insert(kits, kit)
179-
else
180-
vim.notify("Skipping toolchain – C compiler not found: " .. tc.c)
181170
end
182171
end
183172
local json_kits = vim.fn.json_encode(kits)

0 commit comments

Comments
 (0)