Issue with GoTagAdd Function when Called on Multiple Structs
Opened this issue · 2 comments
Problem Description:
I'm trying to use the GoTagAdd
function on multiple structs in my Go code, as shown below:
type (
LandingArticle struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Title string `json:"title"`
ShortDescription string `json:"short_description"`
Content string `json:"content"`
KitabisaURL string `json:"kitabisa_url"`
ImageURL string `json:"image_url"`
Status string `json:"status"`
TotalRecord int `json:"total_record"`
TotalPage int `json:"total_page"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at"`
}
FilterLandingArticle struct {
Status string
SearchTitle string
SortOrder string
PageNumber int
PageSize int
}
)
However, I'm encountering an issue when attempting to call GoTagAdd on the above-mentioned structs. The function doesn't seem to work as expected, especially when used on multiple structs as shown in the provided example.
Reproduction Steps:
- Create structures similar to the example given above.
- Call GoTagAdd on those structs with appropriate parameters.
Expected Outcome:
I expect GoTagAdd to function properly on multiple structs as demonstrated in the example above. Unfortunately, there seems to be an issue causing the function to not work as expected.
Actual Outcome:
The call to GoTagAdd does not work as expected when used on multiple structs as described above. This results in my inability to effectively add tags to multiple structs.
E5108: Error executing lua ...are/nvim/lazy/gopher.nvim/lua/gopher/_utils/ts/nodes.lua:44: attempt to call field 'count_parents' (a nil value)
stack traceback:
...are/nvim/lazy/gopher.nvim/lua/gopher/_utils/ts/nodes.lua:44: in function <...are/nvim/lazy/gopher.nvim/lua/gopher/_utils/ts/nodes.lua:43>
[C]: in function 'sort'
...are/nvim/lazy/gopher.nvim/lua/gopher/_utils/ts/nodes.lua:43: in function 'sort_nodes'
...are/nvim/lazy/gopher.nvim/lua/gopher/_utils/ts/nodes.lua:130: in function 'nodes_at_cursor'
...hare/nvim/lazy/gopher.nvim/lua/gopher/_utils/ts/init.lua:34: in function 'get_struct_node_at_pos'
...l/share/nvim/lazy/gopher.nvim/lua/gopher/struct_tags.lua:10: in function 'modify'
...l/share/nvim/lazy/gopher.nvim/lua/gopher/struct_tags.lua:100: in function 'tags_add'
[string ":lua"]:1: in main chunk
currently, the plugin doesn't support adding tags on multiple structs simultaneously. I will implement this feature in the future, but not soon. Currently, I'm working on refactoring this plugin