Neovim client for the Odools language server
This plugin is still in its early development stage. Don't hesitate to submit bugs, issues and/or feedbacks to improve the user experience.
We recommend using nvim version 0.9.0
or later. This plugin is using
lspconfig to connect communicate with the language
server in your beloved editor.
- Install the plugin
Using packer.nvim
use {
'whenrow/odoo-ls.nvim',
requires = { {'neovim/nvim-lspconfig'} }
}
Using lazy.nvim
-- init.lua:
{
'whenrow/odoo-ls.nvim',
dependencies = { 'neovim/nvim-lspconfig' }
}
-- plugins/odoo.lua:
return {
'whenrow/odoo-ls.nvim',
dependencies = { 'neovim/nvim-lspconfig' }
}
- Download the server executable from the release assets
wget -O ~/.local/bin/odoo_ls_server https://github.com/odoo/odoo-ls/releases/download/0.4.0/odoo_ls_server
- downloads python typeshed to enrich the server with builtin python package stubs
(2. and 3. can be done automatically via the Odools
command)
The plugin needs different local path and executable to be working. Here is the mandatory config keys.
local odools = require('odools')
local h = os.getenv('HOME')
odools.setup({
-- mandatory
odoo_path = h .. "/src/odoo/",
python_path = h .. "/.pyenv/shims/python3",
-- optional
server_path = h .. "/.local/bin/odoo_ls_server",
addons = {h .. "/src/enterprise/"},
additional_stubs = {h .. "/src/additional_stubs/", h .. "/src/typeshed/stubs"},
root_dir = h .. "/src/", -- working directory, odoo_path if empty
settings = {
autoRefresh = true,
autoRefreshDelay = nil,
diagMissingImportLevel = "none",
},
})
Try the command :Odools install
to fetch the language server executable from Github as well as the
python typesheds