wt-io-it / odoo-pycharm-plugin

Plugin to Support Odoo in Pycharm
GNU Affero General Public License v3.0
19 stars 10 forks source link

PyCharmOdooAddonsImportResolver: IndexNotReadyException #72

Closed hishamalfoqaha closed 1 year ago

hishamalfoqaha commented 1 year ago

Plugin Version: 0.6.0 IntelliJ Version: PyCharm 2021.3.3 IntelliJ Build: PY-213.7172.26

com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation ``` com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67) ... at com.intellij.util.indexing.FileBasedIndexEx.getValues(FileBasedIndexEx.java:111) at at.wtioit.intellij.plugins.odoo.index.OdooIndex.getValues(OdooIndex.java:49) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.lambda$getModule$1(OdooModuleServiceImpl.java:63) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:852) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.getModule(OdooModuleServiceImpl.java:61) at at.wtioit.intellij.plugins.odoo.pycharm.PyCharmOdooAddonsImportResolver.resolveImportReference(PyCharmOdooAddonsImportResolver.java:49) at com.jetbrains.python.psi.resolve.PyResolveImportUtil$foreignResults$1.invoke(PyResolveImportUtil.kt:199) ... at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$MyDocumentListener.beforeDocumentChange(SuggestedRefactoringChangeListener.kt:210) at jdk.internal.reflect.GeneratedMethodAccessor133.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ... at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:85) at com.sun.proxy.$Proxy75.beforeDocumentChange(Unknown Source) at com.intellij.openapi.editor.impl.DocumentImpl.beforeChangedUpdate(DocumentImpl.java:878) ... at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ```
ap-wtioit commented 1 year ago

how to trigger this:

In PyCharm 1) open a file that has an import like this:

    from odoo.addons.project import _check_existing_collaborators_for_project_sharing

2) while indexing 3) on the location where _check_existing_collaborators_for_project_sharing 4) type in _check_existing_collaborators_for_project_sharing

Breakpoint on moduleService.getModule(addonName) with condition !IndexWatcher.isFullyIndexed(context.getProject())

Strangely i didn't get any error reporting dialogs on my system even when the Exceptions were triggered.

ap-wtioit commented 1 year ago

@hishamalfoqaha thanks for reporting this, it is fixed in 0.6.7 (pending jetbrains approval) if you are eager to test it you can use the jar file from https://github.com/wt-io-it/odoo-pycharm-plugin/tree/v0.6.7

bigbear3001 commented 1 year ago

Was fixed (for 2021.3.3) in 0.6.7 available in the marketplace