Commit 010d34a
committed
docs: code lens command for Neovim
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)
```1 parent e426616 commit 010d34a
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments