aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 3d2bef9..8986139 100644
--- a/init.lua
+++ b/init.lua
@@ -937,11 +937,12 @@ local lspc_goto_location_methods = {
}
local function lspc_show_diagnostic(ls, win, line)
- local open_file = ls.open_files[win.file.path]
- if not open_file then
- return win.file.path .. ' not open in ' .. ls.name
+ if not ls.open_files[win.file.path] then
+ lspc_open(ls, win, win.file)
end
+ local open_file = ls.open_files[win.file.path]
+
local diagnostics = open_file.diagnostics
if not diagnostics then
return win.file.path .. ' has no diagnostics available'