odoo-lsp icon indicating copy to clipboard operation
odoo-lsp copied to clipboard

Module analysis first file open

Open gbrito opened this issue 8 months ago • 2 comments

I noticed that depending on the module , file that I open first, that would be the first module indexed. Would it be an idea to first load base modules, enterprise then custom . Make some sort of priority when loading

gbrito avatar Aug 02 '25 12:08 gbrito

Reading this again, its not that clear what I meant, maybe the problem is on my side only due to the neovim configuration:

Let me explain again. In the new PR for the module analyses and the DiagnosticRelatedMessages I noticed that when I open first the models.py inside the folder /testing/fixtures/auto_install_missing_deps/sale it works as expected. If open first the /testing/fixtures/auto_install_missing_deps/sale_crm i don't have the same messages.

Can it be that we always load the first module from the file we open? Or is this only on my local machine due to my config

gbrito avatar Aug 04 '25 12:08 gbrito

There's a fallback mechanism that loads the parent directory of a newly opened file's module as a root in case no roots are detected. You can try to comment it out and see if it changes anything; I suspect there's a race condition between loading of the configured modules and said mechanism.

Desdaemon avatar Aug 04 '25 12:08 Desdaemon