Skip to content

GenerateTestAction throws IllegalStateException for not recognized file types #1329

Description

@alisevych

Description

GenerateTestAction throws IllegalStateException not recognized file types:
CSS, TEXT, XML, etc.
Related to multilingual support:

To Reproduce

  1. Install the plugin built from PR Python and JS support #1197 #1199 in IntelliJ Idea
  2. Open/create a Java project
  3. Open .idea folder, right-click on an XML-file

Expected behavior

No exception is supposed to be thrown in IDE.

Actual behavior

java.lang.IllegalStateException: Unknown language id: XML is thrown in IDE

Visual proofs (screenshots, logs, images)

GenerateTestsAction#update@ProjectViewPopup (org.utbot.intellij.plugin.ui.actions.GenerateTestsAction), actionId=org.utbot.intellij.plugin.ui.actions.GenerateTestsAction, text='Generate Tests with UnitTestBot...'java.lang.IllegalStateException: Unknownlanguageid: XMLatorg.utbot.intellij.plugin.language.agnostic.LanguageAssistantKt.loadWithException(LanguageAssistant.kt:35)
atorg.utbot.intellij.plugin.language.agnostic.LanguageAssistantKt.access$loadWithException(LanguageAssistant.kt:1)
atorg.utbot.intellij.plugin.language.agnostic.LanguageAssistant$Companion.get(LanguageAssistant.kt:18)
atorg.utbot.intellij.plugin.ui.actions.GenerateTestsAction.update(GenerateTestsAction.kt:13)
atcom.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:150)
atcom.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:173)
atcom.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:660)
atcom.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$4(ActionUpdater.java:128)
atcom.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$computeOnEdt$6(ActionUpdater.java:211)
atcom.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:66)
atcom.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
atcom.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
atcom.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
atcom.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
atcom.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
atcom.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
atcom.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
atcom.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:66)
atcom.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$computeOnEdt$7(ActionUpdater.java:207)
atcom.intellij.openapi.actionSystem.impl.ActionUpdateEdtExecutor.lambda$computeOnEdt$0(ActionUpdateEdtExecutor.java:45)
atcom.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
atcom.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
atcom.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
atcom.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
atcom.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
atcom.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
atjava.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
atjava.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
atjava.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
atjava.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
atjava.base/java.security.AccessController.doPrivileged(AccessController.java:399)
atjava.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
atjava.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
atcom.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918)
atcom.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766)
atcom.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450)
atcom.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
atcom.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449)
atcom.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
atcom.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624)
atcom.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447)
atcom.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
atcom.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
atjava.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
atjava.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
atjava.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
atjava.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
atjava.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
atjava.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Environment

Windows 10 Pro
IntelliJ IDEA Ultimate 2022.2.3
IntelliJ Java project, JDK 17

Additional context

Reproducible for different file types: CSS, SCSS, XML, TEXT, ...

Metadata

Metadata

Assignees

Labels

ctg-bugIssue is a bug

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions