Skip to content

Commit 833e36f

Browse files
authored
Merge pull request #253 from soerendomroes/main
Adds small guide on how to start the LS in IntelliJ (to debug it)
2 parents 3d33bdf + 46b2e5d commit 833e36f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Loading

docs/developer/developer-intellij-setup.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ While debugging, you can run code step-by-step by using the debugger tools.
6969

7070
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.
7171

72+
## Starting and Debugging the Language Server
73+
74+
There should a predefined run configuration called <kbd>LanguageDiagramServer</kbd> available, which executes the main method the `LanguageDiagramServer` class, which, as a result, starts the language server.
75+
76+
![](./../assets/images/intellij/run_config_language_server.png)
77+
78+
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).
79+
80+
After start-up it should output the following:
81+
82+
```
83+
Connection to: localhost:7670
84+
Starting language server socket
85+
Language Server Socket ready!
86+
```
87+
7288
## Integration Tests
7389

7490
You can also run the integration test from IntelliJ. You will find the <kbd>targetTest</kbd> and <kbd>singleTest</kbd> tasks in the Gradle tab under <kbd>org.lflang \> Tasks \> other</kbd>. 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.

0 commit comments

Comments
 (0)