odoo-ide / vscode-odoo

Visual Studio Code extension for Odoo
https://marketplace.visualstudio.com/items?itemName=trinhanhngoc.vscode-odoo
39 stars 2 forks source link

Not working with custom project structure #33

Closed acgonzales closed 9 months ago

acgonzales commented 9 months ago

Can't seem to make it work using this project structure:

project/
├─ addons/
│  ├─ enterprise/    ->    odoo enterprise
│  ├─ other_addons_repository/    ->    custom addons repository
│  │  ├─ addons_1/    ->    sample custom addon
│  │  │  ├─ __manifest__.py
├─ src/
│  ├─ odoo/    -> odoo base code

Current behavior is its like there is no language server installed at all. No code-completion, type-hinting, like coding in notepad.

I had already set python.languageServer to None as suggested in the docs.

Odoo server is running in a Docker container.

Any suggestions as to how I can make this work?

trinhanhngoc commented 9 months ago

Hello @acgonzales, What version of VSCode + Odoo extension are you using?

Anyway, when using the Odoo extension, you don't need to manually set python.languageServer to None since the Odoo extension will set it automatically if the project is an Odoo project.

acgonzales commented 9 months ago

VS Code: 1.82.2 Odoo extension: v0.8.0

Was able to make it work initially by creating pyrightconfig.json and adding extraPaths. idk what happened its not working again.

EDIT: Investigated further, it seems the extension is not activating.

image

src and addons folders are initially included in my .gitignore, I think it's why its not being detected. Tried removing them in .gitignore then reload VSCode, sure enough the extension activates and works now.

Closing because I can conclude that this is not an issue with your extension but it's weird that VSCode is excluding ignored files in analysis, is that really the behavior?