This extension provides Odoo Language Server support for the Zed editor, enabling advanced IDE features for Odoo development.
- Autocompletion for Odoo models, fields, and methods
- Go to Definition for navigating through Odoo code
- Hover Information for quick documentation
- Diagnostics for code validation
- Support for Python files in Odoo modules
You need to install the Odoo Language Server before using this extension. Follow these steps:
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Clone and build odoo-ls:
git clone https://github.com/odoo/odoo-ls.git cd odoo-ls/server cargo build --release -
Add to PATH (choose one option):
Option A - Add the binary directory to PATH:
export PATH=$PATH:$(pwd)/target/release # Add this line to your ~/.bashrc or ~/.zshrc to make it permanent
Option B - Install globally:
cargo install --path .Option C - Create a symlink:
sudo ln -s $(pwd)/target/release/odoo_ls_server /usr/local/bin/ -
Verify installation:
which odoo_ls_server # Should output the path to the binary
- Clone this repository
- Build the extension:
cargo build --release
- In Zed, open the command palette and run "zed: install dev extension"
- Select the directory containing this extension
The extension automatically activates when you open Python files. It works best in projects containing __manifest__.py files (Odoo module markers).
If you see errors about missing directories like:
canonicalizing "/home/odoo/.repositories/odoo/worktrees/17.0"
Caused by: No such file or directory (os error 2)
These are from the language server trying to access default Odoo paths. Configure the correct paths in your settings as shown above.
You can configure the Odoo Language Server in your Zed settings.json:
{
"lsp": {
"odoo-ls": {
"initialization_options": {
"addons": ["/path/to/your/addons"],
"python": "python3",
"tracked_folders": ["/path/to/track"],
"stubs": [],
"no_typeshed": false
}
}
}
}For project-specific settings, create a .zed/settings.json file in your project root:
{
"lsp": {
"odoo-ls": {
"initialization_options": {
"addons": [
"/path/to/project/addons",
"/path/to/enterprise",
"/path/to/custom_addons"
],
"python": "python3",
"tracked_folders": [
"/path/to/custom_addons"
],
"stubs": [],
"no_typeshed": false
}
}
}
}addons: Array of paths to your Odoo addon directoriespython: Python interpreter to use (default: "python3")tracked_folders: Directories to track for diagnostics (typically your custom modules)stubs: Additional stub directoriesno_typeshed: Disable typeshed stubs
To contribute to this extension:
- Fork the repository
- Create your feature branch
- Make your changes
- Test locally using Zed's dev extension feature
- Submit a pull request
This extension follows the same license as the main odoo-ls project (LGPLv3).
Ali Abdelaal yui@kotegawa.org