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

Go code coverage disappears when typing a character #2551

@admilazz

Description

@admilazz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions