Skip to content

About

Odin Support plugin for JetBrains IDEs

Topics

Resources

Contributing

Stars

146 stars

Watchers

4 watching

Forks

Repository files navigation

Odin Support for IntelliJ

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.

Compatibility with JetBrains Products

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).

** Full auto-completion features added for "Rider" in plugin version >= 0.12.0. Rider >= 2025.2 no longer supports debugging

Getting Started

To begin, ensure you have installed the plugin using the steps mentioned above.

Toolchain Setup

Download the Odin SDK here or build it from source by following the instructions on the official Odin Install page.

Toolchains are configured once at the application level and can be reused across multiple projects. A toolchain contains the Odin compiler, libraries, and optional debugger configuration.

Add a Toolchain

  1. Open the IDE settings and navigate to Languages & Frameworks > Odin > Odin Toolchains.
  2. Click Add and give the toolchain a descriptive name.
  3. Set Odin executable to the odin executable (odin.exe on Windows).
  4. Set Odin libraries to the Odin SDK directory that contains the base, core, and vendor collections.
  5. Optionally select and configure a debugger.
  6. Click Apply to save the toolchain.

Odin toolchain configuration

Creating a New Project

Important

Rider does not support creating new projects. If you're using Rider, create a new empty solution and manually add a folder for your Odin "project."

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

Importing a Project from Existing Sources

Warning

If you open an Odin project created with an IDE other than Rider in Rider, you may encounter unexpected behavior related to source and collection roots. You can still open such projects in Rider, but first, unmark all source and collection roots in a non-Rider IDE to avoid issues.

If you are importing an existing Odin project, refer to the Advanced Settings section below for additional configuration steps.

Project Settings

After adding a toolchain, assign it to the project:

  1. Open the IDE settings and navigate to Languages & Frameworks > Odin > Project Settings.
  2. Select the desired Toolchain. You can also click Add... to create one without leaving the project settings.
  3. Optionally set Checker arguments. These command-line arguments control the warnings and errors displayed in the editor. Run odin check --help for a list of available options.
  4. Click Apply.

Selecting an Odin toolchain in the project settings

Note

Existing project-level SDK and debugger settings are migrated to a reusable toolchain when the project is first opened after upgrading. Check the selected toolchain if the project does not open or behave as expected after the upgrade.

Debugger Settings

Debugger support is available in IntelliJ IDEA Ultimate, GoLand, CLion, PyCharm Professional, and RustRover. If debugger options are not available for your toolchain, install the Native Debugging Support plugin from the JetBrains marketplace.

Warning

If the Native Debugging Support plugin is not available in the marketplace for your IDE, that IDE does not support debugging with the Odin plugin. Refer to the compatibility table to see which IDEs support debugging.

Debugger installations are managed under Languages & Frameworks > Odin > Debuggers. Reusable toolchains combine one managed Odin SDK with one managed debugger under Languages & Frameworks > Odin > Toolchains. Changing a toolchain applies to every project using it.

Odin toolchain debugger configuration

The following sections outline the setup for various debuggers.

LLDB-DAP

To set up LLDB-DAP:

  1. Download the LLVM 18.1.x binaries for your platform
  2. In Debuggers, add LLDB-DAP and choose the lldb-dap executable from the bin directory.
  3. Select that debugger in the appropriate Toolchain.

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 LLVM bin directory.

Windows Debugger

To set up the Windows debugger, click the Download button. Once the download completes, the path to the debugger will be configured automatically.

LLDB (Linux and macOS Only)

On Linux and macOS, LLDB works out-of-the-box without additional configuration.

Advanced Settings

To unlock the full feature set of this plugin, you must configure Source Directories (mandatory) and Collection Directories (optional).

Source Directories

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:

  1. Right-click the directory in the project view.
  2. Select Mark Directory as > Odin Sources Root.

Mark Directory as 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.

Collection Directories

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.

Mark Directory as Sources 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.

Rename a collection

In the project view, the collection name will appear next to the directory:

Result of renaming a collection

Import Settings from ols.json

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:

  1. Right-clicking the ols.json file.
  2. Selecting Import OLS Config.

Example:

Import Ols config

After the import, settings like checker arguments (checker_args), checker paths (checker_paths), and collections will be applied to your IntelliJ project.

Result of importing Ols Config

Code Regions

You can define foldable code regions in Odin source files using line comments:

//region Initialization
// Your code here
//endregion

Everything between //region and //endregion is treated as a single foldable block by the IDE, as long as they don't overlap with other folding regions, such as structs, enums, if-blocks etc. In that case, the latter will take precedence.

The text following //region is used as the region name.

  • Region markers must use line comments (//).
  • Regions may span any number of lines.
  • Nested regions are supported if properly balanced.
  • Code regions affect editor folding only and have no impact on compilation or runtime behavior.

Resources

Odin Language

Odin is under continuous development. Stay updated with the latest news and features on the Odin Website.

Grammar

While creating the BNF rules for Odin, inspiration was drawn from the Go programming language.

For more details on using JetBrain's Grammar-Kit to create custom language plugins, refer to the official Grammar-Kit documentation.

Important Note

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.

About

Odin Support plugin for JetBrains IDEs

Topics

Resources

Contributing

Stars

146 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages