sysml-v2-lsp 0.1.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -98
- package/README.md +73 -263
- package/dist/server/mcpServer.js +162 -0
- package/dist/server/{server.mjs → server.js} +74 -67
- package/index.cjs +3 -3
- package/package.json +6 -5
- package/sysml.library/.project +17 -0
- package/sysml.library/.settings/org.eclipse.jdt.core.prefs +11 -0
- package/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
- package/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
- package/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
- package/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
- package/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
- package/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
- package/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
- package/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
- package/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
- package/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
- package/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
- package/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
- package/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
- package/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
- package/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
- package/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
- package/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
- package/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
- package/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
- package/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
- package/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
- package/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
- package/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
- package/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
- package/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
- package/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
- package/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
- package/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
- package/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
- package/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
- package/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
- package/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
- package/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
- package/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
- package/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
- package/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
- package/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
- package/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
- package/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
- package/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +147 -0
- package/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
- package/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
- package/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
- package/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
- package/sysml.library/Systems Library/.meta.json +27 -0
- package/sysml.library/Systems Library/.project.json +19 -0
- package/sysml.library/Systems Library/Actions.sysml +552 -0
- package/sysml.library/Systems Library/Allocations.sysml +29 -0
- package/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
- package/sysml.library/Systems Library/Attributes.sysml +25 -0
- package/sysml.library/Systems Library/Calculations.sysml +37 -0
- package/sysml.library/Systems Library/Cases.sysml +71 -0
- package/sysml.library/Systems Library/Connections.sysml +60 -0
- package/sysml.library/Systems Library/Constraints.sysml +44 -0
- package/sysml.library/Systems Library/Flows.sysml +126 -0
- package/sysml.library/Systems Library/Interfaces.sysml +89 -0
- package/sysml.library/Systems Library/Items.sysml +153 -0
- package/sysml.library/Systems Library/Metadata.sysml +32 -0
- package/sysml.library/Systems Library/Parts.sysml +81 -0
- package/sysml.library/Systems Library/Ports.sysml +54 -0
- package/sysml.library/Systems Library/Requirements.sysml +194 -0
- package/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
- package/sysml.library/Systems Library/States.sysml +103 -0
- package/sysml.library/Systems Library/SysML.sysml +539 -0
- package/sysml.library/Systems Library/UseCases.sysml +57 -0
- package/sysml.library/Systems Library/VerificationCases.sysml +103 -0
- package/sysml.library/Systems Library/Views.sysml +164 -0
- package/dist/server/mcpServer.mjs +0 -110
- package/dist/server/parser/parseWorker.mjs +0 -1030
package/CHANGELOG.md
CHANGED
|
@@ -1,118 +1,84 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
3
|
+
## [0.3.0]
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
## [0.1.5]
|
|
29
|
-
|
|
30
|
-
### Added
|
|
31
|
-
|
|
32
|
-
- Python LSP client example in `clients/python/` — zero-dependency script demonstrating how to drive the SysML v2 language server from Python over JSON-RPC/stdio, using the same server as VS Code
|
|
33
|
-
- `sysml.inlayHints.enabled` VS Code setting — allows users to toggle inlay hints on/off (default: true). Server-side gating returns empty results when disabled
|
|
34
|
-
- Extension Development Host settings (`examples/.vscode/settings.json`) — disables inlay hints during F5 testing
|
|
35
|
-
- Code completion provider tests — ensures keyword completions, snippet insert text, and resolve are covered
|
|
36
|
-
- Call hierarchy typed-usage detection — `action x : TypeDef`, `state x : TypeDef`, and `calc x : TypeDef` composition patterns are now recognised as outgoing/incoming calls, not just explicit `perform`/`include`/`accept` keywords
|
|
7
|
+
- Mermaid diagram preview: SysML → Mermaid diagram generation with 6 diagram types (class, activity, state, sequence, interconnection, use-case) and auto-detection
|
|
8
|
+
- Mermaid focus mode: filter diagram to a specific element, its children, parent, and related types
|
|
9
|
+
- Mermaid diff mode: compare original vs. modified SysML and report structural changes
|
|
10
|
+
- Complexity analyzer: structural complexity metrics (nesting depth, coupling, fan-out, documentation coverage) with composite 0–100 index and per-definition hotspots
|
|
11
|
+
- Semantic validator: unresolved type references, invalid multiplicity bounds, empty enumerations, duplicate definitions — with standard-library type allow-list
|
|
12
|
+
- MCP tool `preview`: generates Mermaid diagrams from SysML with focus/diff support
|
|
13
|
+
- MCP tool `getDiagnostics`: returns semantic diagnostics for parsed documents
|
|
14
|
+
- MCP tool `getComplexity`: exposes complexity analysis as an MCP tool
|
|
15
|
+
- Code action quick-fixes: naming convention (PascalCase/camelCase), missing documentation stub, empty enumeration placeholder, unused definition suppression
|
|
16
|
+
- Library type-level indexing: Go-to-Definition into standard library types at exact declaration lines
|
|
17
|
+
- Multiplicity extraction from parse tree (`0..*`, `1`, etc.) on symbols
|
|
18
|
+
- Documentation extraction from doc/comment nodes on symbols
|
|
19
|
+
- Symbol table caching per URI keyed by document version
|
|
20
|
+
- Multi-specialization support: comma-separated specialization targets with `:>` and `specializes`
|
|
21
|
+
- LSP `sysml/serverStats` request: uptime, memory, and cache statistics
|
|
22
|
+
- LSP `sysml/clearCache` request: flush all in-memory caches
|
|
23
|
+
- LSP `sysml/status` notifications: begin/end parse progress events
|
|
24
|
+
- Language configuration: folding markers (`#region`/`#endregion`), indentation rules, `wordPattern`
|
|
25
|
+
- Model stats: lex/parse timing breakdown and complexity report in `sysml/model` response
|
|
26
|
+
- New tests: codeActions, complexity, libraryIndex, semantic validation, MCP preview/diagnostics
|
|
37
27
|
|
|
38
28
|
### Changed
|
|
39
29
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
30
|
+
- MCP `validate` response shape: now returns `syntaxErrors`, `semanticIssues`, and `totalIssues` (was `errors` + `errorCount`)
|
|
31
|
+
- Symbol `typeName` → `typeNames` (array) across MCP core and model provider
|
|
32
|
+
- Definition provider simplified: word-at-position logic moved inline
|
|
33
|
+
- References provider: uses symbol-table–based `findReferences()` instead of cross-file text scanning
|
|
34
|
+
- Diagnostics computed synchronously on document change (removed background parse worker thread)
|
|
35
|
+
- Symbol table kind inference: direct string comparison replaces regex-based rule matching for minification safety
|
|
36
|
+
- Document manager simplified: removed `TextDocuments` integration; parse timing now derived from `ParseResult.timing`
|
|
37
|
+
- esbuild: output format changed from ESM (`.mjs`) to CJS (`.js`); simplified to server + MCP + client bundles
|
|
38
|
+
- Parser simplified: removed SLL/LL two-stage fallback with `BailErrorStrategy`; single-pass parse
|
|
39
|
+
- MCP server: added `instructions` field for tool-call guidance
|
|
40
|
+
- Library index: `resolveLibraryPackage()` replaced by `resolveLibraryType()` for type-level lookups
|
|
44
41
|
|
|
45
|
-
###
|
|
42
|
+
### Removed
|
|
46
43
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
- Remove unnecessary `sysml.inlayHints.enabled` from dev workspace settings (only needed in Extension Development Host)
|
|
44
|
+
- Background parse worker thread (`parseWorker.mjs`) and DFA warm-up
|
|
45
|
+
- `resolveAt()` and `getWordAtPosition()` from symbol table (moved to providers)
|
|
46
|
+
- `findTextReferences()` text-scanning reference finder
|
|
47
|
+
- Keyword typo validation from diagnostics provider (replaced by semantic validator)
|
|
48
|
+
- Several parser and symbol table tests (connection-end parsing, keyword typo, `findTextReferences`)
|
|
53
49
|
|
|
54
|
-
## [0.
|
|
50
|
+
## [0.2.0]
|
|
55
51
|
|
|
56
52
|
### Added
|
|
57
53
|
|
|
58
|
-
-
|
|
59
|
-
- `
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
54
|
+
- Custom LSP request (`sysml/model`): full semantic model with scoped queries
|
|
55
|
+
- MCP server (`sysml-mcp` CLI): 7 tools, 3 resources, 3 prompts for AI-assisted modelling
|
|
56
|
+
- Standard library: 94 bundled SysML v2 / KerML files from OMG release repo
|
|
57
|
+
- Inlay hints: ghost text for inferred types and supertypes
|
|
58
|
+
- Call hierarchy: action call graph navigation
|
|
59
|
+
- Type hierarchy: specialization chain navigation
|
|
60
|
+
- Signature help: parameter tooltips for action/calc invocations
|
|
61
|
+
- Code lens: reference counts above definitions
|
|
62
|
+
- Document links: clickable `import` statements
|
|
63
|
+
- Workspace symbols: cross-document symbol search
|
|
64
|
+
- Linked editing ranges: simultaneous rename of all occurrences
|
|
65
|
+
- Selection ranges: smart expand/shrink selection
|
|
66
|
+
- Code actions: quick-fix actions for diagnostics
|
|
67
|
+
- Formatting: document and range formatting
|
|
68
|
+
- Keyword validation: typo detection with "did you mean?" suggestions
|
|
69
|
+
- npm package: `sysml-v2-lsp` distributable for third-party extensions
|
|
70
|
+
- Python LSP client: reference JSON-RPC/stdio client
|
|
71
|
+
- Parse worker: background ANTLR parsing with DFA warm-up
|
|
72
|
+
- `make update-library`: fetch latest standard library from upstream
|
|
73
|
+
- `make package-server` / `make test-package`: npm tarball build and validation
|
|
69
74
|
|
|
70
75
|
### Changed
|
|
71
76
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### Added
|
|
78
|
-
|
|
79
|
-
- `make test-package` target to test npm package in a simulated consumer project
|
|
80
|
-
- README badges: npm version, license, Socket.dev supply chain security
|
|
81
|
-
|
|
82
|
-
### Fixed
|
|
83
|
-
|
|
84
|
-
- Fix `constructor.name` minification breaking code lens and symbol resolution — `getRuleName()` now uses ANTLR4 `ruleIndex` + `ruleNames[]` instead of `constructor.name` which is mangled by esbuild
|
|
85
|
-
- Rename ESM bundles from `.js` to `.mjs` for Node 20 compatibility — `child_process.fork()` now correctly treats server and worker as ESM
|
|
86
|
-
- Move `@modelcontextprotocol/sdk` and `zod` from `dependencies` to `devDependencies` — they are fully bundled by esbuild and not needed at runtime
|
|
87
|
-
- Guard `postinstall` script with `[ -f tsconfig.json ]` so it only runs in dev checkout, not in consumer installs
|
|
88
|
-
|
|
89
|
-
## [0.1.2]
|
|
90
|
-
|
|
91
|
-
### Added
|
|
92
|
-
|
|
93
|
-
- Release checklist (`.github/RELEASE_CHECKLIST.md`)
|
|
94
|
-
|
|
95
|
-
### Fixed
|
|
96
|
-
|
|
97
|
-
- Remove unused `antlr4-c3` dependency from server package
|
|
98
|
-
- Fix client extension server path to use bundled `dist/` output (VSIX was broken)
|
|
99
|
-
- Fix `postinstall` script silently swallowing server install failures
|
|
100
|
-
- Sync versions across `server/package.json`, `client/package.json`, and MCP server to `0.1.1`
|
|
101
|
-
- Align Node engine requirement to `>=20` in `server/package.json` (was `>=18`)
|
|
102
|
-
- Update esbuild target from `node18` to `node20`
|
|
103
|
-
- Add `*.tgz` to `.gitignore` to prevent accidental commits
|
|
104
|
-
- Add explicit `require`/`default` conditions to `exports` field
|
|
105
|
-
- Remove redundant `activationEvents` (auto-generated from `contributes.languages`)
|
|
106
|
-
|
|
107
|
-
## [0.1.1]
|
|
108
|
-
|
|
109
|
-
### Fixed
|
|
110
|
-
|
|
111
|
-
- Update postinstall script to handle missing `client` directory gracefully
|
|
112
|
-
- Add npm trusted publishing (OIDC) support and normalize repository URL
|
|
113
|
-
- Remove accidentally committed `.tgz` archive
|
|
114
|
-
- Skip `npm version` in release workflow when git tag already matches `package.json`
|
|
115
|
-
- Drop Node 18 from CI matrix (Vite 7 requires Node 20+)
|
|
77
|
+
- Go-to-definition falls back to standard library for unresolved symbols
|
|
78
|
+
- Recursive type name extraction in symbol table
|
|
79
|
+
- Synthetic `start`/`done` nodes in activity diagram flows
|
|
80
|
+
- Element kind enum expanded to 55 kinds
|
|
81
|
+
- esbuild bundles four targets: server, worker, MCP server, VS Code client
|
|
116
82
|
|
|
117
83
|
## [0.1.0]
|
|
118
84
|
|
package/README.md
CHANGED
|
@@ -1,288 +1,110 @@
|
|
|
1
1
|
# SysML v2 Language Server
|
|
2
2
|
|
|
3
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://socket.dev/npm/package/sysml-v2-lsp)
|
|
3
|
+
[](https://www.npmjs.com/package/sysml-v2-lsp)
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[](https://marketplace.visualstudio.com/items?itemName=JamieD.sysml-v2-support)
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
A [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) implementation for [SysML v2](https://www.omgsysml.org/SysML-2.htm).
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## Features
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
| Feature | Status | Description |
|
|
12
|
+
| ----------------------- | ------ | -------------------------------------------------------- |
|
|
13
|
+
| **Diagnostics** | ✅ | Syntax error reporting with red squiggles |
|
|
14
|
+
| **Document Symbols** | ✅ | Outline panel with SysML model structure |
|
|
15
|
+
| **Hover** | ✅ | Element kind, type, and documentation on hover |
|
|
16
|
+
| **Go to Definition** | ✅ | Ctrl+Click navigation to declarations |
|
|
17
|
+
| **Find References** | ✅ | Find all usages of a symbol |
|
|
18
|
+
| **Code Completion** | ✅ | Keywords, snippets, and symbol suggestions |
|
|
19
|
+
| **Semantic Tokens** | ✅ | Rich, context-aware syntax highlighting |
|
|
20
|
+
| **Folding Ranges** | ✅ | Collapsible `{ }` blocks and comments |
|
|
21
|
+
| **Rename** | ✅ | Rename symbol and all references |
|
|
22
|
+
| **Semantic Validation** | ✅ | Unresolved types, invalid multiplicity, duplicates |
|
|
23
|
+
| **Code Actions** | ✅ | Quick-fixes: naming, doc stubs, empty enums, unused defs |
|
|
24
|
+
| **Complexity Analysis** | ✅ | Structural metrics, composite index, hotspot detection |
|
|
25
|
+
| **Mermaid Preview** | ✅ | 6 diagram types with auto-detect, focus, and diff modes |
|
|
26
|
+
| **MCP Server** | ✅ | AI-assisted modelling via `sysml-mcp` CLI |
|
|
14
27
|
|
|
15
|
-
##
|
|
28
|
+
## Quick Start
|
|
16
29
|
|
|
17
|
-
|
|
30
|
+
### Install from Marketplace
|
|
18
31
|
|
|
19
|
-
|
|
32
|
+
Install via the VS Code extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=JamieD.sysml-v2-support).
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
| -------------------- | ---------------------------------------------------------------------- |
|
|
23
|
-
| **Diagnostics** | Syntax errors, unknown identifiers, keyword typos with severity levels |
|
|
24
|
-
| **Code Completion** | Keywords, snippets, and symbol suggestions with documentation |
|
|
25
|
-
| **Signature Help** | Parameter tooltips when invoking `action def` / `calc def` |
|
|
26
|
-
| **Hover** | Element kind, type, qualified name, and documentation |
|
|
27
|
-
| **Go to Definition** | Jump to a symbol's declaration |
|
|
28
|
-
| **Find References** | Find all usages of a symbol across open files |
|
|
29
|
-
| **Rename Symbol** | Rename a symbol and update all references |
|
|
30
|
-
| **Linked Editing** | Edit a name and all same-scope occurrences update simultaneously |
|
|
31
|
-
| **Document Links** | Clickable `import` paths — jump to the imported namespace |
|
|
34
|
+
### Dev Container (recommended)
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
Open in GitHub Codespaces or VS Code Dev Containers — everything is pre-installed.
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
| --------------------- | ------------------------------------------------------------------------ |
|
|
37
|
-
| **CodeLens** | Reference counts shown above each definition |
|
|
38
|
-
| **Inlay Hints** | Ghost text showing inferred types (`: Type`) and supertypes (`:> Super`) |
|
|
39
|
-
| **Type Hierarchy** | Navigate specialization chains — supertypes and subtypes |
|
|
40
|
-
| **Call Hierarchy** | Navigate `perform`/`include` chains between actions |
|
|
41
|
-
| **Workspace Symbols** | Fuzzy search for any definition across all open files |
|
|
42
|
-
|
|
43
|
-
### Presentation & Formatting
|
|
44
|
-
|
|
45
|
-
| Feature | Description |
|
|
46
|
-
| -------------------- | ------------------------------------------------------------------------------ |
|
|
47
|
-
| **Semantic Tokens** | Rich, context-aware syntax highlighting (definitions, usages, keywords, types) |
|
|
48
|
-
| **Document Symbols** | Outline / breadcrumbs showing SysML model structure |
|
|
49
|
-
| **Folding Ranges** | Collapsible `{ }` blocks and comment regions |
|
|
50
|
-
| **Selection Ranges** | Smart expand/shrink selection (word → line → block → enclosing block) |
|
|
51
|
-
| **Quick Fix** | Fix keyword typos (e.g., `paart` → `part`) |
|
|
52
|
-
| **Formatting** | Auto-indent, normalize braces, trim trailing whitespace |
|
|
53
|
-
|
|
54
|
-
### Parser
|
|
55
|
-
|
|
56
|
-
- ANTLR4-based parser via [antlr4ng](https://github.com/mike-lischke/antlr4ng)
|
|
57
|
-
- SLL/LL dual-mode strategy — fast path with automatic fallback
|
|
58
|
-
- DFA warm-up for near-instant first-parse performance
|
|
59
|
-
- Worker thread architecture for non-blocking document processing
|
|
60
|
-
- Symbol table with qualified name resolution and cross-file references
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## MCP Server (AI Integration)
|
|
65
|
-
|
|
66
|
-
A standalone [Model Context Protocol](https://modelcontextprotocol.io/) server that lets AI assistants parse, validate, and query SysML v2 models. Runs independently of any editor.
|
|
67
|
-
|
|
68
|
-
### Tools
|
|
69
|
-
|
|
70
|
-
| Tool | Description |
|
|
71
|
-
| ----------------- | ------------------------------------------------------ |
|
|
72
|
-
| `parse` | Parse SysML source, build symbol table, return summary |
|
|
73
|
-
| `validate` | Check syntax and return errors |
|
|
74
|
-
| `getSymbols` | List symbols (filter by kind, URI, definitions/usages) |
|
|
75
|
-
| `getDefinition` | Look up a symbol by name or qualified name |
|
|
76
|
-
| `getReferences` | Find all references to a symbol |
|
|
77
|
-
| `getHierarchy` | Get parent–child containment structure |
|
|
78
|
-
| `getModelSummary` | Counts, kinds, and loaded documents |
|
|
79
|
-
|
|
80
|
-
### Resources
|
|
81
|
-
|
|
82
|
-
| URI | Description |
|
|
83
|
-
| -------------------------- | ---------------------------- |
|
|
84
|
-
| `sysml://element-kinds` | All recognised element kinds |
|
|
85
|
-
| `sysml://keywords` | Complete keyword list |
|
|
86
|
-
| `sysml://grammar-overview` | Language structure reference |
|
|
87
|
-
|
|
88
|
-
### Prompts
|
|
89
|
-
|
|
90
|
-
| Prompt | Description |
|
|
91
|
-
| ----------------- | ------------------------------------ |
|
|
92
|
-
| `review-sysml` | Review a SysML model for correctness |
|
|
93
|
-
| `explain-element` | Explain a SysML element kind |
|
|
94
|
-
| `generate-sysml` | Generate SysML from a description |
|
|
95
|
-
|
|
96
|
-
### MCP Setup
|
|
97
|
-
|
|
98
|
-
**VS Code / GitHub Copilot** — The workspace includes `.vscode/mcp.json`, so the MCP server is automatically available after building.
|
|
99
|
-
|
|
100
|
-
**Claude Desktop** — Add to `claude_desktop_config.json`:
|
|
101
|
-
|
|
102
|
-
```json
|
|
103
|
-
{
|
|
104
|
-
"mcpServers": {
|
|
105
|
-
"sysml-v2": {
|
|
106
|
-
"command": "node",
|
|
107
|
-
"args": ["/path/to/sysml-v2-lsp/dist/server/mcpServer.mjs"]
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**Any MCP client** — Run the server directly via stdio:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
npx sysml-v2-lsp # after npm install -g sysml-v2-lsp
|
|
117
|
-
# or
|
|
118
|
-
node dist/server/mcpServer.mjs
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Quick Test Examples
|
|
122
|
-
|
|
123
|
-
Once the MCP server is connected, try these prompts:
|
|
124
|
-
|
|
125
|
-
> Parse this: `package Demo { part def Vehicle { attribute speed : Real; } part car : Vehicle; }`
|
|
126
|
-
|
|
127
|
-
> Validate this: `part def Broken { attribute x :`
|
|
128
|
-
|
|
129
|
-
> What symbols are in the model?
|
|
130
|
-
|
|
131
|
-
> Find the definition of Vehicle
|
|
132
|
-
|
|
133
|
-
> Show the hierarchy of car
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## VS Code Dev Extension
|
|
138
|
-
|
|
139
|
-
A lightweight VS Code extension is included for **development and debugging** of the language server. It registers the `sysml` language ID, starts the LSP client, and provides a restart command — nothing more.
|
|
140
|
-
|
|
141
|
-
For the full VS Code experience (TextMate grammar, snippets, language configuration, visualization), see [daltskin/VSCode_SysML_Extension](https://github.com/daltskin/VSCode_SysML_Extension).
|
|
142
|
-
|
|
143
|
-
| Feature | Description |
|
|
144
|
-
| ------------------------ | ------------------------------------------------------------------------------ |
|
|
145
|
-
| **Language Registration**| Registers `.sysml` / `.kerml` file types |
|
|
146
|
-
| **LSP Client** | Starts and manages the language server process |
|
|
147
|
-
| **Restart Command** | `SysML: Restart Language Server` command |
|
|
148
|
-
| **Dev Container** | Open in GitHub Codespaces or VS Code Dev Containers — everything pre-installed |
|
|
149
|
-
| **Debug Configurations** | "Client + Server" compound launch for simultaneous debugging |
|
|
150
|
-
| **Example Files** | `examples/` folder with camera, toaster, and vehicle models |
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## Getting Started
|
|
155
|
-
|
|
156
|
-
### Using the VS Code Extension
|
|
157
|
-
|
|
158
|
-
Open in GitHub Codespaces or Dev Containers (recommended), or manually:
|
|
38
|
+
### Manual Setup
|
|
159
39
|
|
|
160
40
|
```bash
|
|
41
|
+
# Install dependencies
|
|
161
42
|
npm install
|
|
162
|
-
npm run build
|
|
163
|
-
# Press F5 to launch the Extension Development Host
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Using the LSP with Other Editors
|
|
167
|
-
|
|
168
|
-
Build the server, then point your editor's LSP client at it:
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
npm install && npm run build
|
|
172
|
-
# Server binary: dist/server/server.mjs
|
|
173
|
-
# Start with: node dist/server/server.mjs --stdio
|
|
174
|
-
```
|
|
175
43
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```lua
|
|
179
|
-
vim.lsp.start({
|
|
180
|
-
name = 'sysml',
|
|
181
|
-
cmd = { 'node', '/path/to/sysml-v2-lsp/dist/server/server.mjs', '--stdio' },
|
|
182
|
-
filetypes = { 'sysml' },
|
|
183
|
-
})
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
**Emacs** (via [lsp-mode](https://github.com/emacs-lsp/lsp-mode)):
|
|
44
|
+
# Build
|
|
45
|
+
npm run build
|
|
187
46
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
(make-lsp-client
|
|
191
|
-
:new-connection (lsp-stdio-connection
|
|
192
|
-
'("node" "/path/to/sysml-v2-lsp/dist/server/server.mjs" "--stdio"))
|
|
193
|
-
:activation-fn (lsp-activate-on "sysml")
|
|
194
|
-
:server-id 'sysml-lsp))
|
|
47
|
+
# Run tests
|
|
48
|
+
npm test
|
|
195
49
|
```
|
|
196
50
|
|
|
197
|
-
|
|
51
|
+
### Development
|
|
198
52
|
|
|
199
53
|
```bash
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
python3 sysml_lsp_client.py ../../examples/vehicle-model.sysml # specific file
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
This demonstrates that the same LSP server used by VS Code can be driven from
|
|
206
|
-
any language — see the [Python client README](clients/python/README.md) for details.
|
|
207
|
-
|
|
208
|
-
### Using the MCP Server
|
|
54
|
+
# Watch mode — recompiles on file changes
|
|
55
|
+
npm run watch
|
|
209
56
|
|
|
210
|
-
|
|
211
|
-
npm install && npm run build
|
|
212
|
-
node dist/server/mcpServer.mjs # stdio transport
|
|
57
|
+
# Then press F5 in VS Code to launch the extension + server
|
|
213
58
|
```
|
|
214
59
|
|
|
215
|
-
|
|
60
|
+
Use the **"Client + Server"** compound debug configuration to debug both sides simultaneously.
|
|
216
61
|
|
|
217
62
|
## Architecture
|
|
218
63
|
|
|
219
64
|
```
|
|
220
|
-
|
|
221
|
-
│
|
|
222
|
-
│
|
|
223
|
-
|
|
224
|
-
│
|
|
225
|
-
│
|
|
226
|
-
│
|
|
227
|
-
│
|
|
228
|
-
│
|
|
229
|
-
│
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
┌────────────┴────────────┐ │
|
|
233
|
-
│ Any Editor │ │
|
|
234
|
-
│ VS Code, Neovim, │ │
|
|
235
|
-
│ Emacs, Sublime, ... │ │
|
|
236
|
-
└─────────────────────────┘ │
|
|
237
|
-
│
|
|
238
|
-
┌──────────────────────────────────────────────────┴──────────────┐
|
|
239
|
-
│ MCP Server (standalone) │
|
|
240
|
-
│ 7 tools · 3 resources · 3 prompts · stdio transport │
|
|
241
|
-
│ │
|
|
242
|
-
│ ┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐ │
|
|
243
|
-
│ │ Claude, Copilot│ │ Cursor, Windsurf│ │ Any MCP Client │ │
|
|
244
|
-
│ └─────────────────┘ └──────────────────┘ └──────────────────┘ │
|
|
245
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
65
|
+
┌──────────────────────┐ IPC ┌──────────────────────────┐
|
|
66
|
+
│ VS Code Extension │ ◄─────────► │ Language Server │
|
|
67
|
+
│ (Language Client) │ │ (Separate Process) │
|
|
68
|
+
├──────────────────────┤ ├──────────────────────────┤
|
|
69
|
+
│ • Starts server │ │ • Parser │
|
|
70
|
+
│ • Registers language │ │ • Diagnostics │
|
|
71
|
+
│ │ │ • Completion (keywords) │
|
|
72
|
+
│ │ │ • Symbols / hover │
|
|
73
|
+
│ │ │ • Go-to-def / references │
|
|
74
|
+
│ │ │ • Semantic tokens │
|
|
75
|
+
│ │ │ • Rename / folding │
|
|
76
|
+
└──────────────────────┘ └──────────────────────────┘
|
|
246
77
|
```
|
|
247
78
|
|
|
248
79
|
### Project Structure
|
|
249
80
|
|
|
250
81
|
```
|
|
251
82
|
sysml-v2-lsp/
|
|
252
|
-
├──
|
|
83
|
+
├── client/ # VS Code Language Client extension
|
|
84
|
+
│ └── src/extension.ts # Starts LanguageClient, connects to server
|
|
85
|
+
├── server/ # Language Server (runs in separate process)
|
|
253
86
|
│ └── src/
|
|
254
|
-
│ ├── server.ts
|
|
255
|
-
│ ├── mcpServer.ts # MCP server entry point (stdio)
|
|
256
|
-
│ ├── mcpCore.ts # MCP handler logic (testable)
|
|
87
|
+
│ ├── server.ts # LSP connection, capability registration
|
|
257
88
|
│ ├── documentManager.ts # Parse cache, document lifecycle
|
|
258
|
-
│ ├── parser/
|
|
259
|
-
│ ├── symbols/
|
|
260
|
-
│
|
|
261
|
-
├──
|
|
262
|
-
│
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
│ └── sysml_lsp_client.py
|
|
266
|
-
├── grammar/ # ANTLR4 grammar files (.g4)
|
|
267
|
-
├── examples/ # Sample SysML models
|
|
268
|
-
├── test/ # Unit tests (vitest)
|
|
89
|
+
│ ├── parser/ # Parse pipeline
|
|
90
|
+
│ ├── symbols/ # Symbol table, scopes, element types
|
|
91
|
+
│ ├── providers/ # LSP feature implementations
|
|
92
|
+
│ ├── analysis/ # Complexity analyzer
|
|
93
|
+
│ └── mcp/ # Mermaid diagram generator
|
|
94
|
+
├── grammar/ # Grammar files (.g4)
|
|
95
|
+
├── test/ # Unit tests (vitest) + E2E tests
|
|
269
96
|
└── package.json # Extension manifest + monorepo scripts
|
|
270
97
|
```
|
|
271
98
|
|
|
272
|
-
|
|
99
|
+
## Grammar Updates
|
|
273
100
|
|
|
274
|
-
|
|
101
|
+
The grammar files in `grammar/` are sourced from [daltskin/sysml-v2-grammar](https://github.com/daltskin/sysml-v2-grammar). To pull the latest version:
|
|
275
102
|
|
|
276
103
|
```bash
|
|
277
|
-
npm
|
|
278
|
-
npm run generate # Generate TypeScript parser from ANTLR4 grammar
|
|
279
|
-
npm run build # Compile + bundle (esbuild)
|
|
280
|
-
npm run watch # Watch mode — recompiles on changes
|
|
281
|
-
npm test # Run 88 unit tests (vitest)
|
|
282
|
-
npm run lint # ESLint
|
|
104
|
+
npm run update-grammar
|
|
283
105
|
```
|
|
284
106
|
|
|
285
|
-
|
|
107
|
+
## Available Commands
|
|
286
108
|
|
|
287
109
|
```bash
|
|
288
110
|
make install # Install all dependencies
|
|
@@ -292,37 +114,25 @@ make watch # Watch mode
|
|
|
292
114
|
make test # Run unit tests
|
|
293
115
|
make lint # ESLint
|
|
294
116
|
make package # Build .vsix
|
|
295
|
-
make package-server # Build npm tarball
|
|
296
117
|
make update-grammar # Pull latest grammar from upstream
|
|
297
118
|
make ci # Full CI pipeline
|
|
298
119
|
```
|
|
299
120
|
|
|
300
|
-
### Grammar Updates
|
|
301
|
-
|
|
302
|
-
The grammar files in `grammar/` are sourced from [daltskin/sysml-v2-grammar](https://github.com/daltskin/sysml-v2-grammar). To pull the latest:
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
npm run update-grammar && npm run generate
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
---
|
|
309
|
-
|
|
310
121
|
## Technology Stack
|
|
311
122
|
|
|
312
|
-
| Component | Technology
|
|
313
|
-
| --------- |
|
|
314
|
-
| Language | TypeScript (strict mode)
|
|
315
|
-
| Runtime | Node.js ≥
|
|
316
|
-
| Parser |
|
|
317
|
-
| Generator | [antlr-ng](https://github.com/nicklockwood/antlr-ng)
|
|
318
|
-
| LSP | [vscode-languageserver](https://github.com/microsoft/vscode-languageserver-node)
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
| Tests | vitest |
|
|
123
|
+
| Component | Technology |
|
|
124
|
+
| --------- | -------------------------------------------------------------------------------- |
|
|
125
|
+
| Language | TypeScript (strict mode) |
|
|
126
|
+
| Runtime | Node.js ≥ 18 |
|
|
127
|
+
| Parser | [antlr4ng](https://github.com/mike-lischke/antlr4ng) |
|
|
128
|
+
| Generator | [antlr-ng](https://github.com/nicklockwood/antlr-ng) |
|
|
129
|
+
| LSP | [vscode-languageserver](https://github.com/microsoft/vscode-languageserver-node) |
|
|
130
|
+
| Bundler | esbuild |
|
|
131
|
+
| Tests | vitest |
|
|
322
132
|
|
|
323
133
|
## Related Projects
|
|
324
134
|
|
|
325
|
-
- [daltskin/sysml-v2-grammar](https://github.com/daltskin/sysml-v2-grammar) —
|
|
135
|
+
- [daltskin/sysml-v2-grammar](https://github.com/daltskin/sysml-v2-grammar) — Grammar for SysML v2
|
|
326
136
|
- [daltskin/VSCode_SysML_Extension](https://github.com/daltskin/VSCode_SysML_Extension) — VS Code extension with visualization
|
|
327
137
|
- [OMG SysML v2 Specification](https://github.com/Systems-Modeling/SysML-v2-Release)
|
|
328
138
|
|