-
Notifications
You must be signed in to change notification settings - Fork 17
[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
base: master
Are you sure you want to change the base?
Conversation
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/", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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 :)
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.