Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds small guide on how to start the LS in IntelliJ (to debug it) #253

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/developer/developer-intellij-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kbd>LanguageDiagramServer</kbd> available, which executes the main method the `LanguageDiagramServer` class, which, as a result, starts the language server.
edwardalee marked this conversation as resolved.
Show resolved Hide resolved

![](./../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 <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.
Loading