Skip to content

Publish option_skip to test item clients - #1424

Merged
davidanthoff merged 2 commits into
mainfrom
ls-option-skip
Aug 14, 2026
Merged

Publish option_skip to test item clients#1424
davidanthoff merged 2 commits into
mainfrom
ls-option-skip

Conversation

@davidanthoff

@davidanthoff davidanthoff commented Aug 14, 2026

Copy link
Copy Markdown
Member

Forwards the skip keyword argument of @testitem through textDocument/publishTests.

JuliaWorkspaces records option_skip on TestItemDetail (julia-vscode/JuliaWorkspaces.jl#255, shipped in 12.0.0), but publish_tests dropped it. Without this the VS Code extension cannot see skip and so cannot forward it to TestItemControllers — a test item marked skip=true would silently run anyway.

Wire shape

optionSkip mirrors the JuliaWorkspaces type, Union{Bool,String}:

  • false / true — a literal, known statically
  • a string — the source text of an expression the test process evaluates immediately before the test item would run

Keeping the union rather than normalising to a string lets a client distinguish a test item that never runs (render it as skipped in the tree) from one whose outcome is only known at run time (run it and find out). The expression must be evaluated worker-side because it may inspect the worker's environment, e.g. VERSION < v"1.11" or Sys.iswindows(), which can differ from the language server's.

@dict_readable handles the union correctly — field_type collapses a non-Missing union to Any, so the value passes through unconverted. Verified both variants serialize to their natural JSON forms (boolean vs string) and round-trip through the generated Dict constructor.

Compat

Bumps JuliaWorkspaces to "12". Besides option_skip, 12.0.0 changes test item ids from positional (<uri>:<n>) to stable (<relpath>::<label>) — ids are forwarded verbatim here, so no change was needed in this repo for that.

Downstream

The VS Code extension needs a matching change to read optionSkip and forward it when creating a test run; TestItemControllers' json_protocol.jl gains the corresponding field in julia-testitems/TestItemControllers.jl#39.

🤖 Generated with Claude Code

davidanthoff and others added 2 commits August 13, 2026 17:15
JuliaWorkspaces now records the `skip` keyword argument of `@testitem`,
but `publish_tests` dropped it, so it never reached the client. Without
it the client cannot forward `skip` to TestItemControllers, and skipped
test items would silently run.

The field mirrors the JuliaWorkspaces type: `false`/`true` for a literal,
or the source text of an expression that the test process evaluates just
before the test item would run. Keeping the union (rather than
normalising to a string) lets a client distinguish a test item that never
runs from one whose outcome is only known at run time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`option_skip` on `TestItemDetail` first ships in JuliaWorkspaces 12.0.0,
which also changes test item ids from positional (`<uri>:<n>`) to stable
(`<relpath>::<label>`).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@davidanthoff
davidanthoff marked this pull request as ready for review August 14, 2026 03:13
@davidanthoff
davidanthoff merged commit 1072d92 into main Aug 14, 2026
25 checks passed
@davidanthoff
davidanthoff deleted the ls-option-skip branch August 14, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant