Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a lead on how to render code lenses inline, for gopls, in Neovim. A full example for Neovim v0.11.0: ```lua local config = { cmd = { "gopls" }, filetypes = { "go", "gomod", "gowork", "gosum" }, root_markers = { "go.work", "go.mod", ".git" }, on_attach = function(client, bufnr) if client.supports_method("textDocument/codeLens") then vim.lsp.codelens.refresh() vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { buffer = bufnr, callback = vim.lsp.codelens.refresh, }) end end, settings = { gopls = { -- https://github.com/golang/tools/blob/master/gopls buildFlags = { "-tags=wireinject,integration" }, gofumpt = false, }, }, } vim.lsp.config["gopls"] = config vim.lsp.enable("gopls", true) ```
- Loading branch information