|
|
@ -88,6 +88,7 @@ return { |
|
|
|
|
|
|
|
-- override default floating window border if not set |
|
|
|
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview |
|
|
|
---@diagnostic disable-next-line: duplicate-set-field |
|
|
|
function vim.lsp.util.open_floating_preview(contents, syntax, options, ...) |
|
|
|
options = options or {} |
|
|
|
options.border = options.border or "rounded" |
|
|
@ -112,6 +113,9 @@ return { |
|
|
|
-- Function to detect the operating system |
|
|
|
local function get_os() |
|
|
|
local handle = io.popen('uname') |
|
|
|
if not handle then |
|
|
|
return error("Failed to detect operating system") |
|
|
|
end |
|
|
|
local result = handle:read("*a") |
|
|
|
handle:close() |
|
|
|
return result:lower():gsub("%s+", "") |
|
|
@ -165,7 +169,11 @@ return { |
|
|
|
lspconfig.volar.setup({ |
|
|
|
-- capabilities = capabilities, |
|
|
|
on_attach = on_attach, |
|
|
|
filetypes = { "vue" }, |
|
|
|
filetypes = { |
|
|
|
"javascript", |
|
|
|
"typescript", |
|
|
|
"vue", |
|
|
|
}, |
|
|
|
on_new_config = function(new_config, new_root_dir) |
|
|
|
new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) |
|
|
|
end, |
|
|
@ -180,11 +188,12 @@ return { |
|
|
|
-- configure php server |
|
|
|
lspconfig["intelephense"].setup({ |
|
|
|
root_dir = function(pattern) |
|
|
|
local cwd = vim.loop.cwd() |
|
|
|
local root = util.root_pattern('composer.json')(pattern) |
|
|
|
---@diagnostic disable-next-line: undefined-field |
|
|
|
local cwd = vim.loop.cwd() |
|
|
|
local root = util.root_pattern('composer.json')(pattern) |
|
|
|
|
|
|
|
-- prefer cwd if root is a descendant |
|
|
|
return util.path.is_descendant(cwd, root) and cwd or root |
|
|
|
-- prefer cwd if root is a descendant |
|
|
|
return util.path.is_descendant(cwd, root) and cwd or root |
|
|
|
end, |
|
|
|
capabilities = capabilities, |
|
|
|
on_attach = on_attach, |
|
|
|