diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-18 11:10:02 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-18 11:10:02 +0000 |
commit | 7fe37e1e6554d0818219585e7c7391a28a81225c (patch) | |
tree | 17388cfb34375e2197efaa63435a95e030c91577 /.config/nvim/lua/lsp.lua | |
parent | 81edb50ba26538841c86a0d7e66f458bbbae1a0a (diff) | |
download | dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.tar dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.tar.gz dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.tar.bz2 dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.tar.lz dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.tar.xz dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.tar.zst dotfiles-7fe37e1e6554d0818219585e7c7391a28a81225c.zip |
Neovim config updates
Diffstat (limited to '.config/nvim/lua/lsp.lua')
-rw-r--r-- | .config/nvim/lua/lsp.lua | 90 |
1 files changed, 49 insertions, 41 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 49a6534..82bed0c 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") @@ -65,95 +65,103 @@ cmp.setup { } 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) end ---Enable (broadcasting) snippet capability for completion +-- 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") +require("lspconfig").tsserver.setup({ + on_attach = on_attach; + root_dir = lsputils.root_pattern("package.json", "tsconfig.json", + "jsconfig.json"); }) 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").rust_analyzer.setup({ + root_dir = vim.loop.cwd; + on_attach = on_attach; +}) -require('lspconfig').sqls.setup({ +require("lspconfig").sqls.setup({ on_attach = function(client, bufnr) - require('sqls').on_attach(client, bufnr) - end + require("sqls").on_attach(client, bufnr) + on_attach(client, bufnr) + end; }) +-- neovim-bin +require"lspconfig".omnisharp.setup { + cmd = { "omnisharp" }; -require'lspconfig'.omnisharp.setup { - cmd = { "omnisharp" }, - + on_attach = on_attach; -- Enables support for reading code style, naming convention and analyzer -- settings from .editorconfig. - enable_editorconfig_support = true, - + 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, - + enable_ms_build_load_projects_on_demand = false; + -- Enables support for roslyn analyzers, code fixes and rulesets. - enable_roslyn_analyzers = false, - + enable_roslyn_analyzers = false; + -- Specifies whether 'using' directives should be grouped and sorted during -- document formatting. - organize_imports_on_format = false, - + 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, - + 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, - + sdk_include_prereleases = true; + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is -- true - analyze_open_documents_only = false, + analyze_open_documents_only = false; } -require('lspconfig').marksman.setup({ +require("lspconfig").marksman.setup({ root_dir = vim.loop.cwd; + on_attach = on_attach; }) -require('lspconfig').jsonls.setup({ - capabilities = capabilities, - cmd = { "vscode-json-languageserver", "--stdio" } +require("lspconfig").jsonls.setup({ + capabilities = capabilities; + cmd = { "vscode-json-languageserver"; "--stdio" }; + on_attach = on_attach; }) -require('lspconfig').html.setup({ - capabilities = capabilities, - cmd = { "vscode-html-languageserver", "--stdio" } +require("lspconfig").html.setup({ + capabilities = capabilities; + cmd = { "vscode-html-languageserver"; "--stdio" }; + on_attach = on_attach; }) -require('lspconfig').cssls.setup({ - capabilities = capabilities, +require("lspconfig").cssls.setup({ + capabilities = capabilities; + on_attach = on_attach; }) vim.diagnostic.config({ - virtual_text = true; + virtual_text = false; signs = true; underline = true; update_in_insert = false; |