docs(design): visual SysML modeling in the VS Code extension - #329
Merged
Conversation
Co-Authored-By: jason.han <jason.han@jpl.nasa.gov>
Author
Original prompt from jason.han
|
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Design note only — no code. Answers "can we author SysML visually in the extension today?" (no:
editors/vscodeis grammars + aLanguageClientoversysml-lsp, no webview) and lays out three shippable tiers that get there, each anchored to what already exists.The premise is that
internal/core/viewalready does the hard part — it renderstree/interconnection/state/action/tableoffsemantics.Model.ExposedElements, the model's connectors, and the lowered graphs, and writestext/mermaid/markdown. What's missing is a transport, a panel, and more operations ininternal/core/edit(which today has onlyOpSetValueandOpRename).Tier 1 — live read-only diagram. Custom LSP requests, so the diagram comes from the same analysis the diagnostics come from rather than a second parse or a
sysml -rendersubprocess per keystroke:Push-notify/pull-artifact keeps large diagrams off the wire while the panel is hidden. Gated on
experimental: { openSysmlRender: true }so old server + new extension degrades instead of erroring. Two Go-side changes matter:view.Node/view.Edgegain a source origin ({doc, span}) for click-to-source. Additive — the text/Mermaid writers ignore it, so goldens don't move.model.WorkspacegainsRenderView/Views, built onnewResolverthe waySession.viewRendereralready does, so REPL and LSP converge on one entry point.Because a model being written usually has no
viewdeclaration (and an empty panel would be useless),opensysml/renderalso accepts a pseudo-view —#tree,#state:<fqn>— rendering an element as if a view exposing it existed. Nothing synthetic enters the model or index; the exposed set goes straight to the renderer.Tier 2 — authoring via text edits. The palette's actions are
editoperations, so the.sysmlfile stays the single source of truth:OpAddMember,OpAddConnection,OpDelete{Cascade}, plus the existingOpSetValue/OpRename, each keepingedit's refuse-on-new-diagnostic contract and passing the result throughinternal/core/format.opensysml/applyModelEditreturns aWorkspaceEditrather than writing the file, soapplyEditputs diagram actions in VS Code's undo stack. The diagram never mutates itself — it applies the edit, analysis re-runs,renderChangedfires, the panel redraws from the model — so "diagram disagrees with file" isn't representable.Tier 3 — drag-and-drop. Layout is not model data: positions live in a
<model>.sysml.layout.jsonsidecar keyed by FQN (rendering node ids fromnodeIDs.takearen't stable across renders), never in the spec-conformant document. All model mutation still goes through tier 2's operations, so tier 3 adds gestures, not a second write path; onlyOpMove(re-parenting, atomic delete+add) and all-or-nothing batching are new. Mermaid becomes the export path and an SVG canvas becomes the editing surface, since Mermaid self-lays-out and exposes no handles.Known limitations are stated in the doc rather than elided:
sequence/geometrykinds stay unsupported, the panel is single-document, and the layout sidecar is explicitly tool-defined (SysML v2 §10.2 leaves drawing to the tool) — no diagram-interchange claim.Docs-only change; also linked from
docs/internals/design/README.mdand the mkdocs nav.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/caa0144ddce24bf9a15c65af3746b033
Requested by: @HuiJun