Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoAddTag doesn't work with inline struct. #16

Closed
AllenDang opened this issue Jul 16, 2021 · 5 comments
Closed

GoAddTag doesn't work with inline struct. #16

AllenDang opened this issue Jul 16, 2021 · 5 comments

Comments

@AllenDang
Copy link

Here is the code I'm trying to add tag.

func test() {
  type some struct {
    Success bool   //<- where the cursor is
  }
  ...
}

Invoke :GoAddTag reports

Unable to find any nodes at pos.
struct not found

This may related to treesitter.

@ray-x
Copy link
Owner

ray-x commented Jul 16, 2021

thanks! The issue was fixed.

@ray-x ray-x closed this as completed Jul 16, 2021
@AllenDang
Copy link
Author

@ray-x No issue still remains...

@ray-x
Copy link
Owner

ray-x commented Jul 17, 2021

addtag.mov

Strange. But with the code you sent out, I can add tag.

@AllenDang
Copy link
Author

AllenDang commented Jul 17, 2021

@ray-x I know what's going on here. I have multiple inline struct with same name, so the gomodifytags with -server options won't work well. I guess we should use -line for a accurate result.

@ray-x
Copy link
Owner

ray-x commented Jul 17, 2021

If you have a naming conflict, gomodifytag wont work.
I added -line option to the code. not sure will it work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants