Fandango Language Server#
The Fandango project includes a simple language server that makes writing Fandango grammars significantly easier. Currently, it supports the following:
Autocomplete of nonterminals
Jump to definition of nonterminal
Find all references of nonterminal
Rename nonterminal
Create a definition for an undefined nonterminal
Initial Semantic Token support
Start the language server by running
python3 src/fandango/language/server/language_server.py
Visual Studio Code Extension#
A simple extension for Visual Studio Code (based on the one provided by the pygls
project) is provided in .vscode/extensions/fandango-language-server
. To compile it, run the following:
cd .vscode/extensions/fandango-language-server
npm install --no-save
npm run compile
You can then install it from the workspace-recommended extension section in the extension manager. For additional documentation, refer to .vscode/extensions/fandango-language-server/README.md
.
IntelliJ / Pycharm Code Extension#
To integrate the Fandango language server into IntelliJ or PyCharm, follow these steps:
Download and install the LSP4IJ plugin for IntelliJ / Pycharm.
Download the Fandango LSP4J Language Server configuration.
In your IDE, navigate to the
Language Servers
tab.Click the
+
button or right-click an empty area in the list to add a new language server.In the
Add New Language Server
popup:For
Template
, selectImport from custom template...
A file browser will appear. Select the previously downloaded language server configuration.
If necessary, adjust the command in the Server tab to ensure the correct Python executable is used (matching your desired Python version and virtual environment).