-
Notifications
You must be signed in to change notification settings - Fork 646
Autocomplete Should Complete From Packages Which Haven't Been Imported Yet #407
Comments
+1 |
This is an issue most editors I've used suffer from. It would be amazing is this could be implemented. |
Visual Studio (not VS Code) solves this problem in C# by adding a blue 'tag' to a type that can be imported, as well as by providing autocomplete for namespaces. Hitting the blue tag provides a selection of assemblies which contain a MailMessage type, when one is selected then a using statement is added (similar to importing a package in Go). Here's what it looks like in LinqPad: (In the screencast, I've used the mouse to click on the little bar instead of the keyboard shortcut to make it clearer.) |
This feature is now available in the latest version of the Go extension : 0.6.44 You need to set Do give it a try and give feedback We will turn it on by default in the next update |
@ramya-rao-a - I'd just like to say thanks for implementing this feature, I've really been enjoying it! |
@a-h Thanks for bringing up the feature request in the first place. There has been a lot of positive feedback around this! |
Just thinking how vscode-go could be even more awesome for me.
I sometimes find myself hunting through APIs. For example...
fmt
package, there is a function calledPrints
which formats to a string, but I can't remember the parameters.fmt.Prints(
, but I don't see any autocompletion. This is becausefmt
hasn't been imported yet.fmt
package and realise that the function is actually calledSprint
notPrints
, so I fix it and hit save... the plugin now importsfmt
and I can browse the parameters and return value in the popup.I wanted to use vscode-go to help me browse the
fmt
package and choose the correct method, but it's not helping me to do that. Note how when I've typedfmt.
I can't see anything...It would be better if:
fmt.
and a list of possible functions and their parent packages appears.fmt
is already in my path (but not listed in my imports), so all the methods fromfmt
are listed. I noticePrints
isn't in the list.fmt.Sprint
is there, I hit the down arrow a couple of times to choose it and press the open bracket. I'm in the parameters list, and I can see the popup detailing the parameters the method accepts.Save
and theimport
statement is updated as usual.Does anyone else think this would be good?
The text was updated successfully, but these errors were encountered: