didalgolab / chatgpt-intellij-plugin

Yet another JetBrains extension that enables you to use ChatGPT within your favorite IDE.
Apache License 2.0
27 stars 14 forks source link

java.lang.IllegalArgumentException: Argument for @NotNull parameter 'extension' of com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.getFileTypeByExtension must not be null #7

Closed gounthar closed 1 year ago

gounthar commented 1 year ago

Hello there, πŸ‘‹

Firstly, thank you for this plugin. I have been experiencing an error since this morning. I have upgraded to the latest version of the plugin, but the issue persists.

IntelliJ IDEA 2023.2.1 (Ultimate Edition Build #IU-232.9559.62, built on August 23, 2023 Plugin 0.2.9-231.232

java.lang.IllegalArgumentException: Argument for @NotNull parameter 'extension' of com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.getFileTypeByExtension must not be null
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.$$$reportNull$$$0(FileTypeManagerImpl.java)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.getFileTypeByExtension(FileTypeManagerImpl.java)
    at com.didalgo.intellij.chatgpt.ui.action.editor.CustomPromptAction$CustomActionDialog.createItemPanel(CustomPromptAction.java:152)
    at com.didalgo.intellij.chatgpt.ui.action.editor.CustomPromptAction$CustomActionDialog.createCenterPanel(CustomPromptAction.java:105)
    at com.intellij.openapi.ui.DialogWrapper.init(DialogWrapper.java:1312)
    at com.didalgo.intellij.chatgpt.ui.action.editor.CustomPromptAction$CustomActionDialog.<init>(CustomPromptAction.java:96)
    at com.didalgo.intellij.chatgpt.ui.action.editor.CustomPromptAction.actionPerformed(CustomPromptAction.java:65)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:313)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:313)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$performAction$5(ActionMenuItem.java:300)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:226)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.java:293)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$0(ActionMenuItem.java:68)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$4(ActionMenuItem.java:115)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:115)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:526)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:558)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
    at java.desktop/java.awt.Component.processEvent(Component.java:6422)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4954)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4581)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4522)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:633)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:588)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Would you have any idea?

Thanks.

didalgolab commented 1 year ago

Thank you for reporting this. I was able to reproduce the issue locally. It occurs when you are working on a file that has no extension in its name, for example, "Dockerfile".

The fix should be easy, so expect a release in a day or two. In the meantime, the best workaround I can offer is to rename the file to include some extension, and then rename it back after you're done working with it.

didalgolab commented 1 year ago

Fixed in v0.2.10 (currently pending marketplace approval)

gounthar commented 1 year ago

Thank you so much for this quick and efficient fix! All the best.

didalgolab commented 1 year ago

Glad I could help, cheers!

gounthar commented 1 year ago

It is now available on the marketplace, my Dockerfile thanks you for your help. πŸ˜‰