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
174
174
the logic of ` goimports ` and your code formatted.
175
175
176
176
``` lua
177
- autocmd (" BufWritePre" , {
177
+ vim . api . nvim_create_autocmd (" BufWritePre" , {
178
178
pattern = " *.go" ,
179
179
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
+
182
183
-- buf_request_sync defaults to a 1000ms timeout. Depending on your
183
184
-- machine and codebase, you may want longer. Add an additional
184
185
-- argument after params if you find that you have to write the file
@@ -193,11 +194,12 @@ autocmd("BufWritePre", {
193
194
end
194
195
end
195
196
end
196
- vim .lsp .buf .format ({async = false })
197
+ vim .lsp .buf .format ({ async = false })
197
198
end
198
199
})
199
200
```
200
201
202
+
201
203
### <a href =" #neovim-omnifunc " id =" neovim-omnifunc " >Omnifunc</a >
202
204
203
205
In 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