olexsmir / gopher.nvim

Neovim plugin for make golang development easiest
313 stars 14 forks source link

Error calling `GoTagAdd json` #31

Open Monnoroch opened 1 year ago

Monnoroch commented 1 year ago

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.

rew1nter commented 1 year ago

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

olexsmir commented 1 year ago

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