Resolves #58: Adds inline text highlighting support for .stpa file#104
Merged
Conversation
…easy adding new marker
Drakae
approved these changes
Apr 14, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds markdown-like inline highlighting for quoted strings in .stpa files (italic/bold/underline/strikethrough), including cursor-sensitive marker hiding/visibility and escape handling, and ensures diagram labels strip these inline markers when rendered.
Changes:
- Introduces
InlineMarkdownDecoratorto decorate inline markers in.stpastring literals and adds a UI toggle to show/hide markers. - Adds shared marker definitions/types and updates markdown export + language server to use/strip marker-aware text.
- Hardens webview icon rendering and makes diagram expansion state immutable.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/tsconfig.json | Adds TS types + paths configuration intended to support Langium typings. |
| extension/src/utils.ts | Removes UCA_TYPE from utils (moved to utils-classes). |
| extension/src/utils-classes.ts | Adds UCA_TYPE, marker config types, and shared inline marker definitions. |
| extension/src/report/md-export.ts | Updates import to new UCA_TYPE location. |
| extension/src/extension.ts | Wires up inline decorator + editor/title toggle commands and context keys. |
| extension/src/decorations.ts | New decorator implementing inline marker parsing, hiding, and styling. |
| extension/src-webview/feather-icons-snabbdom/feather-icons-snabbdom.tsx | Avoids runtime error for unknown icon IDs. |
| extension/src-language-server/utils.ts | Adds marker stripping + CST raw string extraction for diagram labels. |
| extension/src-language-server/stpa/diagram/diagram-relationshipGraph.ts | Uses CST-raw string and strips inline markers for node descriptions. |
| extension/src-language-server/stpa/diagram/diagram-controlStructure.ts | Strips inline markers from edge/IO labels. |
| extension/src-language-server/diagram-server.ts | Makes expansionState a const map. |
| extension/package.json | Contributes the new toggle commands and editor/title menu items. |
| extension/README.md | Documents supported inline highlighting syntax and escaping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
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.
Resolves #58:
Adds four new kinds of inline text highlighting for an .stpa file.
Markers (*, ~, etc.) are normaly hidden and only appear when the cursor is placed within the highlighted section.
Added a toggle button (top-right corner) to switch between:
Implemented escaping for marker characters using a backslash, allowing them to be displayed as plain text.