Skip to content

fix: only start a profiling sub-task for validated nodes - #2276

Merged
cdietrich merged 1 commit into
eclipse-langium:mainfrom
cdietrich:fix/profiled-validation-subtask
Nov 18, 2026
Merged

cdietrich merged 1 commit into
eclipse-langium:mainfrom
cdietrich:fix/profiled-validation-subtask

Conversation

@cdietrich

Copy link
Copy Markdown
Contributor

Fixes #2275

With the validating profiler category active, validateAstNodes started a profiling sub-task for every AST node but stopped it only for nodes that are validated. A node skipped via validateSingleNodeOptions (validateNode: false) left its sub-task on the stack, task.stop() threw, and validateDocument caught 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.ts gets 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 on main (no diagnostics at all) and passes with the fix. npm run build, npm run lint and npm test pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XkvVhAAk5NRLH75qMHMc3m

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

@msujew msujew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cdietrich
cdietrich merged commit c0d1934 into eclipse-langium:main Nov 18, 2026
4 checks passed
@cdietrich
cdietrich deleted the fix/profiled-validation-subtask branch November 18, 2026 10:37
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.

Profiled validation drops all check diagnostics when validateSingleNodeOptions skips a node

2 participants