diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-17 20:40:08 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-17 20:40:08 +0000 |
commit | e9dad4bb8cbe18416a30cc8cfb75e02246ecab71 (patch) | |
tree | 64f467c6ca485ee879f7200c657f7e1b6e09b0f4 /.config/nvim/lua/lsp.lua | |
parent | c1fe9176c0c9609c7d76d1c014e48f58dcb65b38 (diff) | |
download | dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.tar dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.tar.gz dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.tar.bz2 dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.tar.lz dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.tar.xz dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.tar.zst dotfiles-e9dad4bb8cbe18416a30cc8cfb75e02246ecab71.zip |
Add more lsp configs and keybinds
Diffstat (limited to '.config/nvim/lua/lsp.lua')
-rw-r--r-- | .config/nvim/lua/lsp.lua | 88 |
1 files changed, 83 insertions, 5 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 8f728f0..85da5ff 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -46,8 +46,8 @@ cmp.setup.cmdline(":", { -- Setup lspconfig. local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp - .protocol - .make_client_capabilities()) + .protocol + .make_client_capabilities()) require("lspconfig")["denols"].setup { capabilities = capabilities } local lspkind = require("lspkind") @@ -66,14 +66,92 @@ cmp.setup { local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") end +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true -require("lspconfig")["tsserver"].setup { on_attach = on_attach } -require("lspconfig")["denols"].setup { +local lsputils = require("lspconfig").util + +require("lspconfig").tsserver.setup({ + on_attach = on_attach, + root_dir = lsputils.root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") +}) + +require("lspconfig").denols.setup { on_attach = on_attach; - init_options = { enable = true; unstable = true; config = "./deno.jsonc" }; + init_options = { + enable = true; + unstable = true; + config = "./deno.jsonc"; + }; root_dir = vim.loop.cwd; } +require('lspconfig').rust_analyzer.setup({}) + +require('lspconfig').sqls.setup({ + on_attach = function(client, bufnr) + require('sqls').on_attach(client, bufnr) + end +}) + +require'lspconfig'.omnisharp.setup { + cmd = { "omnisharp" }, + + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} + +require('lspconfig').marksman.setup({ + root_dir = vim.loop.cwd; +}) + +require('lspconfig').jsonls.setup({ + capabilities = capabilities, + cmd = { "vscode-json-languageserver", "--stdio" } +}) + +require('lspconfig').html.setup({ + capabilities = capabilities, + cmd = { "vscode-html-languageserver", "--stdio" } +}) + +require('lspconfig').cssls.setup({ + capabilities = capabilities, +}) + vim.diagnostic.config({ virtual_text = true; signs = true; |