Skip to content

updated vim.md regarding breaking change in neovim 0.11 #579

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions gopls/doc/vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,12 @@ Use the following configuration to have your imports organized on save using
the logic of `goimports` and your code formatted.

```lua
autocmd("BufWritePre", {
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
local params = vim.lsp.util.make_range_params()
params.context = {only = {"source.organizeImports"}}
local params = vim.lsp.util.make_range_params(0, "utf-8")
params.context = { only = { "source.organizeImports" } }

-- buf_request_sync defaults to a 1000ms timeout. Depending on your
-- machine and codebase, you may want longer. Add an additional
-- argument after params if you find that you have to write the file
Expand All @@ -193,11 +194,12 @@ autocmd("BufWritePre", {
end
end
end
vim.lsp.buf.format({async = false})
vim.lsp.buf.format({ async = false })
end
})
```


### <a href="#neovim-omnifunc" id="neovim-omnifunc">Omnifunc</a>

In Neovim v0.8.1 and later if you don't set the option `omnifunc`, it will auto
Expand Down