Skip to content

Fixes highlighting using wrong validation data#107

Merged
Drakae merged 2 commits into
kieler:masterfrom
Tokessa:ref-high
May 6, 2026
Merged

Fixes highlighting using wrong validation data#107
Drakae merged 2 commits into
kieler:masterfrom
Tokessa:ref-high

Conversation

@Tokessa

@Tokessa Tokessa commented May 3, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where highlighting for:

  • missing feedback in the control structure
  • missing references in the control structure and relationship graph

was based on the previously validated .stpa file instead of the currently active one.

Co-authored-by: Copilot <copilot@github.com>
@Tokessa Tokessa changed the title Fixes highlighting using stale validation data Fixes highlighting using wrong validation data May 3, 2026
@Drakae Drakae requested a review from Copilot May 4, 2026 08:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make STPA highlighting use validation data from the currently active document instead of whichever .stpa file was validated last. It does that by threading document URIs through validation state and diagram generation so missing-reference and missing-feedback highlights can be resolved per file.

Changes:

  • Replaced global validator state for missing references/feedback with URI-keyed caches.
  • Captured the active document URI during validation and diagram generation.
  • Updated diagram creation to read missing-reference and missing-feedback data from the URI-specific validator entries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
extension/src-language-server/stpa/services/stpa-validator.ts Stores missing-reference and missing-feedback validation results per document URI instead of globally.
extension/src-language-server/stpa/diagram/diagram-generator.ts Passes the active document URI into graph generation and reads URI-scoped validation data for highlighting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread extension/src-language-server/stpa/services/stpa-validator.ts
Comment thread extension/src-language-server/stpa/diagram/diagram-generator.ts Outdated
@Drakae Drakae merged commit acab395 into kieler:master May 6, 2026
2 checks passed
@Tokessa Tokessa deleted the ref-high branch May 6, 2026 18:15
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.

3 participants