diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-28 18:43:05 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-28 18:43:05 +0000 |
commit | 132423e5a1f2d883a2d3bc420a3edd7036b4b0dd (patch) | |
tree | 9c5b06a1b15b99ebb962c7f1fe681dd7f7a48294 /.config/nvim/lua/lsp.lua | |
parent | 2a53d13112422812fe30d54aac360b2d9dd29f22 (diff) | |
download | dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.tar dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.tar.gz dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.tar.bz2 dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.tar.lz dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.tar.xz dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.tar.zst dotfiles-132423e5a1f2d883a2d3bc420a3edd7036b4b0dd.zip |
Cooler deno plugin and terminal shortcut for neovim
Diffstat (limited to '.config/nvim/lua/lsp.lua')
-rw-r--r-- | .config/nvim/lua/lsp.lua | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 82bed0c..11059ff 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -45,15 +45,15 @@ cmp.setup.cmdline(":", { }) -- Setup lspconfig. -local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp - .protocol - .make_client_capabilities()) +local cmplsp = require("cmp_nvim_lsp") +local capabilities = vim.lsp.protocol.make_client_capabilities() +cmplsp.update_capabilities(vim.lsp.protocol.make_client_capabilities()) +-- Enable (broadcasting) snippet capability for completion +capabilities.textDocument.completion.completionItem.snippetSupport = true -require("lspconfig")["denols"].setup { capabilities = capabilities } -local lspkind = require("lspkind") -cmp.setup { +cmp.setup({ formatting = { - format = lspkind.cmp_format({ + format = require("lspkind").cmp_format({ mode = "symbol"; -- show only symbol annotations maxwidth = 50; -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) @@ -62,32 +62,33 @@ cmp.setup { before = function(entry, vim_item) return vim_item end; }); }; -} +}) + local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") - require("lsp-inlayhints").setup() - require("lsp-inlayhints").on_attach(client, bufnr) + local inlayhints = require("lsp-inlayhints") + inlayhints.setup() + inlayhints.on_attach(client, bufnr) end --- Enable (broadcasting) snippet capability for completion -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true local lsputils = require("lspconfig").util require("lspconfig").tsserver.setup({ on_attach = on_attach; - root_dir = lsputils.root_pattern("package.json", "tsconfig.json", - "jsconfig.json"); + root_dir = lsputils.root_pattern("package.json", "tsconfig.json"); }) -require("lspconfig").denols.setup { - on_attach = on_attach; - init_options = { enable = true; unstable = true; config = "./deno.jsonc" }; - root_dir = vim.loop.cwd; -} +require("deno-nvim").setup({ + server = { + root_dir = vim.loop.cwd; + capabilities = capabilities; + on_attach = on_attach; + settings = { enable = true; unstable = true; config = "./deno.jsonc" }; + }; +}); require("lspconfig").rust_analyzer.setup({ - root_dir = vim.loop.cwd; + capabilities = capabilities; on_attach = on_attach; }) @@ -96,12 +97,14 @@ require("lspconfig").sqls.setup({ require("sqls").on_attach(client, bufnr) on_attach(client, bufnr) end; + capabilities = capabilities; }) --- neovim-bin -require"lspconfig".omnisharp.setup { + +require("lspconfig").omnisharp.setup({ cmd = { "omnisharp" }; on_attach = on_attach; + capabilities = capabilities; -- Enables support for reading code style, naming convention and analyzer -- settings from .editorconfig. enable_editorconfig_support = true; @@ -115,11 +118,11 @@ require"lspconfig".omnisharp.setup { enable_ms_build_load_projects_on_demand = false; -- Enables support for roslyn analyzers, code fixes and rulesets. - enable_roslyn_analyzers = false; + enable_roslyn_analyzers = true; -- Specifies whether 'using' directives should be grouped and sorted during -- document formatting. - organize_imports_on_format = false; + organize_imports_on_format = true; -- Enables support for showing unimported types and unimported extension -- methods in completion lists. When committed, the appropriate using @@ -127,7 +130,7 @@ require"lspconfig".omnisharp.setup { -- have a negative impact on initial completion responsiveness, -- particularly for the first few completion sessions after opening a -- solution. - enable_import_completion = false; + enable_import_completion = true; -- Specifies whether to include preview versions of the .NET SDK when -- determining which version to use for project loading. @@ -136,11 +139,12 @@ require"lspconfig".omnisharp.setup { -- Only run analyzers against open files when 'enableRoslynAnalyzers' is -- true analyze_open_documents_only = false; -} +}) require("lspconfig").marksman.setup({ root_dir = vim.loop.cwd; on_attach = on_attach; + capabilities = capabilities; }) require("lspconfig").jsonls.setup({ |