diff --git a/docs/assets/images/intellij/run_config_language_server.png b/docs/assets/images/intellij/run_config_language_server.png new file mode 100644 index 000000000..e3b456c9c Binary files /dev/null and b/docs/assets/images/intellij/run_config_language_server.png differ diff --git a/docs/developer/developer-intellij-setup.mdx b/docs/developer/developer-intellij-setup.mdx index c2db6bf68..2deaefb6f 100644 --- a/docs/developer/developer-intellij-setup.mdx +++ b/docs/developer/developer-intellij-setup.mdx @@ -69,6 +69,22 @@ While debugging, you can run code step-by-step by using the debugger tools. By clicking the play button, `lfc` will be invoked, and if compilation is successful, its output can be found, relative to package root of the file under compilation, in `bin` if the target is a compiled language (e.g., C) or in `src-gen` if the target is an interpreted language (e.g., TypeScript). For the `HelloWorld.lf` example above, the binary can be found in `test/Cpp/bin/HelloWorld` and can be executed in the terminal. +## Starting and Debugging the Language Server + +There should a predefined run configuration called LanguageDiagramServer available, which executes the main method the `LanguageDiagramServer` class, which, as a result, starts the language server. + +![](./../assets/images/intellij/run_config_language_server.png) + +Per default it uses the port `7670`. This port should be the same as the port specified by the vscode-lingua-franca extension in its [launch configuration](https://github.com/lf-lang/vscode-lingua-franca/blob/38515b4aa0de68383a88a0d4daf56cdb8c5b9b4c/.vscode/launch.json#L25). + +After start-up it should output the following: + +``` +Connection to: localhost:7670 +Starting language server socket +Language Server Socket ready! +``` + ## Integration Tests You can also run the integration test from IntelliJ. You will find the targetTest and singleTest tasks in the Gradle tab under org.lflang \> Tasks \> other. Make sure to add a run configuration as shown above and append `-Ptarget=...'` to the `targetTest` command or `-DsingleTest=...` to your `singleTest` command to specify the target (e.g., `C`) or the specific test that you would like to run.