Repository navigation
Conversation
This was referenced Oct 6, 2026
metif12
force-pushed
the
feat/test-explorer
branch
2 times, most recently
from
October 7, 2026 18:20
99969dc to
f1085e8
Compare
The extension used tasks and CodeLens for tests, so nothing appeared in the Test Explorer panel. `golang.go` uses `vscode.tests.createTestController` with three views in the `test` container; this registers a controller and shows one item per `test_` function. The mapping onto V is unusually direct. A test is a `test_`-prefixed function in a `_test.v` file, `VTEST_ONLY_FN` takes exactly the glob filter that `TestRunRequest.include` already models, and `v test` is already a task. So running a selected test is `v test <file> -run-only <name>`, and the output is parsed to mark each test passed, failed or errored. Discovery is best-effort. A workspace with no `_test.v` files shows an empty tree rather than failing activation, and a file that cannot be read is skipped. The tree refreshes on workspace and file changes, so it stays honest without tracking which file changed into which item. The discovery and output parsing live in a pure module so they can be tested without a workspace or a compiler. I confirmed the tests catch something by breaking the regex and watching the discovery test fail, then reverting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
metif12
force-pushed
the
feat/test-explorer
branch
from
October 10, 2026 04:53
f1085e8 to
3526b6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Test Explorer integration. The extension used tasks and CodeLens for tests, so
nothing appeared in the Test Explorer panel — a user had no tree of tests, no
per-test run button, and no pass/fail status in the panel.
golang.gousesvscode.tests.createTestControllerwith three views in thetestcontainer. This registers a controller and shows one item pertest_function.
Why the mapping is unusually direct
A V test is a
test_-prefixed function in a_test.vfile. There is no testframework and no test object, so the file layout is the whole contract. That
makes the three pieces line up:
TestItemtest_functionTestRunRequest.includeVTEST_ONLY_FNv test <file> -run-only <name>So running a selected test is one command with one filter, and the output is
parsed to mark each test passed, failed or errored.
Discovery
Best-effort, so it cannot break activation:
_test.vfiles shows an empty treetracking which file changed into which item
Verification
npm run lint,npm run lint:md,npm run test:grammar,npm run buildandnpm run packageall pass.npm testreports 29 tests, 26 pass, 3 fail. The three failures are thepre-existing Windows path-separator tests on
master, fixed in#561 and not touched here.
Proof the new tests catch something. I broke the test-function regex in
testDiscovery.tsand watchedfinds the test functions in a test filego red,then reverted it. A test that cannot fail is not evidence.
Known limitations
the extension-host suite; the discovery and output parsing are.
with "This test did not run", which is a different problem from running and
failing. That distinction is deliberate.
v testreports per-file, so a run of a whole file marks every test in it fromone output. Per-test timing is not available.
Relation to other PRs
Independent of #556, #557, #558, #559, #560, #561 and #562. It adds new files
and touches
extension.tsandpackage.jsononly where the other PRs do not.