diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 2c456b10..97014198 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -182,9 +182,6 @@ return { { "iamcco/markdown-preview.nvim", -- {{{ ft = { "markdown" }, - enabled = function() - return vim.fn.executable "deno" == 0 and vim.fn.executable "npm" == 1 - end, build = function() vim.fn["mkdp#util#install"]() end, @@ -201,31 +198,6 @@ return { -- }}} }, - { - "toppair/peek.nvim", -- {{{ - build = "deno task --quiet build:fast", - enabled = function() - return vim.fn.executable "deno" == 1 - end, - ft = { "markdown" }, - keys = { - { - "mp", - function() - local peek = require "peek" - if peek.is_open() then - peek.close() - else - peek.open() - end - end, - desc = "Peek (Markdown Preview)", - }, - }, - opts = { theme = "light" }, - -- }}} - }, - { "saecki/crates.nvim", -- {{{ event = { "BufReadPre Cargo.toml" }, diff --git a/lua/plugins/lsp/handlers.lua b/lua/plugins/lsp/handlers.lua index 3b78711a..b8aea5d0 100644 --- a/lua/plugins/lsp/handlers.lua +++ b/lua/plugins/lsp/handlers.lua @@ -23,8 +23,7 @@ vim.diagnostic.config { -- {{{ }, } -- }}} --- {{{ -local signs = { +local signs = { -- {{{ Error = " ", Warn = " ", Info = " ", diff --git a/lua/plugins/lsp/servers.lua b/lua/plugins/lsp/servers.lua index 94f4a025..f27272ce 100644 --- a/lua/plugins/lsp/servers.lua +++ b/lua/plugins/lsp/servers.lua @@ -70,6 +70,18 @@ lspconfig.clangd.setup(c.default { -- }}} -- {{{ gopls +local get_current_gomod = function() + local file = io.open("go.mod", "r") + if file == nil then + return nil + end + + local first_line = file:read() + local mod_name = first_line:gsub("module ", "") + file:close() + return mod_name +end + lspconfig.gopls.setup(c.default { -- share the gopls instance if there is one already cmd = { "gopls", "-remote.debug=:0" }, @@ -141,15 +153,15 @@ lspconfig.gopls.setup(c.default { "-**/node_modules", "-/tmp", }, - usePlaceholders = true, - verboseOutput = false, -- useful for debugging when true. + ["local"] = get_current_gomod(), semanticTokens = true, + usePlaceholders = true, completeUnimported = true, completionDocumentation = true, staticcheck = true, gofumpt = true, linksInHover = true, - buildFlags = { "-tags=integration,e2e" }, + buildFlags = { "-tags", "integration" }, }, }, })