Add read-only SysML v2 source text viewer with syntax highlighting - #11
Merged
Conversation
- Double-clicking a .sysml file in the Workspace panel opens a new read-only tab showing the file's raw text, syntax highlighted via AvaloniaEdit (new Avalonia.AvaloniaEdit 12.0.0 dependency). - MainWindowShell: new WorkbenchTabKind.SourceText, WorkbenchTab.FilePath, OpenSourceTextTab (dedupes/refocuses an already-open tab for the same file) and GetTabFilePath. - New SourceTextDocumentViewModel/SourceTextDocumentView; self-authored Assets/SysML.xshd highlighting definition (keywords reflected from SysMLv2Lexer with a static fallback), plus comment/string/number rules. - WorkbenchDockFactory: additive SourceTextTabClosed event; existing DiagramTabClosed/Dock OTS artifacts left untouched. - MainWindowView: tab-tracking widened to the common Document base type to host both diagram and source-text tabs in the same tabbed area. - WorkspacePanelToolView: double-tap handling to open .sysml files. - Tests: MainWindowShellTests extended; new SourceTextDocumentViewModelTests and OtsSoftwareTests/AvaloniaEditTests. - Companion docs: design/verification/reqstream/sysml2-model updates for MainWindowShell and WorkspacePanel, new AvaloniaEdit OTS design/ verification/reqstream docs registered in requirements.yaml, ots.sysml, and .reviewmark.yaml (including the new AvaloniaEditTests.cs review coverage); user guide and README updated.
…tyle include App.axaml was missing AvaloniaEdit's mandatory avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml style include, so TextEditor had no control theme/template applied at all. The tab's Text property was still set correctly, so the existing view-model-level tests never caught it - only the actual visual tree was empty. Added a headless regression test that hosts a real TextEditor in a real shown Window and asserts it gets a template/visual children, which fails without the style include and passes with it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.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.
This pull request introduces and documents a new feature that allows users to open any
.sysmlfile in the workspace as a read-only, syntax-highlighted source-text tab using AvaloniaEdit. The changes span user-facing documentation, architectural design, requirements, and review configuration, and add new OTS (off-the-shelf) integration documentation for AvaloniaEdit. The implementation ensures that double-clicking a.sysmlfile in the workspace tree opens its raw source in a dedicated tab, reuses the tab if already open, and leverages an embedded, grammar-synchronized syntax highlighting definition.User-Facing Feature Additions:
.sysmlfile in the workspace tree to open its read-only, syntax-highlighted source in a dedicated tab. Repeated double-clicks focus the existing tab instead of duplicating it. This is documented in the user guide and README. [1] [2]App Shell & Workspace Panel Design/Behavior:
MainWindowShelland workspace panel design docs are updated to describe the new source-text tab type, its tab identity logic, and the newOpenSourceTextTabandGetTabFilePathmethods. TheWorkspacePanelToolViewnow wires double-clicks on.sysmlfiles to open these tabs, and supporting types (SourceTextDocumentViewModel/View) are described. [1] [2] [3] [4] [5] [6] [7]OTS (Off-the-Shelf) Integration:
Requirements & Verification:
Spellchecking and Miscellaneous: