-
Notifications
You must be signed in to change notification settings - Fork 115
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
Visual Studio Code Autocompletion for Addon Repositories other than odoo source #233
Comments
IMHO changing the way we clone repos isn't a very good option because we might be introducing some conflicts with the way we handle repos, addons, and the integration with Another solution, however, could be adding those paths dynamically to the settings with the WDYT @yajo? |
Could you give an example? The only settings i found that would influence code completion was in
I guess adding e.g. But i may just don't know the vs-code python settings well enough to get your point? |
I agree with you @joao-p-marques.
I don't think that's enough. For python (and I guess vscode) to interpret a folder as a module, usually the folder needs to have a If it were so simple, one solution (at least for OCA addons) would be to include the If this worked, that'd mean the only ones left out of luck would be |
For me this auto-completion doesn't bring too much value compared with the setup process, as the real killer feature will be to interpret the ORM essence (type |
Yes, it'd help mostly when doing controllers, but models would remain mostly the same.
We don't really need to add the setup folder, but for cases when it already exists, we can benefit from it.
I don't trust Odoo's promises anymore. Anyways, let's leave this issue open in case somebody from the community wants to add support. It wouldn't be so hard nor harm anybody. |
ow are you all? |
Lately autocompletion was added for visual studio code by switching the language server to
jedi
and addingpython.autoComplete.extraPaths
.This will enable autocompletion for all addons in the odoo source because they are under
odoo/addons
andodoo/odoo/addons
. Soimport from odoo.addons.website_sale ...
will work because the path matches.../odoo/addons
.But this will not work for addons of other e.g. OCA addon repositories because the addons will be e.g. in
odoo/custom/src/web/[addon_name]
so the import path no longer matchesodoo/addons
.Solutions:
One easy solution might be to clone all the external addon repos like this:
odoo/custom/src/web/odoo
addons
inside this new folderstructure:odoo/custom/src/web/odoo/addons
...custom/src/private/odoo/addons/[private addons here]
Another solution would be to create the final odoo structure by symlinking like in the auto folder. But i am not sure how well vs-code works with symlinks - pycharm has it's problems with it... Therefore i would prefer the first solution.
The text was updated successfully, but these errors were encountered: