Lingua Franca support for Visual Studio Code

This extension adds language support for developing Lingua Franca (LF) in VS Code and compatible tools such as Cursor.
Automatic Diagram Synthesis
Using KlighD, interactive diagrams are automatically generated while you edit your LF programs. You can also manually request a diagram update by clicking on the diagram icon:
.
Lingua Franca Package Explorer
Click on the LF icon in the Activity Bar on the left in VS Code (or in the menu in the left sidebar in Cursor) to access the Lingua Franca Package Explorer.
This will open a tree view, showing:
- Installed Packages—library packages installed via the Lingo package manager;
- Local Libraries—unpublished libraries located in
./src/lib
within your project; and
- Source Files—all
.lf
source files located in the ./src
folder or in subfolders.
Other features
- find references to symbols
- folding ranges
- get workspace symbols
- hover
- syntax highlighting
- target syntax highlighting
- code validation upon edit
- target code validation upon build or file save
- user-triggered build (Ctrl + Shift + P, then
Lingua Franca: Build
)
- user-triggered build and run (run button or Ctrl + Shift + P, then
Lingua Franca: Build and Run
)
Quick Start
- Install this plugin from the VSCode
Marketplace/Open VSX Registry
(in the command palette Ctrl + P, enter
ext install lf-lang.vscode-lingua-franca
)
- (Skip this step if you already have Lingua Franca projects that you'd like
to work on.) Create a new Lingua Franca project by creating a
<My Project Name>/src
folder and putting a file in it that has the .lf
extension.
- Open a Lingua Franca project (
File > Add Folder to Workspace...
). The Explorer (upper left in sidebar) should now show your project files. Open the .lf
file you created.
- (Optional) Show the diagram for this file by clicking on the diagrams icon at the upper right:
)
- Compile the
.lf
file and run it using the run button at the top or by typing (Ctrl + Shift + P, then Lingua Franca: Build and Run
).
Requirements
This extension requires Java 17 or up in order to run its embedded Lingua Franca language server. You might need to install additional software to be able to build or execute target code produced by the Lingua Franca compiler. The extension reports missing dependencies upon attempting to build or run.
Settings
To configure automatic code generation, add the following to .vscode/settings.json
with either true or false to generate code on save:
{
"linguafranca.generateCodeOnSave": false
}
For Developers and Contributors
See Contributing for hints on modifying this extension.
We very much appreciate contributions in the form of
pull requests for code, tests, and documentation, as well as bug reports and feature requests.
Join us!
Configuration
Diagrams
To enable diagram-based code navigation, go to Settings > Extensions > KLighD Diagram
and deactivate Initial Should Select Diagram
and activate Initial Should Select Text
instead.