diff --git a/nvim/.config/nvim/lua/lsp-utils.lua b/nvim/.config/nvim/lua/lsp-utils.lua index c17b7e8..7070687 100644 --- a/nvim/.config/nvim/lua/lsp-utils.lua +++ b/nvim/.config/nvim/lua/lsp-utils.lua @@ -96,11 +96,15 @@ function M.clangd_config() local root_files = { '.clangd', '.clang-tidy', '.clang-format', 'compile_commands.json', 'compile_flags.txt' } local clangd_cmd = { "clangd", "--background-index", "--pch-storage=memory", "--clang-tidy", "--header-insertion=never" } local root_directory = get_root_directory(root_files) + local clangd_caps = { + textDocument = { completion = { editsNearCursor = true } }, + offsetEncoding = { 'utf-8', 'utf-16' }, + } return { name = "clangd", cmd = clangd_cmd, - capabilities = default_capabilities, + capabilities = clangd_caps, root_dir = root_directory, filetypes = { 'c', 'cpp' }, single_file_support = true, @@ -118,9 +122,19 @@ function M.deno_config() capabilities = default_capabilities, filetypes = file_types, root_dir = root_directory, - init_options = { - enable = true, - unstable = false, + settings = { + deno = { + enable = true, + suggest = { + imports = { + hosts = { + ['https://deno.land'] = true, + ['https://crux.land'] = true, + ['https://x.nest.land'] = true, + }, + }, + }, + }, }, handlers = { ['textDocument/definition'] = denols_handler, @@ -201,11 +215,16 @@ end function M.ra_config() local root_files = { "Cargo.toml" } local root_directory = get_root_directory(root_files) + local ra_caps = vim.lsp.protocol.make_client_capabilities() + + ra_caps.experimental = { + serverStatusNotification = true, + } return { name = "rust-analyzer", cmd = { "rust-analyzer" }, - capabilities = default_capabilities, + capabilities = ra_caps, root_dir = root_directory, settings = { ["rust-analyzer"] = { @@ -242,6 +261,10 @@ function M.tsserver_config() return { name = "tsserver", cmd = { "typescript-language-server", "--stdio" }, + -- Support Yarn PnP + -- hostInfo with init_options is required to allow yarn pnp sdk to + -- identify editor and patch paths appropriately. + init_options = { hostInfo = 'neovim' }, capabilities = default_capabilities, root_dir = root_directory, filetypes = file_types,