-
Notifications
You must be signed in to change notification settings - Fork 645
Go code coverage disappears when typing a character #2551
Comments
Thanks for reporting @admilazz
That is a good suggestion, and PRs are most welcome to make this change Code Pointers:
|
Hi , I would like to take this one up. 😄 |
Go ahead @alanlal! |
Hi @ramya-rao-a When I try to launch the extension as per the instructions, I'm getting the following error in the debug console.
The same error pops up in the [Extension development host] vscode window as well. |
Does that file exist? |
There is |
Hi, I think the problem is that the typescript code is not getting compiled to the I'm not sure if this is a required step or am I doing something wrong here ??. Because it is not mentioned in page : Setting up local environment |
It is not a required step. By default, there are tasks running that will compile the changes that are made. Maybe for some reason that task is not running for you. |
Hi, Made the changes and created a PR #2586 😄 |
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
The latest update 0.14.2 has the fix for this, Thanks @kegsay |
The Go code coverage disappears when typing a character. This is implemented in removeCodeCoverageOnFileChange in goCover.ts. I find this very annoying, since I want to run the code coverage and then go through it and update the unit tests to add the missing tests, but as soon as I type a character in the unit test, the coverage information disappears.
I suggest that the code coverage should be removed when a Go file is saved, rather than when a character is typed. After all, the comment in the source saying that the code coverage is stale when a file is changed is false. The code coverage only becomes stale when the change is committed to disk (and would thus affect the result of compilation).
Alternately, please provide an option to disable removeCodeCoverageOnFileChange.
My current workaround is to change the language of the unit test file(s) from Go to plain text so it doesn't trigger the problem and then change back to Go before running the tests. It's not very nice.
The text was updated successfully, but these errors were encountered: