odoo-lsp
Features
Completion, definition and references of XML IDs
Works for record
s, template
s and env.ref()
Completion, definition and references of models
Browse models and XML records as workspace symbols
For more features check out the wiki.
Install
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
- Ensure that you have
odoo-lsp
on your path (or define the SERVER_PATH environment variable pointing to one) - Determine your Helix runtime folder, e.g.
~/.config/helix/
on Linux - Modify
languages.toml
in your Helix runtime folder (create one if none exists) to include these lines:
[]
# Update the path to match your setup
= "odoo-lsp"
[[]]
= "xml"
= ["odoo-lsp"]
[[]]
= "python"
# Order is important here
= [
"odoo-lsp",
# add the default language servers here
"pylsp",
# and any you need
]
- Alternatively, modify
$ROOT/.helix/languages.toml
where$ROOT
is your Odoo modules root to include the above lines.
Development
pnpm i
cargo build
- 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 commandtsc -b
manually, you could refer https://github.com/IWANABETHATGUY/tower-lsp-boilerplate/issues/6 for more details