Skip to content

Commit 5644bd1

Browse files
authored
fix: use fallback to cwd when root markers are missing (#62)
1 parent 96b3767 commit 5644bd1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lua/java-core/ls/servers/jdtls/init.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ function M.get_root_finder(root_markers)
104104
if root then
105105
log.debug('root of ' .. file_name .. ' is ' .. root)
106106
return root
107+
else
108+
local fallback_dir = vim.fn.getcwd()
109+
log.debug(
110+
"couldn't find root of "
111+
.. file_name
112+
.. ' using fallback dir '
113+
.. fallback_dir
114+
)
115+
return fallback_dir
107116
end
108117
end
109118
end

0 commit comments

Comments
 (0)