Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

weirdness with errors #1145

Closed
lusis opened this issue Aug 16, 2017 · 9 comments
Closed

weirdness with errors #1145

lusis opened this issue Aug 16, 2017 · 9 comments

Comments

@lusis
Copy link

lusis commented Aug 16, 2017

Hey all,

Since a recent update I've seen some weirdness where invalid code is cached and reporting as a problem even after fixing it.

It appears that some recent change started attempting to validate stuff in the vendor directory and is thus breaking my current file.

This is apparently entirely new behaviour it appears and have turned a few folks internally off of vscode. Here are my current settings:

{
    "workbench.colorTheme": "Material Ocean Next Theme +",
    "[go]": {
        
    },
    "go.testOnSave": true,
    "go.coverOnSave": true,
    "go.lintTool": "gometalinter",
    "go.lintFlags": ["--disable-all", 
    "--enable=vet",
    "--enable=vetshadow",
    "--enable=golint",
    "--enable=ineffassign",
    "--enable=goconst",
    "--enable=deadcode",
    "--enable=gosimple",
    "--enable=errcheck",
    "--enable=goimports",
    "--tests"
],
"github-pr.accessTokens": {
    "XXXXX": "XXXXXX"
},
"go.formatTool": "goimports",
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 14,
"editor.fontFamily": "'Fira Code','Source Code Pro for Powerline', 'Fira Mono for Powerline', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"docker.defaultRegistry": "XXXX",
"docker.defaultRegistryPath": "XXXXX",
"go.testTimeout": "120s",
"go.liveErrors": {
    "enabled": true,
    "delay": 500
},
"go.testFlags": [
    "-short"
],
"terminal.integrated.fontLigatures": false,
"terminal.integrated.fontFamily": "Source Code Pro for Powerline",
"terminal.integrated.fontSize": 10,
"rest-client.environmentVariables": {
    "artifactory": {
        "URL":"XXXX",
        "TOKEN":"XXXX"
    }
}
}
@ramya-rao-a
Copy link
Contributor

If its linting and vetting warnings you are referring to, then can you check either #1121 or #1119 and see if one of those 2 issues are the same as the one you are facing?

@douglarek
Copy link

@ramya-rao-a thanks for your fix; btw, when will release a new version ?

@ramya-rao-a
Copy link
Contributor

sometime next week, I have been busy with a few other things, sorry :(

Until then you can follow the instructions in #1121 (comment)

@lusis
Copy link
Author

lusis commented Aug 18, 2017

@ramya-rao-a sadly neither of the options listed worked. I've tried the latest extension manually installed as well as various other machinations.

I've scoped to the linting to the package level so that at least helps a little but the problem of cached errors is still there as in these screenshots.

I introduce an error and save.
selection_661

I fix the error and save again returning the file to valid state but the line/error is cached somehow

selection_662

@lusis
Copy link
Author

lusis commented Aug 18, 2017

as a follow up, setting "go.coverOnSave": false per #1036 appears to have solved the issue. It's not ideal but it's at least a workaround.

@ramya-rao-a
Copy link
Contributor

@lusis What are the values for go.buildOnSave and go.liveErrors when you see this issue?
Also, in the end when the build error goes away but the linting warnings remain, is the file in a saved state?

@ramya-rao-a
Copy link
Contributor

@luis I can't repro the issue but I think I know what's happening.

The build/lint/vet/cover on save operations are triggered at the same time. And only after all are complete, the results get updated. In your case I believe, the running of the coverage might be taking a long time, thus delaying the update of the build/lint/vet results.

I have decoupled the coverage part from build/lint/vet process. Can you re-try after installing the extension from https://github.com/Microsoft/vscode-go/blob/master/Go-latest.vsix and setting go.coverOnSave back to true?

@ramya-rao-a
Copy link
Contributor

@lusis Did you get some time to try the latest from master?

@ramya-rao-a
Copy link
Contributor

@luis I believe the latest version of the Go extension (0.6.64) has the fix for your issue

Since I havent heard back from you in a while, I am assuming that the fix works.
If it doesnt, please re-open this issue

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants