mirror of
https://github.com/mfussenegger/nvim-jdtls
synced 2024-09-16 14:34:13 +02:00
Support jump to jdt:// from pom or gradle (#499)
This commit is contained in:
parent
365811ecf9
commit
8597d57fb4
1 changed files with 8 additions and 1 deletions
|
@ -61,11 +61,18 @@ end
|
|||
|
||||
M.restart = lsp_clients.restart
|
||||
|
||||
local function may_jdtls_buf(bufnr)
|
||||
if vim.bo[bufnr].filetype == "java" then
|
||||
return true
|
||||
end
|
||||
local fname = api.nvim_buf_get_name(bufnr)
|
||||
return vim.endswith(fname, "build.gradle") or vim.endswith(fname, "pom.xml")
|
||||
end
|
||||
|
||||
local function attach_to_active_buf(bufnr, client_name)
|
||||
|
||||
local function try_attach(buf)
|
||||
if vim.bo[buf].filetype ~= "java" then
|
||||
if not may_jdtls_buf(buf) then
|
||||
return false
|
||||
end
|
||||
local clients = vim.lsp.get_active_clients({ bufnr = buf, name = client_name })
|
||||
|
|
Loading…
Reference in a new issue