mirror of
https://github.com/mfussenegger/nvim-jdtls
synced 2024-09-16 14:34:13 +02:00
Only attach to file or jdt:// buffers
Attaching to buffers like fugitive:// can result in errors
This commit is contained in:
parent
10691312d5
commit
ad5ab1c924
1 changed files with 6 additions and 0 deletions
|
@ -293,6 +293,12 @@ function M.start_or_attach(config, opts, start_opts)
|
|||
end
|
||||
end
|
||||
|
||||
local uri = vim.uri_from_bufnr(bufnr)
|
||||
-- jdtls requires files to exist on the filesystem; it doesn't play well with scratch buffers
|
||||
if not vim.startswith(uri, "file://") or vim.bo[bufnr].buftype ~= "" then
|
||||
return
|
||||
end
|
||||
|
||||
config.root_dir = (config.root_dir
|
||||
or M.find_root({'.git', 'gradlew', 'mvnw'}, bufname)
|
||||
or vim.fn.getcwd()
|
||||
|
|
Loading…
Reference in a new issue