This plugin provides support for the Odin programming language in IntelliJ IDEA. You can add the plugin to your JetBrains IDE via the "Plugin" settings panel or by visiting the Odin Plugin Page.
This table summarizes the features supported by the Odin IntelliJ Plugin across various JetBrains IDEs, including debugging, project creation, auto-completion, and free usage options.
Product | Debugging | Project creation | Full auto-completion features | Free non-commercial use |
---|---|---|---|---|
IntelliJ Community | ❌ | ✅ | ✅ | ✅ |
IntelliJ Ultimate | ✅* | ✅ | ✅ | ❌ |
GoLand | ✅* | ✅ | ✅ | ❌ |
Rider** | ✅ | ❌ | ❌ | ✅ |
CLion | ✅ | ✅ | ✅ | ❌ |
RustRover | ✅ | ✅ | ✅ | ✅ |
PyCharm Professional | ✅* | ✅ | ✅ | ❌ |
* Requires installing the free plugin "Native Debugging Support" (see section Debugger Settings).
** NOT RECOMMENDED: Rider differs significantly from other IDEs, and achieving full support may be challenging or require extensive effort.
To begin, ensure you have installed the plugin using the steps mentioned above.
Download the Odin SDK here or build it from source by following the instructions on the official Odin Install page.
Use the "New Project..." wizard in IntelliJ to create a blank Odin project. The default project structure will look like this:
| - bin
| - src
| -- main.odin
If you are importing an existing Odin project, refer to the Advanced Settings section below for additional configuration steps.
To configure the project:
- Open the settings panel and navigate to Languages & Frameworks > Odin.
- Set the following fields:
- Path to SDK: The location of the Odin SDK folder, where the Odin binary resides.
- Checker Arguments: Command-line arguments for the Odin checker. These arguments control the warnings and errors displayed in the editor. Run
odin checker --help
for a list of available options.
Debugger support is available in IntelliJ IDEA Ultimate, GoLand, CLion, PyCharm Professional, and RustRover. If you don't see the Debugger Settings section in the Odin settings, you need to install the Native Debugging Support plugin from the JetBrains marketplace.
Here’s an example of what the settings panel will look like when properly configured:
The following sections outline the setup for various debuggers.
To set up LLDB-DAP:
- Download the LLVM 18.1.x binaries for your platform.
- In the Odin settings page, select the
lldb-dap
executable from thebin
directory.
Important:
LLDB-DAP requires Python 3.10. Ensure Python 3.10 is installed and accessible by LLDB-DAP. On Windows, the easiest approach is to download the embeddable Python 3.10 package and extract its contents into the LLVMbin
directory.
To set up the Windows debugger, click the Download button. Once the download completes, the path to the debugger will be configured automatically.
On Linux and macOS, LLDB works out-of-the-box without additional configuration.
To unlock the full feature set of this plugin, you must configure Source Directories (mandatory) and Collection Directories (optional).
Source directories define the root of your project's source code. These settings are essential for code auto-completion and other IDE features. To mark a directory as a source root:
- Right-click the directory in the project view.
- Select Mark Directory as > Odin Sources Root.
This directory should contain your Odin file with the main
procedure and your package structure. You can have multiple source roots, but one source
root must not be a subdirectory of another.
Odin supports custom collections, which are comparable to library dependencies. To use packages within custom collections, you must mark the directory as a Collection Source Root.
After marking a directory as a Collection Source Root, you can reference the packages it contains using the collection’s name.
In the screenshot above, the collection name is the same as the directory name. However, you can rename the collection via the Rename Refactoring option, and the corresponding references in your code will update automatically.
In the project view, the collection name will appear next to the directory:
If you have previously used ols, you might have an ols.json
file containing your LSP settings. You can import
a subset of these settings into your IntelliJ project by:
- Right-clicking the
ols.json
file. - Selecting Import OLS Config.
Example:
After the import, settings like checker arguments (checker_args
), checker paths (checker_paths
), and collections will be applied to
your IntelliJ project.
We welcome contributions to improve the Odin IntelliJ Plugin! Follow the steps below to get started:
-
Fork this repository
Create your own copy of this repository by clicking the "Fork" button in the top-right corner of this page. -
Generate the Parser Code
Navigate to theOdin.bnf
file, right-click on it, and select "Generate Parser Code" or use the shortcutCtrl+Shift+G
. -
Generate the Lexer Code
Navigate to theOdin.flex
file, right-click on it, and select "Run JFlex Generator" or use the shortcutCtrl+Shift+G
.
That's it! You're now ready to start making contributions. Be sure to test your changes thoroughly before submitting a pull request. If you encounter any issues or have questions, feel free to open an issue in this repository.
Odin is under continuous development. Stay updated with the latest news and features on the Odin Website.
While creating the BNF rules for Odin, inspiration was drawn from the Go programming language.
- Go Language Resources:
For more details on using JetBrain's Grammar-Kit to create custom language plugins, refer to the official Grammar-Kit documentation.
This plugin is not an official Odin project. It is neither affiliated with nor endorsed by the Odin team. If you encounter issues with this plugin, please report them using the GitHub issue tracker for this repository, and not to the Odin team directly.