Editor-agnostic, state-of-the-art syntax support for SysML v2 textual notation. Provides contextual syntax highlighting of keywords, auto-completion, navigation between usages and definitions, error reporting, and hints.
This tool build's on Microsoft's Language Server Protocol (LSP), a protocol that's used between an editor or IDE and a language server that provides language features like auto complete, go to definition, find all references etc. Our language server is automatically generated from our SysML v2 language implementation via the MontiCore Language Server Generator (MCLSG).
Compared to the pilot implementation's syntax support, our implementation
- is editor-agnostic, i.e., any editor supporting the Language Server Protocol can connect to our server to provide rich syntax support.
- provides a single implementation usable across different editor, no need for re-implementation for each editor/IDE.
- enabled the most advanced analytics, contextual highlighting, expression support, and is fully extendable. No need to define non-contextual keyword-lists or give up go-to-definition and contextual hints.
You can use our language server with any LSP-compatible editor or IDE. Try out installing our integrated VSCode Plugin to get going the fastest:
- Download the latest version
- Install by simply dragging the downloaded VSIX-file into the extensions view in VSCode
- Done! Now create or open a text file with the ending
.sysml:
Find [known issues][issues] and more explanations on [how to develop for this project here][devs].
| Method | does it work? | notes |
|---|---|---|
| Installing the plugin and running it alone | yes | Works as intended |
| Running the plugin alone without installing it | yes | Works as intended |
| Installing the plugin and running the server seperately | no | Even if set to connect to an already running server the client will always try to start its own server. |
| Running the plugin and server seperately without installing the plugin | only with workarounds | The client can be forced to connect to an already running server with an environment variable |
| Executing the gradle task 'runSysMLv2VscodePluginAttached' | no | Current theory is that the client is started before the server is ready and then fails to connect properly. (only a guess. further insight is required.) |
The client always tries to start its own server even when a server is already running, making it impossible to run the server seperately. The plugin provides a setting option that should make the client try to connect to an existing server however this does not work. What does work is setting the environment variable 'SYSMLV2_LSP_PORT' to the port on which the server is running. This forces the client to connect however it doesnt provide the flexibility the plugin should normally possess.
- Install NPM and add it to
$PATH. - Install the SysMLv2 VSCode plugin
- Execute the Gradle-Task 'buildSysmlv2VscodePlugin' in the
othercategory. (the gradle Task 'generateSysmlv2VscodePlugin' in themc-lspcategory will not work) - Execute the Gradle-Task 'packageSysmlv2VscodePlugin' in the
othercategory.
- In the Folder "sysmlv2\language-server\target\generated-sources\SysMLv2\plugins\sysmlv2-vscode-plugin" you should now find a .vsix file.
- Install it by opening VS Code, navigating to the extension tab,
Views and further actions(three dots), and selecting the entry to load the VSIX.
- Close VSCode.
- Make sure no language server is currently running (to do this in windows open the Task-Manager and terminate all task called
Java(TM) Platform SEshould there be any running). - Now Start VSCode and open a sysml file. After a few seconds the editor should display syntax highlighting.
- Install NPM and add it to
$PATH. - Generate the VSCode plugin by executing the Gradle-Task 'buildSysmlv2VscodePlugin' in the
othercategory. (the gradle Task 'generateSysmlv2VscodePlugin' in themc-lspcategory will not work) - (This step is only necessary due to a bug.) In the file
sysmlv2\language-server\target\generated-sources\SysMLv2\plugins\sysmlv2-vscode-plugin\.vscode\launch.jsonadd the line"env": {"SYSMLV2_LSP_PORT": "3000"}
- Start the
LanguageServerCLIwith parameters--socket -port 3000.
- Adapting the run configuration using IntelliJ Idea:
- Navigate to the
LanguageServerCLI, right-click on the main method > "Run.../Debug..." - Stop the running process again
- Edit the run configuration ("Run" > "Edit Configurations") that was just created
- Add
--socket -port 3000to the CLI arguments textbox - Apply and run/debug from IntelliJ's main window
- Navigate to the
- Open VSCode and open the folder
sysmlv2\language-server\target\generated-sources\SysMLv2\plugins\sysmlv2-vscode-plugin\ - Run/Debug the Plug-in in VSCode and open a sysml file in the new window opening up.
- After a few seconds the editor should display syntax highlighting.
- If the language server functionality fails, restart and/or reopen the sysml files and check the debugging information of the language server.
- When running the Server fails and java throws the exception
Address already in use: NET_Bindthen there is likely already a server running. You can kill it in the task-manager by ending all tasks namedJava(TM) Platform SE.
