Repository navigation
fix: only start a profiling sub-task for validated nodes - #2276
Merged
cdietrich merged 1 commit intoNov 18, 2026
Merged
Conversation
With the 'validating' profiler category active, validateAstNodes started a sub-task for every AST node but stopped it only for nodes whose validateSingleNodeOptions returned validateNode: true. A skipped node left its sub-task on the task's stack, task.stop() then threw "cannot be stopped before sub-task(s)", and validateDocument caught that error: all custom-check diagnostics of the document were dropped and no profiling record was written. Start the sub-task only for nodes that are validated, so every started sub-task is stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XkvVhAAk5NRLH75qMHMc3m
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.
Fixes #2275
With the
validatingprofiler category active,validateAstNodesstarted a profiling sub-task for every AST node but stopped it only for nodes that are validated. A node skipped viavalidateSingleNodeOptions(validateNode: false) left its sub-task on the stack,task.stop()threw, andvalidateDocumentcaught and logged the error. As a result, all custom-check diagnostics of the document were lost and no profiling record was written (details and reproduction in #2275).This starts the sub-task only for nodes that are validated, so every started sub-task is stopped. The non-profiled path is unchanged.
Test:
document-validator.test.tsgets a profiled validation with a validator that skips one node. It checks that the other nodes' diagnostics are reported, nothing is logged as an error, and one profiling record is written. It fails onmain(no diagnostics at all) and passes with the fix.npm run build,npm run lintandnpm testpass.🤖 Generated with Claude Code
https://claude.ai/code/session_01XkvVhAAk5NRLH75qMHMc3m