File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -174,11 +174,12 @@ Use the following configuration to have your imports organized on save using
174174the logic of ` goimports ` and your code formatted.
175175
176176``` lua
177- autocmd (" BufWritePre" , {
177+ vim . api . nvim_create_autocmd (" BufWritePre" , {
178178 pattern = " *.go" ,
179179 callback = function ()
180- local params = vim .lsp .util .make_range_params ()
181- params .context = {only = {" source.organizeImports" }}
180+ local params = vim .lsp .util .make_range_params (0 , " utf-8" )
181+ params .context = { only = { " source.organizeImports" } }
182+
182183 -- buf_request_sync defaults to a 1000ms timeout. Depending on your
183184 -- machine and codebase, you may want longer. Add an additional
184185 -- argument after params if you find that you have to write the file
@@ -193,11 +194,12 @@ autocmd("BufWritePre", {
193194 end
194195 end
195196 end
196- vim .lsp .buf .format ({async = false })
197+ vim .lsp .buf .format ({ async = false })
197198 end
198199})
199200```
200201
202+
201203### <a href =" #neovim-omnifunc " id =" neovim-omnifunc " >Omnifunc</a >
202204
203205In Neovim v0.8.1 and later if you don't set the option ` omnifunc ` , it will auto
You can’t perform that action at this time.
0 commit comments