Language server for Odoo Python/JS/XML

Overview

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.

# 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:
[language-server]
# Update the path to match your setup
odoo-lsp.command = "odoo-lsp"

[[language]]
name = "xml"
language-servers = ["odoo-lsp"]
roots = [".odoo_lsp", ".odoo_lsp.json"]

[[language]]
name = "python"
roots = [
   ".odoo_lsp", ".odoo_lsp.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 IWANABETHATGUY/tower-lsp-boilerplate#6 for more details

You might also like...
A device-tree source parser, analyzer and language server.

Ginko A device-tree source parser, analyzer and language server. The main goal of this project is to make working with device-trees easy. For example,

The Amp programming language: a language designed for building high performance systems.

A language designed for building high performance systems. Platform Support x86_64-pc-windows ✅ x86_64-unknown-linux ⚠️ untested x86_64-unknown-darwin

An Interpreter for Brainfuck programming language implemented in the Rust programming language with zero dependencies.

Brainfuck Hello, Visitor! Hey there, welcome to my project showcase website! It's great to have you here. I hope you're ready to check out some awesom

Nexa programming language. A language for game developers by a game developer
Nexa programming language. A language for game developers by a game developer

NexaLang Nexa programming language. A language for game developers by a game developer. Features High-Level: Nexa is an easy high level language Two M

My solutions for the Advent of Code 2021 in Scala, Python, Haskell and Rust.

Advent of Code 2021 These are my Advent of Code 2021 solutions written in Scala 3, Haskell, Python and Rust. Day Title L1 L2 L3 L4 01 Sonar Sweep Scal

Fast DNA manipulation for Python, written in Rust.

quickdna Quickdna is a simple, fast library for working with DNA sequences. It is up to 100x faster than Biopython for some translation tasks, in part

Songbird bindings for python

Songbird-Py Songbird bindings for python. The goal is to provide an easy to use alternitive to Lavalink. Its written with rust-bindings to Songbird. S

A toy example showing how to run Rust code in Python for speed and progress.

PoC: Integrating Rust in Python A toy example showing how to run Rust code in Python for speed and progress. Requirements Python 3.6+ Rust 1.44+ Cargo

This is a simple command line application to convert bibtex to json written in Rust and Python

bibtex-to-json This is a simple command line application to convert bibtex to json written in Rust and Python. Why? To enable you to convert very big

Comments
  • Support for fields in Python

    Support for fields in Python

    Completions/references/definitions for fields in Python (already done in XML)

    class Foo(models.Model):
        def fun(self):
            self.env['foo.bar'].|
    

    Two approaches:

    • Self-contained: perform rudimentary analysis by walking the AST to determine if expression is a model type, then generate completions based on that information.
      • Doable, does not depend on Python
      • Con: duplicates the work of Pyright
    • Pyright: find a way to supplement type info for Pyright from outside
      • If successful, other features can benefit as well
      • Con: Pyright does not expose an easily consumable API
    opened by Desdaemon 1
Releases(nightly-20230904)
Owner
Viet Dinh
None.expect("the Spanish inquisition!")
Viet Dinh
dovi_meta is a CLI tool for creating Dolby Vision XML metadata from an encoded deliverable with binary metadata.

dovi_meta dovi_meta is a CLI tool for creating Dolby Vision XML metadata from an encoded deliverable with binary metadata. Building Toolchain The mini

Rainbaby 12 Dec 14, 2022
This project returns Queried value from SOAP(XML) in form of JSON.

About This is project by team SSDD for HachNUThon (TechHolding). This project stores and allows updating SOAP(xml) data and responds to various querie

Sandipsinh Rathod 3 Apr 30, 2023
A fast static code analyzer & language server for Python

pylyzer ⚡ pylyzer is a static code analyzer / language server for Python written in Rust. Installation cargo (rust package manager) cargo install pyly

Shunsuke Shibayama 78 Jan 3, 2023
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 13 Dec 6, 2022
TinyTodo is a Cedar Agent example, with a server in Rust and client in python

TinyTodo - OPAL and Cedar Agent Demo TinyTodo is a simple application for managing task lists. It uses OPAL and Cedar Agent to control who has access

Permit.io 4 Aug 9, 2023
A statically typed language that can deeply improve the Python ecosystem

The Erg Programming Language This is the main source code repository for Erg. This contains the compiler and documentation. 日本語 | 简体中文 | 繁體中文 Erg can

The Erg Programming Language 2.1k Jan 1, 2023
Bruteforce connecting to a specific Sea of Thieves server. Useful if you want to be in the same server as your friends.

SoT Server Finder Find which Sea of Thieves server you're connected to. Useful if you want to be in the same server as your friends. Setup Download so

Martin 4 Mar 19, 2023
Leptos server signals synced through Server-Sent-Events (SSE)

Leptos Server Sent Events Server signals are leptos signals kept in sync with the server through server-sent-events (SSE). The signals are read-only o

messense 13 Oct 3, 2023
Text-based to-do management CLI & language server

☑️ Todome (日本語版はこちら) Todome is a notation developed for making and editing to-do lists. It is inspired by Todo.txt, and in fact some of the todome not

monaqa 16 Aug 17, 2022
Rust API Server: A versatile template for building RESTful interfaces, designed for simplicity in setup and configuration using the Rust programming language.

RUST API SERVER Introduction Welcome to the Rust API Server! This server provides a simple REST interface for your applications. This README will guid

Harry Nguyen 3 Feb 25, 2024