-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gopls/doc: command for rendering code lenses inline in Neovim #560
base: master
Are you sure you want to change the base?
Conversation
7ae4ecf
to
2bf0b41
Compare
This PR (HEAD: 2bf0b41) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/645555. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/645555. |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/645555. |
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) ```
2bf0b41
to
010d34a
Compare
This PR (HEAD: 010d34a) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/645555. Important tips:
|
Message from Fredrik Averpil: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/645555. |
This adds a lead on how to render code lenses inline, for gopls, in Neovim.
A full example (requires Neovim v0.11.0, where
vim.lsp.config
andvim.lsp.enable
was introduced):Official help docs:
https://neovim.io/doc/user/lsp.html#_lua-module:-vim.lsp.codelens