Skip to content

Commit 7ebe726

Browse files
committed
Fix typo and better error message
1 parent f037da6 commit 7ebe726

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

lua/java-helpers/stack-trace.lua

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -228,24 +228,26 @@ local function find_java_source_file_for_class(full_class_name, expected_file_na
228228

229229
if err or not result or vim.tbl_isempty(result) then
230230
error = "No workspace symbols were found by " .. client.name
231-
end
232-
233-
for _, symbol in ipairs(result) do
234-
if
235-
symbol.kind == 5
236-
and (symbol.name == full_class_name or symbol.containerName .. "." .. symbol.name == full_class_name)
237-
then
238-
local uri = symbol.location.uri or symbol.location.targetUri
239-
240-
if uri then
241-
local file_path = vim.uri_to_fname(uri)
242-
243-
return file_path, nil
231+
else
232+
for _, symbol in ipairs(result) do
233+
if
234+
symbol.kind == 5
235+
and (
236+
symbol.name == full_class_name or symbol.containerName .. "." .. symbol.name == full_class_name
237+
)
238+
then
239+
local uri = symbol.location.uri or symbol.location.targetUri
240+
241+
if uri then
242+
local file_path = vim.uri_to_fname(uri)
243+
244+
return file_path, nil
245+
else
246+
error = "Workspace symbol did not have a URI"
247+
end
244248
else
245-
error = "Workspace symbol did not have a UIR"
249+
error = "Workspace symbol matching class name " .. full_class_name .. " not found"
246250
end
247-
else
248-
error = "Workspace symbol matching class name " .. full_class_name .. " not found"
249251
end
250252
end
251253
end

0 commit comments

Comments
 (0)