odoo-lsp

nightly

Features

Completion, definition and references of XML IDs

Works for records, templates and env.ref()

template inherit_id demo

Completion, definition and references of models

model demo

Browse models and XML records as workspace symbols

symbols demo

For more features check out the [wiki].

Install

shell cargo install --git https://github.com/Desdaemon/odoo-lsp

Nightly binaries are also available for some platforms, please check [Releases] for the latest downloads.

Setup

For usage instructions please check the [wiki] (work in progress).

VSCode

odoo-lsp is available from the Visual Studio Marketplace and the Open VSX Registry. Alternatively, you can grab the latest nightly builds from [Releases].

Helix

See .helix/languages.toml

  1. Ensure that you have odoo-lsp on your path (or define the SERVER_PATH environment variable pointing to one)
  2. Determine your Helix runtime folder, e.g. ~/.config/helix/ on Linux
  3. Modify languages.toml in your Helix runtime folder (create one if none exists) to include these lines:

```toml [language-server]

Update the path to match your setup

odoo-lsp.command = "odoo-lsp"

[[language]] name = "xml" language-servers = ["odoo-lsp"]

[[language]] name = "python"

Order is important here

language-servers = [ "odoo-lsp", # add the default language servers here "pylsp", # and any you need ] ```

  1. Alternatively, modify $ROOT/.helix/languages.toml where $ROOT is your Odoo modules root to include the above lines.

Development

  1. pnpm i
  2. cargo build
  3. In VSCode, press F5 or change to the Debug panel and click Launch Client

Note If encountered errors like Cannot find module '/xxx/xxx/dist/extension.js' please try run command tsc -b manually, you could refer https://github.com/IWANABETHATGUY/tower-lsp-boilerplate/issues/6 for more details