diff --git a/lazy-lock.json b/lazy-lock.json index 124f7b8..2caa063 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -19,7 +19,6 @@ "deepwhite.nvim": { "branch": "main", "commit": "f1db7888f0a7cf84d6d802c17c074bccca0a72a5" }, "diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" }, "dressing.nvim": { "branch": "master", "commit": "3c38ac861e1b8d4077ff46a779cde17330b29f3a" }, - "dropbar.nvim": { "branch": "master", "commit": "2b546383bdf4daa254ac70c760ee1e5524bc60b1" }, "easypick.nvim": { "branch": "main", "commit": "3ce209d05d402ba40e29e6b69b759eb8421b145a" }, "friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" }, "fzf-lua": { "branch": "main", "commit": "b92220ec838c195eb1c711daa69c905b1d7b8d8c" }, @@ -30,7 +29,7 @@ "hoversplit.nvim": { "branch": "main", "commit": "c7c6b5596fed3287a3b20dbe772c8211a99cebc7" }, "kanagawa.nvim": { "branch": "master", "commit": "08ed29989834f5f2606cb1ef9d5b24c5ea7b8fa5" }, "lackluster.nvim": { "branch": "main", "commit": "ab84a74196d76b8172ba299071f8f5de6aed2a63" }, - "lazy.nvim": { "branch": "main", "commit": "eab487c2520f0fe9e54eb5e3ea0606e20512492e" }, + "lazy.nvim": { "branch": "main", "commit": "b0ba3f9399bf48c86abaa4db1a40bd0b681d5018" }, "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, diff --git a/lua/lsp-setup.lua b/lua/lsp-setup.lua index 63760cc..f214001 100644 --- a/lua/lsp-setup.lua +++ b/lua/lsp-setup.lua @@ -1,12 +1,14 @@ -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(_client, bufnr) +local on_attach = function(client, bufnr) -- NOTE: Remember that lua is a real programming language, and as such it is possible -- to define small helper and utility functions so you don't have to repeat yourself -- many times. -- -- In this case, we create a function that lets us more easily define mappings specific -- for LSP related items. It sets the mode, buffer and description for us each time. + -- Copy content of client to clipboard + local nmap = function(keys, func, desc) if desc then desc = "LSP: " .. desc @@ -18,20 +20,14 @@ local on_attach = function(_client, bufnr) nmap("rn", vim.lsp.buf.rename, "[R]e[n]ame") nmap("a", vim.lsp.buf.code_action, "[C]ode [A]ction") - nmap( - "gd", - require("telescope.builtin").lsp_definitions, - "[G]oto [D]efinition" - ) nmap("gp", function() vim.cmd "vsplit" - require("telescope.builtin").lsp_definitions() + vim.lsp.buf.definition() end, "[G]oto Definition [S]plit") - nmap( - "gd", - require("telescope.builtin").lsp_definitions, - "[G]oto [D]efinition" - ) + + nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") + + nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") nmap( "gr", require("telescope.builtin").lsp_references, @@ -83,7 +79,7 @@ local on_attach = function(_client, bufnr) print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, "[W]orkspace [L]ist Folders") - _client.server_capabilities.documentFormattingProvider = true + client.server_capabilities.documentFormattingProvider = true -- Create a command `:Format` local to the LSP buffer vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_) @@ -121,6 +117,24 @@ local servers = { eslint = { filetypes = { "javascript", "typescript", "typescriptreact" } }, html = { filetypes = { "html", "twig", "hbs" } }, denols = { + settings = { + deno = { + enable = true, + -- unstable = true, + lint = true, + codeLens = { + implementations = true, + references = true, + }, + suggest = { + imports = { + hosts = { + ["https://deno.land"] = true, + }, + }, + }, + }, + }, root_dir = require("lspconfig").util.root_pattern( "deno.json", "deno.jsonc"