olexsmir/gopher.nvim

Error calling `GoTagAdd json`

Opened this issue · 2 comments

I'm sometimes getting this error:

E5108: Error executing lua ...l/share/nvim/lazy/gopher.nvim/lua/gopher/struct_tags.lua:62: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
        [C]: in function 'concat'
        ...l/share/nvim/lazy/gopher.nvim/lua/gopher/struct_tags.lua:62: 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

Restarting nvim and trying again helps somehow (I am able to add tags after that, so it's not about binaries not being installed).

Either I have something misconfigured, in which case the error message could be made more helpful, or there is a bug in the script.

You're not saving it with :w before running the command. Thus the error.
I wish this extension did autosave before everyrun.

Thank you @rew1nter, I don't think that I had noticed that this error could appear because of a non-saved file. I will implement pre-save for it