ballerina-platform / plugin-intellij

Ballerina extension for IntelliJ IDEA.
Apache License 2.0
118 stars 4 forks source link

NullPointerException in Ballerina IntelliJ plugin. #17

Open anuruddhal opened 4 years ago

anuruddhal commented 4 years ago

Description: The following exception is thrown when opening a project with Ballerina file from IDEA. Then the editor gets slow until the plugin is disabled.

java.lang.NullPointerException
    at org.wso2.lsp4intellij.editor.EditorEventManager.lambda$null$41(EditorEventManager.java:1367)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    at org.wso2.lsp4intellij.editor.EditorEventManager.lambda$requestAndShowCodeActions$42(EditorEventManager.java:1327)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:312)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:824)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:773)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:412)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:411)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Steps to reproduce:

Affected Versions:

Ballerina 1.0.1 
IntelliJ IDEA 2019.2.3 (Ultimate Edition)
Build #IU-192.6817.14, built on September 24, 2019
Licensed to The Apache Software Foundation / Anuruddha Liyanarachchi
Subscription is active until March 1, 2020
Runtime version: 11.0.4+10-b304.69 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: 
Non-Bundled Plugins: Builder Generator, CMD Support, InnerBuilder, Lombook Plugin, Twelf Plugin, codes.rudolph.idea.cfg, com.alayouni.ansiHighlight, com.intellij.ideolog, com.jetbrains.plugins.ini4idea, io.protostuff.protostuff-jetbrains-plugin, name.kropp.intellij.makefile, org.antlr.intellij.plugin, org.jetbrains.plugins.go-template, com.demonwav.minecraft-dev, BashSupport, com.dmarcotte.handlebars, org.jetbrains.plugins.go, Pythonid, com.intellij.kubernetes, org.toml.lang

OS, DB, other environment details and versions: MacOS

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

NipunaRanasinghe commented 4 years ago

@anuruddhal Thanks for the information provided. Fix will be available with the 1.0.3 release.

Regarding the slowness issue, I suspect the issue is caused by a deprecated third party plugin you are using (go plugin). Therefore could you please recheck after disabling the go plugin and let me know if the slowness is gone?

anuruddhal commented 4 years ago

@NipunaRanasinghe I have disabled the go plugins and the slowness issue is still there. Thanks.

NipunaRanasinghe commented 4 years ago

@anuruddhal I hope you restarted the IDE after disabling the go plugin :)

FYI for larger ballerina modules with high LOC, there could be a noticeable slowness since the compilation time will be high (to show the disgnostics(i.e compilation errors), the module is compiled on each file modification event) and our language team is already working on the compiler improvements which will improve the tooling experience as well.