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

NullPointerException in Autocomplete and GoTo for Records in Python with space between method name and arguments list #68

Closed medosobh closed 1 year ago

medosobh commented 1 year ago

Plugin Version: 0.6.0 IntelliJ Version: PyCharm 2022.2.3 IntelliJ Build: PC-222.4345.23

java.lang.NullPointerException: Cannot invoke "com.intellij.psi.PsiElement.getText()" because the return value of "com.intellij.psi.PsiElement.getLastChild()" is null ``` java.lang.NullPointerException: Cannot invoke "com.intellij.psi.PsiElement.getText()" because the return value of "com.intellij.psi.PsiElement.getLastChild()" is null at at.wtioit.intellij.plugins.odoo.OdooRecordPsiElementMatcherUtil.isOdooRecordPsiElement(OdooRecordPsiElementMatcherUtil.java:39) at at.wtioit.intellij.plugins.odoo.OdooCompletionContributor.fillCompletionVariants(OdooCompletionContributor.java:48) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76) ... at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:297) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ... at java.base/java.lang.Thread.run(Thread.java:833) ```
ap-wtioit commented 1 year ago

Happens when one has a space character between the method name and the argument list:

something.ref ("base.public_user")

and uses autocompletion or GoTo ([CTRL] click)

ap-wtioit commented 1 year ago

@medosobh thanks for reporting this. it is fixed in 0.6.4 (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.4