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

Annotations seem not work properly on non-struct types. #4

Closed
sslime336 opened this issue Sep 12, 2022 · 5 comments
Closed

Annotations seem not work properly on non-struct types. #4

sslime336 opened this issue Sep 12, 2022 · 5 comments

Comments

@sslime336
Copy link

sslime336 commented Sep 12, 2022

Firstly, I'd like to say that was awesome!

图片

In Go, not only struct types can achieve different interfaces, other like string, int, ... primitive type, user defined types which can carry methods can also work with that.

Anyway, this is a delightful extension ! 😃

@tkgalk
Copy link
Owner

tkgalk commented Sep 14, 2022

What would be the use case for that? Where would you want the type Alice string to link to? 🤔

@sslime336
Copy link
Author

sslime336 commented Sep 15, 2022

I am sorry for that inappropriate example, below is a heap impl the interface from "container/heap"
图片
图片
Sometimes, use types except struct may be a better chioce. :)

@tkgalk
Copy link
Owner

tkgalk commented Sep 15, 2022

Ah, makes sense. So in the first example even though the Alice is a string and not a struct, we'd still want it to point to Person because it implements the interface. I haven't used VS Code for a moment, since changing jobs I migrated to GoLand/nvim.

But I'll see what I can do, I need to check what the LSP provides. :)

tkgalk added a commit that referenced this issue Jan 7, 2023
@tkgalk
Copy link
Owner

tkgalk commented Jan 28, 2023

Sorry it took so long, mostly because I didn't use VS Code. But this got fixed in the newest release. Unfortunately, I can't push the update to Extension store, because... I lost my Microsoft access (changing countries and phone numbers). I'll get it back on 6th of February and I'll push the update then. Until then you can always grab the extension from GitHub.

@tkgalk tkgalk closed this as completed Jan 28, 2023
@tkgalk
Copy link
Owner

tkgalk commented Feb 6, 2023

https://marketplace.visualstudio.com/items?itemName=galkowskit.go-interface-annotations <- released now. :)

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