-
Notifications
You must be signed in to change notification settings - Fork 646
goreturns erroneously disabled #2578
Comments
Nothing? |
@galileo-pkm Thanks for reporting and your patience. As per golang/go#24661, the issue that tracks Go module support in various Go tools in the eco system, @stamblerre, @ianthehat Did something change here that |
I have been using vscode with my "fix" for a while now and the only issue is the annoying warnings. IMHO that kind of behaviour may be acceptable for software that caters to a non technical audience but in a developer tool, it is definitely a wrong thing to do. |
@galileo-pkm @ianthehat, @stamblerre What would be the best place for @galileo-pkm to log a bug against goimports for the issue of versioned imports getting added? |
Just tried it, it works without issues.
An issue has been posted by multiple people almost a year ago, no one cares: Two other minor issues if it matters: With 0.11.1-beta.1 I get this notification: go.inferGopath: There is no technical reason to disable inferGopath when using modules. I usually set up GOPATH in the folder settings, and in this case my GOPATH is the same as if it was setup by go.inferGopath and everything works without issues. Maybe something to look into also?
|
@galileo-pkm: Are you using the latest version of Also, @ramya-rao-a , neither Ian nor I would know much about |
Ah! So, goreturns never had to do anything special to get modules working as long as the underlying
|
Oh you know I may have actually spoken too soon. I assumed |
Yes, goreturns must typecheck because it needs to know if (eg) |
@sqs, So what would you say the state of modules support by goreturns is? |
The issue seems to be fixed with the latest (v0.0.0-20190628222527-fb37f6ba8261) version of go imports. I forgot the check what was the version that I had but I did the "Go:Install/Update tools" via VSCode about 2 weeks ago so it must have been fixed in the meantime. |
It popped up after I updated to the beta version that you provided so I presumed it was related, its just icons, it doesn't really matter.
The reason for setting up a per project gopath is the same as when I was using go.inferGopath: Whether something is necessary or not is not the point. The main point here is overriding user configuration. That is newer a good decision. Imagine if Apache, BIND and the rest of the core internet software authors decided that it was a good idea that those services modify their own configuration and force their choice instead of the users. Half of the internet services would have been broken and there would be pitchfork mobs after them ;) |
Since @galileo-pkm Can you log a new issue with the proposal for not disabling |
The latest update (0.11.1) to the Go extension now allows dismissing of the notification |
When using modules vscode returns this message:
"
goreturns
doesnt support auto-importing missing imports when using Go modules yet. So updating the "formatTool" setting togoimports
for this workspace."That is false, goreturns works perfectly fine with go modules as can be seen from this example:
To make matters worse vscode changes the format tool to goimports which brakes the code
with versioned imports:
Forcing a (broken in this case) choice on a user is newer the right to do. If I'm about to shoot myself in the foot, by all means display a warning (preferably once, not repeatedly) but let me proceed.
Hackish "fix" is to remove the write permissions from the settings file, vscode displays a warning but works as expected.
This is with the latest version (1.35.1).
The text was updated successfully, but these errors were encountered: