Skip to content

Resolves #58: Adds inline text highlighting support for .stpa file#104

Merged
Drakae merged 17 commits into
kieler:masterfrom
Tokessa:issue-58-fixed
May 12, 2026
Merged

Resolves #58: Adds inline text highlighting support for .stpa file#104
Drakae merged 17 commits into
kieler:masterfrom
Tokessa:issue-58-fixed

Conversation

@Tokessa

@Tokessa Tokessa commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Resolves #58:

Adds four new kinds of inline text highlighting for an .stpa file.

  • italic with *
  • bold with **
  • underline with _
  • strikethrough with ~

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:

  • Hidden marker mode (default)
  • Visible marker mode

Implemented escaping for marker characters using a backslash, allowing them to be displayed as plain text.

Comment thread extension/src-language-server/stpa/diagram/diagram-controlStructure.ts Outdated

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 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 InlineMarkdownDecorator to decorate inline markers in .stpa string 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.

Comment thread extension/src/decorations.ts
Comment thread extension/src/decorations.ts Outdated
Comment thread extension/src/extension.ts
Comment thread extension/src/utils-classes.ts Outdated
Comment thread extension/src-language-server/utils.ts
Comment thread extension/tsconfig.json
Comment thread extension/src/decorations.ts Outdated
Comment thread extension/src/decorations.ts
@Drakae Drakae merged commit e6aa02a into kieler:master May 12, 2026
2 checks passed
@Tokessa Tokessa deleted the issue-58-fixed branch May 13, 2026 13:10
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.

Support highlighting in STPA file

3 participants