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.

Find solution to slow "format on save" impacting tests #786

@atombender

Description

@atombender

With Go, the goimports formatter is not super fast. It can take a second for it to run on a large file — and it's almost always slower than I work. I frequently save and then immediately hit my keyboard shortcut to run the tests, and as a result, I constantly find myself in a situation where the tests are run before imports have been fixed.

For example, I might add a log.Printf() call, save, run tests, which then immediately fail with:

./functions.go:643: undefined: log in log.Printf

A solution to this would for the test runner to wait with the run until the file is fully saved. I don't know if VSCode has the necessary APIs to even do this, however.

Would it perhaps also make sense that the test runner saves a file first if it's dirty?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions