odoo-lsp

nightly

Features

Completion, definition and references for models, XML IDs and model fields

Works for records, templates, env.ref() and other structures.

model demo

Browse models and XML records as workspace symbols

symbols demo

For more features check out the [wiki].

Install

The VSCode extension handles downloading the latest releases automatically; other editors need odoo-lsp on the path. Nightly binaries are also available for major platforms, please check [Releases] for the latest downloads.

```shell

One-line

wget -qO- "https://github.com/Desdaemon/odoo-lsp/releases/download/nightly-$(date +'%Y%m%d')/odoo-lsp-x86_64-unknown-linux-musl.tgz" | \ tar --transform 's/^dbt2-0.37.50.3/dbt2/' -xvz

With cargo-binstall

cargo binstall odoo-lsp

Install from source

cargo install odoo-lsp ```

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
  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"] roots = [".odoolsp", ".odoolsp.json"]

[[language]] name = "python" roots = [ ".odoolsp", ".odoolsp.json", # add the default roots here ]

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