Skip to content

[IMP] nvim: add Neovim plugin #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

Whenrow
Copy link
Collaborator

@Whenrow Whenrow commented May 27, 2025

This commit introduces a Neovim plugin to use the Odoo language server as a standard lsp. It uses the lspconfig API for now. It's shipped with an installer to get the server executable.

This commit introduces a Neovim plugin to use the Odoo language server
as a standard lsp. It uses the lspconfig API for now.
It's shipped with an installer to get the server executable.
local h = os.getenv('HOME')
odools.setup({
-- mandatory
odoo_path = h .. "/src/odoo/",
Copy link

@theangryangel theangryangel May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I'm an avid user of Neovim I'll confess that the finer details of Lua just don't fit in my head, so please forgive a potentially very silly question.

In this example you're showing a static path to the Odoo source code. I work with Doodba, and I am current experimenting with uv where Odoo isn't necessarily checked out into 1 place, as I typically work on many many different projects weekly. i.e. the path is dynamic based on the project.

Does this proposal allow you to supply a function here instead of a string/path, like you can with root_dir? This would allow me to dynamically set this. I would have the same follow up questions for addons, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is there to move the project from the Whenrow's repository to this one, but the details of the implementation is subject to changes.
Especially configurations, that is the main target of the next update of OdooLS. Configurations will not require specific code into LSP client anymore in 0.8.0, but config files in your filesystem, so it will be the same setup for any IDE, and can more easily be used by OdooLS. It will be very dynamic and suitable for any (or most) configuration.
Then, starting from 0.8.0, the odoo path will not be in the config files of the neovim plugin anymore ;)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds awesome Florian. I've been eagerly watching this repository for many months, occasionally testing it. Very excited about it's progress <3

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theangryangel Hi, the config I provide here doesn't work with dynamic path, unfortunately. I don't really know how tool like Doodba works, but I would suggest you to open different instance of Neovim depending on your setup for now. you can of course give the right odoo_path based on the current open file. I have for instance this in my personal config.

https://github.com/Whenrow/dotfiles/blob/406b71819079dda73741d8b774c40708b37297b4/.config/nvim/lua/whenrow/init.lua#L14-L19

It allows me to set my current dev directory one dir above odoo and have access to sibling dir containing all the extra modules

► src
   ► odoo
   ► enteprise
   ► extra_module

Thank you for the feedback anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants