A standalone LSP server for SysMLv2 and KerML files, wrapping the OMG SysML-v2-Pilot-Implementation parser. Usable with any LSP-compatible editor.
sysmlv2-lsp-server.jar — pre-built fat JAR, ~30 MB. Requires Java 21+ (Eclipse Temurin).
No build needed — just download and point your editor at the JAR (see Quick Start below).
| LSP Feature | Status | Notes |
|---|---|---|
| Diagnostics | Working | Real-time validation with Standard Library resolution |
| Document Symbols | Working | Full symbol hierarchy (packages, parts, attributes) |
| Go to Definition | Working | Navigate to symbol definitions |
| Find References | Working | Find all usages of a symbol |
| Workspace Symbol Search | Working | Search symbols across entire workspace |
| Hover | Working | Metaclass, qualified name, type info, and doc comments |
| Completion | Working | Triggered on . |
| Go to Implementation | Not supported | Not applicable to SysML modeling |
| Call Hierarchy | Not supported | Not applicable to SysML modeling |
The SysMLv2 Standard Library is live-indexed at startup: the bundled
sysml.library is extracted and added as an Xtext workspace folder, so it is
parsed and linked the normal way. Implicit imports (Base, ScalarValues,
Integer, String, Boolean, etc.) and inherited / implicit-specialisation
features (Action::start, Action::done, ...) resolve correctly. The Pilot's
.index.json provides O(1) namespace lookups within that path. Cost: a one-time
~45–60 s indexing on server boot (run the server as a long-lived singleton so
this is paid once, not per session).
Why not a pre-computed startup snapshot? An earlier optimisation serialised the Xtext index to a binary file and loaded it in ~2 s. It stored only resource descriptions (exported names) — enough for plain name lookup but not for inherited-feature resolution, which needs the library resources to be real, linkable workspace resources. Result:
start/done(and other inherited members) silently failed to resolve. It was removed in favour of live indexing.Option B (future spike) — correct fast startup. If the boot cost must come down, snapshot the parsed+linked resources, not just names, via Xtext's binary resource storage (
StorageAwareResource/ResourceStorageFacade) and reload those. That preserves full model fidelity (so inheritance works) while skipping re-parse/re-link. Not yet implemented; needs a spike to confirm it actually restores inherited resolution.
Prerequisites: Java 21+ (Eclipse Temurin)
Download the latest release JAR, then:
claude --plugin-dir /path/to/sysmlv2-lsp
Claude Code will automatically start the LSP server when you open .sysml or .kerml files. The server takes ~15-30 seconds to start (Java + Standard Library indexing).
Add the following to your opencode.json (project-level) or ~/.config/opencode/opencode.json (global), and adjust the JAR path:
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"sysmlv2": {
"command": ["java", "-Xmx2g", "-jar", "/absolute/path/to/sysmlv2-lsp-server.jar"],
"extensions": [".sysml", ".kerml"]
}
}
}See the OpenCode LSP documentation for additional options (env, initialization, disabled).
java -Xmx2g -jar sysmlv2-lsp-server.jar
The server communicates via stdio (JSON-RPC/LSP). Add -trace for protocol message logging to stderr.
Only needed if you want to modify the server. End users can use the pre-built JAR.
Additional prerequisites: Maven 3.9+, Git with submodule support
# 1. Clone with submodules git clone --recurse-submodules <repo-url> cd sysmlv2-lsp # 2. Build the Pilot Implementation (10-20 min on first run) ./scripts/build-pilot.sh # 3. Extract JARs + Standard Library to server/lib/ ./scripts/extract-jars.sh # 4. Build the LSP server fat JAR cd server && ./gradlew shadowJar # Output: server/build/libs/sysmlv2-lsp-server.jar (~30 MB)
| Option | Description |
|---|---|
-Dsysml.library.skip=true |
Skip Standard Library loading (faster startup, no implicit imports) |
-Dsysml.library.path=/path/to/sysml.library |
Use external library directory |
SYSML_LIBRARY_PATH env var |
Alternative to system property |
-trace |
Log JSON-RPC messages to stderr |
Claude Code <── stdio/JSON-RPC ──> sysmlv2-lsp-server.jar
├─ KerMLExpressions (.kermlexpr)
├─ KerML (.kerml)
├─ SysML (.sysml)
├─ Standard Library (.index.json)
└─ Xtext 2.38.0 LSP framework
Three Xtext languages are registered via ServiceLoader (META-INF/services/org.eclipse.xtext.ISetup):
KerMLExpressionsIdeSetupCustomKerMLIdeSetup(adds hover documentation provider)CustomSysMLIdeSetup(adds hover documentation provider)
Key implementation details:
- Custom launcher captures
System.outbefore redirecting to prevent JSON-RPC stream corruption from Xtext log messages - EMF
SysMLPackageis explicitly registered (required in standalone mode; Eclipse usesplugin.xmlextension points) - Guice
ServerModuleis overridden to injectSysMLWorkspaceConfigFactoryfor Standard Library workspace folder injection PrecalculatedLibraryIndexProviderrequires library files under asysml.library/directory path segment to locate.index.json- Shadow JAR merges
META-INF/servicesfiles across all dependencies
MIT — see LICENSE.
The fat JAR bundles LGPL-3.0 (Pilot Implementation), EPL-2.0 (Xtext, LSP4J), and Apache-2.0 (Guice, Guava) dependencies. See NOTICE for details.