Closed SimoRubi closed 2 years ago
@SimoRubi thanks for reporting the error. I could not reproduce it in my workspace with the commit and version you referenced, but that could be expected as the indexing works differently every time. I still might have an idea what went wrong and will provide a fix ASAP (hopefully a SNAPSHOT version tomorrow and a marketplace release next week).
Details (mostly as a reminder to myself):
Update: i managed to reproduce the exact stacktrace with the following procedure:
Working (in progress) branch: https://github.com/wt-io-it/odoo-pycharm-plugin/tree/master-0.5.8_fix_indexing_error
We seem unable to parse _inherit = self.MODEL_REQUIRED
(and others alike) without the full type hierarchy (when using the python pycharm lib)
introduced in https://github.com/odoo/odoo/commit/f0481392c6501cae2c38359f526da1eefa451337
@SimoRubi i just uploaded version 0.5.8 to jetbrains it's pending review. If you don't want to wait for their review you can download the version from here https://github.com/wt-io-it/odoo-pycharm-plugin/tree/v0.5.8 following the alternate instructions for installing. Thanks for taking the time and reporting the issue. Once the new version is approved i (with my company account) will mark the issue as closed.
0.5.9 (fixing compatibility with 2019.2 and 2019.3) has just been approved and can now be downloaded from the marketplace as well.
Thanks! I installed 0.5.9 and used it all day today, the error has never occurred.
Hi, I have the plugin https://plugins.jetbrains.com/plugin/13083-odoo-autocompletion-support installed in PyCharm and it has raised the following error during the indexing process, here the stack trace:
Stack trace
Error while indexing /path/to/odoo/odoo/addons/test_new_api/tests/test_new_fields.py To reindex this file IDEA has to be restarted java.lang.AssertionError: Reentrant indexing at com.intellij.util.indexing.FileBasedIndexImpl.markFileIndexed(FileBasedIndexImpl.java:1635) at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1546) at com.intellij.util.indexing.FileBasedIndexImpl.scheduleFileForIndexing(FileBasedIndexImpl.java:1793) at com.intellij.util.indexing.events.ChangedFilesCollector.lambda$processFilesToUpdateInReadAction$4(ChangedFilesCollector.java:235) at com.intellij.util.indexing.events.ChangedFilesCollector.lambda$processFilesInReadAction$5(ChangedFilesCollector.java:259) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646) at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:237) at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221) at com.intellij.util.indexing.events.ChangedFilesCollector.lambda$processFilesInReadAction$6(ChangedFilesCollector.java:258) at com.intellij.util.ConcurrencyUtil.withLock(ConcurrencyUtil.java:234) at com.intellij.util.indexing.events.ChangedFilesCollector.lambda$processFilesInReadAction$7(ChangedFilesCollector.java:256) at com.intellij.util.indexing.events.VfsEventsMerger.processChanges(VfsEventsMerger.java:93) at com.intellij.util.indexing.events.ChangedFilesCollector.processFilesInReadAction(ChangedFilesCollector.java:255) at com.intellij.util.indexing.events.ChangedFilesCollector.processFilesToUpdateInReadAction(ChangedFilesCollector.java:231) at com.intellij.util.indexing.events.ChangedFilesCollector.ensureUpToDate(ChangedFilesCollector.java:192) at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:785) at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:244) at com.intellij.util.indexing.FileBasedIndexEx.processValueIterator(FileBasedIndexEx.java:349) at com.intellij.util.indexing.FileBasedIndexEx.processValuesInScope(FileBasedIndexEx.java:318) at com.intellij.util.indexing.FileBasedIndexEx.getValues(FileBasedIndexEx.java:111) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.lambda$getModule$0(OdooModuleServiceImpl.java:57) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:852) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.getModule(OdooModuleServiceImpl.java:54) at at.wtioit.intellij.plugins.odoo.pycharm.PyCharmOdooAddonsImportResolver.resolveImportReference(PyCharmOdooAddonsImportResolver.java:36) at at.wtioit.intellij.plugins.odoo.pycharm.PyCharmOdooAddonsImportResolver.resolveImportReference(PyCharmOdooAddonsImportResolver.java:42) at com.jetbrains.python.psi.resolve.PyResolveImportUtil$foreignResults$1.invoke(PyResolveImportUtil.kt:199) at com.jetbrains.python.psi.resolve.PyResolveImportUtil$foreignResults$1.invoke(PyResolveImportUtil.kt) at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210) at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170) at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194) at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786) at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:816) at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:807) at com.jetbrains.python.psi.resolve.PyResolveImportUtil.foreignResults(PyResolveImportUtil.kt:201) at com.jetbrains.python.psi.resolve.PyResolveImportUtil.resolveQualifiedName(PyResolveImportUtil.kt:74) at com.jetbrains.python.pyi.PyiUtil.getPythonStubFile(PyiUtil.java:160) at com.jetbrains.python.pyi.PyiUtil.getPythonStub(PyiUtil.java:59) at com.jetbrains.python.pyi.PyiTypeProvider.getReferenceType(PyiTypeProvider.java:74) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getReferenceTypeFromProviders(PyReferenceExpressionImpl.java:530) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getGenericTypeFromTarget(PyReferenceExpressionImpl.java:427) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getTypeFromTarget(PyReferenceExpressionImpl.java:399) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getTypeFromTargets(PyReferenceExpressionImpl.java:310) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getType(PyReferenceExpressionImpl.java:229) at com.jetbrains.python.psi.types.TypeEvalContext.lambda$getType$0(TypeEvalContext.java:176) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:44) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68) at com.jetbrains.python.psi.types.TypeEvalContext.getType(TypeEvalContext.java:165) at com.jetbrains.python.psi.impl.references.PyQualifiedReference.resolveInner(PyQualifiedReference.java:79) at com.jetbrains.python.psi.impl.references.PyReferenceImpl.multiResolveInner(PyReferenceImpl.java:107) at com.jetbrains.python.psi.impl.references.PyReferenceImpl$CachingResolver.resolve(PyReferenceImpl.java:776) at com.jetbrains.python.psi.impl.references.PyReferenceImpl$CachingResolver.resolve(PyReferenceImpl.java:771) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolve$1(ResolveCache.java:154) at com.intellij.openapi.util.Computable.get(Computable.java:18) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$4(ResolveCache.java:260) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:44) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:237) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:154) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:169) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:162) at com.jetbrains.python.psi.impl.references.PyReferenceImpl.multiResolve(PyReferenceImpl.java:94) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.multiFollowAssignmentsChain(PyReferenceExpressionImpl.java:153) at com.jetbrains.python.psi.PyReferenceExpression.multiFollowAssignmentsChain(PyReferenceExpression.java:53) at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.followAssignmentsChain(PyReferenceExpressionImpl.java:123) at at.wtioit.intellij.plugins.odoo.models.OdooModelUtil.getStringValueForValueChild(OdooModelUtil.java:74) at at.wtioit.intellij.plugins.odoo.models.OdooModelUtil.detectName(OdooModelUtil.java:42) at at.wtioit.intellij.plugins.odoo.models.OdooModelUtil.detectName(OdooModelUtil.java:28) at at.wtioit.intellij.plugins.odoo.models.index.OdooModelDefinition.Odoo code is at https://github.com/odoo/odoo/tree/0ea254e973fee897b26477cce6f5c2cf64ddbd4b.
PyCharm version
PyCharm 2021.3.2 (Community Edition) Build #PC-213.6777.50, built on January 27, 2022 Runtime version: 11.0.13+7-b1751.25 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.4.0-97-generic GC: G1 Young Generation, G1 Old Generation Memory: 750M Cores: 8 Registry: indexer.follows.symlinks=false Non-Bundled Plugins: com.jetbrains.plugins.ini4idea (213.5744.190) com.intellij.ideolog (203.0.27.0) com.alayouni.ansiHighlight (1.2.4) codes.rudolph.idea.cfg (0.3.1) at.wtioit.intellij.plugins.odoo (0.5.7) Current Desktop: ubuntu:GNOMELet me know if you need anything else.
Note that at first contacted contact@wt-io-it.at because PyCharm's error popup shows only the link to https://www.wt-io-it.at/. Having the link to this repository directly in PyCharm's popup might save some time for future contributors and https://www.wt-io-it.at/.
Thanks for creating this plugin :)