feat(vscode): support function names as test titles - #78
Conversation
Port the VS Code extension changes from web-infra-dev/rstest#1908 (e1607861ac055c6f9b687f0fea3a7829f46ec14b). Preserve local parser test paths and track post-0.12.2 main without changing dependencies.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9002c9971
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78240b05f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5c430ae6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b843c9d150
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Brings web-infra-dev/rstest#1908 (
e1607861) to the Test Explorer:describe/test/it/suitecan take a function or class as the title, which runs asname || '<anonymous>'.This is a functional port. The first commit copies upstream's parser change as is; the second replaces its separate scope-analysis pass with a smaller resolver that runs inside the existing discovery walk and matches runtime names more often.
testNamePatterncome from the AST title, so it must equal the runtime name. Upstream falls back tounnamed testwhenever it cannot prove a name, which never matches at run time.varredeclarations resolve as upstream specifies. Assignments update bindings, anonymous function and class expressions take the declared or assigned name, and named imports use the imported name.mod.Foo/obj.muse the property name. A name bound to an unknown value (parameter, destructuring, call result) staysunnamed test.parserTest.tsshrinks from 433 lines (verbatim port) to 286. The divergence is recorded as adaptation 12 inpackages/vscode/AGENTS.md; the tracked Rstest state advances toe1607861.Discovery works with any core. Running function-titled tests needs the core half of #1908, which is not in a published
@rstest/corerelease yet (latest is 0.12.2). Dependencies and the supported core range are unchanged.Related Links
Checklist
describe/testand asserts the AST titles equal the real runtime names. The remaining gaps need evaluation (fn.bind(), a redefinedname, a function passed as a parameter).