-
Notifications
You must be signed in to change notification settings - Fork 646
Go: Add Import command allows import for packages that are already imported #494
Comments
The current design of "Add Import" kind of relies on Broader note - this extension tries as hard as it can to not have to interpret Go code at all, leaving that responsibility to utilities written in Go which can use the official parsers and type checking logic built into the Go runtime. This |
Agreed that parsing is best left to utilities written in Go. Lucky for us you already have written one :) The need for removing duplicates from the packages list doesn't arise much for the Personally, this ask is more for my work in #437 where I add importable packages in autocomplete suggestions. I make use of the One catch of using |
Got it. Makes sense to update |
In the below sample go file,
fmt
is already importedNow run
Go: Add Import
command from the command palette.The quick open shows
fmt
as an option as well.Choose
fmt
, and an import tofmt
gets addedEither, we shouldn't show an already imported package in the quick open or when chosen, show an info/error box saying that the package is already imported
The text was updated successfully, but these errors were encountered: