-
Notifications
You must be signed in to change notification settings - Fork 19
Golang struct auto-fill does not work #36
Comments
Interesting. 🤔 |
@weilbith yes, it closes. I can provide more details if necessary, please let me know if you need anything! |
@weilbith I've tried to do some debugging, here's an action that is being executed in {
server_data = {
command = {
arguments = { {
Fix = "fill_struct",
Range = {
end = {
character = 20,
line = 62
},
start = {
character = 1,
line = 62
}
},
URI = "file:///home/anderson/src/darwin/main.go"
} },
command = "gopls.apply_fix",
title = "Fill log.TextFormatter"
},
edit = vim.empty_dict(),
kind = "refactor.rewrite",
title = "Fill log.TextFormatter"
},
<metatable> = <1>{
__index = <table 1>,
execute = <function 1>,
get_disabled_reason = <function 2>,
get_kind = <function 3>,
get_name = <function 4>,
get_workspace_edit = <function 5>,
is_command = <function 6>,
is_disabled = <function 7>,
is_preferred = <function 8>,
is_workspace_edit = <function 9>,
new = <function 10>,
server_data = {},
<metatable> = <2>{
__index = <table 2>,
execute = <function 11>,
get_disabled_reason = <function 12>,
get_kind = <function 13>,
get_name = <function 14>,
get_title = <function 15>,
get_workspace_edit = <function 16>,
is_disabled = <function 17>,
is_preferred = <function 18>,
new = <function 19>
}
}
} The |
@weilbith I think I've spotted a reason why if self:is_workspace_edit() then
vim.lsp.util.apply_workspace_edit(self.server_data.edit)
elseif self:is_command() then
vim.lsp.buf.execute_command(self.server_data.command) If I remove first check ( I think |
Neovim version:
NVIM v0.7.0-dev+715-g1f3c0593e
LSP server:
gopls
My config:
When selecting
Fill log.TextFormatter
, nothing happens. However when usingvim.lsp.buf.code_action()
, the struct is properly auto-filled.In the meantime,
Organize imports
works just fine. Any ideas?The text was updated successfully, but these errors were encountered: