This commit is contained in:
@ -76,7 +76,7 @@ return {
|
||||
return {
|
||||
-- How to find the root dir for a given filename. The default comes from
|
||||
-- lspconfig which provides a function specifically for java projects.
|
||||
root_dir = require("lspconfig.configs.jdtls").default_config.root_dir,
|
||||
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
|
||||
|
||||
-- How to find the project name for a given root dir.
|
||||
project_name = function(root_dir)
|
||||
|
@ -28,7 +28,7 @@ return {
|
||||
},
|
||||
setup = {
|
||||
tailwindcss = function(_, opts)
|
||||
local tw = require("lspconfig.configs.tailwindcss")
|
||||
local tw = LazyVim.lsp.get_raw_config("tailwindcss")
|
||||
opts.filetypes = opts.filetypes or {}
|
||||
|
||||
-- Add default filetypes
|
||||
|
@ -181,6 +181,15 @@ function M.get_config(server)
|
||||
return rawget(configs, server)
|
||||
end
|
||||
|
||||
---@return {default_config:lspconfig.Config}
|
||||
function M.get_raw_config(server)
|
||||
local ok, ret = pcall(require, "lspconfig.configs." .. server)
|
||||
if ok then
|
||||
return ret
|
||||
end
|
||||
return require("lspconfig.server_configurations." .. server)
|
||||
end
|
||||
|
||||
function M.is_enabled(server)
|
||||
local c = M.get_config(server)
|
||||
return c and c.enabled ~= false
|
||||
|
Reference in New Issue
Block a user