Skip to content

Ctrl+J Shortcut Not Working in IntelliJ Extension #3251

Closed

Description

@AfterStories

Before submitting your bug report

Relevant environment info

- OS:Windows
- Continue version:The latest main branch
- IDE version:IDEAC 2022.3.3
Files I have modified only these:
Many SCRIPT_TEXT configurations in extensions\intellij\.run\ are written for the Linux system. I modified them to my Windows system cmd commands,like this in start core dev server CE.run.xml :
<option name="SCRIPT_TEXT" value="set CONTINUE_DEVELOPMENT=true &amp;&amp; set CONTINUE_GLOBAL_DIR=C:\Users\hzheng057\Desktop\Code\ContinueTest\continue\extensions\.continue-debug &amp;&amp; node out/index.js" />

In the Run Extension.run.xml file, change 2024 to the 2022.3 version of IDEA I use
<option name="env">
<map>
<entry key="GUI_URL" value="http://localhost:5173/jetbrains_index.html" />
<entry key="ORG_GRADLE_PROJECT_platformVersion" value="2022.3" />
<entry key="USE_TCP" value="true" />
</map>
</option>

Description

When I run the "Run Continue(CE)" task, a new IntelliJ window opens with the extension running. In the continue_tutorial.java file, it states:

// Highlight the code below
// Press [Cmd/Ctrl + J] to add to Chat

However, when I select some code and press Ctrl + J, the only thing that happens is that the cursor automatically focuses on the input box of the Continue extension. The selected code is not added to the top of the input box in the extension.

I noticed the following two descriptions in the how-to-use-it.md file. It seems like one mentions that Ctrl+J is used to add highlighted code to the extension, and the other says Ctrl+J starts a new session. Isn't this a conflict? The same Ctrl+J shortcut is described with two different functions, and what I experience seems to start a new session rather than displaying the selected code in the extension:

how-to-use-it.md:
#### Start a fresh session for a new task

Once you complete a task and want to start a new one, press <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) to begin a new session, ensuring only relevant context for the next task is provided to the LLM.

#### Highlight a code section to include as context

You select a code section with your mouse, press <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) to send it to the LLM, and then ask for it to be explained to you or request it to be refactored in some way.

Additionally, I found the following configuration in the extensions\intellij\src\main\resources\META-INF\plugin.xml file, which seems to configure the shortcut as ctrl J, but its class is FocusContinueInputAction:

<action id="continue.focusContinueInput"
        class="com.github.continuedev.continueintellijextension.actions.FocusContinueInputAction"
        text="Add selected code to context"
        description="Focus Continue Input">
    <keyboard-shortcut keymap="$default"
                       first-keystroke="ctrl J"/>
    <keyboard-shortcut keymap="Mac OS X"
                       first-keystroke="meta J"/>
    <add-to-group group-id="EditorPopupMenu"/>
    <override-text place="GoToAction" text="Continue: Add Highlighted Code to Context and Clear Chat"/>
</action>

However, when I install the official version of the Continue extension from the IntelliJ Plugin Store, I find that using Ctrl+J works. Is there a significant difference between the official version of the Continue extension in the Plugin Store and the main branch of the code? Why can I not display the highlighted code in the extension using Ctrl+J?

When I pressed CTRL+J for the first time, the cursor automatically focused on the extended input box, but the code I selected was not added to the UI interface.

When I pressed CTRL+J again, I saw an error in the terminal:

Exception in thread "Thread-6576" java.lang.IllegalArgumentException: invalid keyCode
at java.desktop/java.awt.event.KeyEvent.<init>(KeyEvent.java:1186)
at com.intellij.ui.jcef.JBCefEventUtils.convertCefKeyEvent(JBCefEventUtils.java:41)
at com.intellij.ui.jcef.JBCefBrowser$2.onKeyEvent(JBCefBrowser.java:258)
at com.intellij.ui.jcef.JBCefClient$9.lambda$onKeyEvent$1(JBCefClient.java:474)
at com.intellij.ui.jcef.JBCefClient$HandlerSupport.lambda$handle$0(JBCefClient.java:717) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2131) at com.intellij.ui.jcef.JBCefClient$HandlerSupport.handle(JBCefClient.java:717) at com.intellij.ui.jcef.JBCefClient$HandlerSupport.handleBoolean(JBCefClient.java:722) at com.intellij.ui.jcef.JBCefClient$9.onKeyEvent(JBCefClient.java:473) at jcef/org.cef.CefClient.onKeyEvent(CefClient.java:572)

In addition, the Ctrl+I shortcut works fine, it can make an input box appear on top of the code I selected, so I think the entire logic of the shortcut operation is correct, but there may be something wrong with CTRL+J

image

And these shortcut works normally in VS Code. So I think there should be no problem with the GUI level code, but there is a problem in the IntelliJ part of the code, or maybe there is some problem with my development environment?

Log output

When I run the "Run Continue(CE)" task, Log output:


8:42:49: Executing 'runIde'...

Starting Gradle Daemon...
Connected to the target VM, address: '127.0.0.1:64054', transport: 'socket'
Gradle Daemon started in 7 s 36 ms
Reusing configuration cache.
> Task :initializeIntelliJPlugin SKIPPED
> Task :patchPluginXml UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :verifyPluginConfiguration
> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :classes UP-TO-DATE
> Task :instrumentCode UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :instrumentedJar UP-TO-DATE
> Task :prepareSandbox UP-TO-DATE
Disconnected from the target VM, address: '127.0.0.1:64054', transport: 'socket'

> Task :runIde
CompileCommand: exclude com/intellij/openapi/vfs/impl/FilePartNodeRoot.trieDescend bool exclude = true
Connected to the target VM, address: 'localhost:57071', transport: 'socket'
2024-12-09 08:44:41,593 [  21606]   WARN - #c.i.e.RunManager - Must be not called before project components initialized
Info  | RdCoroutineScope          | 43:DefaultDispatcher-worker-20 | RdCoroutineHost overridden 
JCEF(44:45:245): initialized stderr logger, severity=LOGSEVERITY_DISABLE
2024-12-09 08:44:45,299 [  25312]   WARN - #c.i.u.j.JBCefClient - JSQueryPool has already been created, this request will be ignored
Identified OS: win32, Arch: x64
didChangeAvailableProfiles

continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
indexProgress

continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
2024-12-09 08:44:59,333 [  39346]   WARN - #c.i.o.a.i.ActionUpdater - 10981 ms to call on BGT precache-slow-data@DeviceAndSnapshotComboBoxAction#update@NavBarToolbar (com.android.tools.idea.run.deployment.DeviceAndSnapshotComboBoxAction)
indexProgress

continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
indexProgress

continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
indexProgress

continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
indexProgress
vectordb::_TransformersJsEmbeddingsProvider::all-MiniLM-L6-v2 index..., status=indexing}
continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
indexProgress

continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
indexProgress
debugInfo=LanceDbIndex.getEmbeddings, async LanceDbIndex.computeRows, async LanceDbIndex.update, async CodebaseIndexer.indexFiles, async CodebaseIndexer.refreshDirs, async Core.refreshCodebaseIndex}
continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
refreshSubmenuItems
null
continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
Exception in thread "DefaultDispatcher-worker-17" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
	at kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(CoroutineExceptionHandlerImpl.common.kt:36)
	at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:32)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:117)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
2024-12-09 08:45:07,336 [  47349]   WARN - #c.i.d.PerformanceWatcherImpl - UI was frozen for 20095ms, details saved to C:\Users\hzheng057\Desktop\Code\ContinueTest\continue\extensions\intellij\build\idea-sandbox\system\log\threadDumps-freeze-20241209-084451-IC-223.7571.182-20sec
2024-12-09 08:45:09,946 [  49959]   WARN - #c.i.o.a.i.ActionUpdater - 1641 ms to call on BGT NewActionGroup#getChildren@MainMenu(preload-bgt) (com.intellij.ide.actions.NewActionGroup)
indexProgress
status=indexing}
continuePluginWindow
com.github.continuedev.continueintellijextension.toolWindow.ContinuePluginToolWindowFactory$ContinuePluginWindow@63da0f11
2024-12-09 08:45:22,485 [  62498]   WARN - #c.i.o.a.i.ActionUpdater - 337 ms to grab EDT for CWMTelephonyGroup#update@NavBarToolbar (com.jetbrains.rd.platform.codeWithMe.telephony.CWMTelephonyGroup)
2024-12-09 08:45:22,490 [  62503]   WARN - #c.i.o.a.i.ActionUpdater - 337 ms to grab EDT for ToolWindowHeader$2#update@ToolwindowTitle (com.intellij.toolWindow.ToolWindowHeader$2)
2024-12-09 08:45:36,753 [  76766]   WARN - #c.i.u.x.Binding - no accessors for org.jetbrains.kotlin.idea.projectConfiguration.KotlinNotConfiguredSuppressedModulesState

Activity

  1. added
    area:chat
    ide:jetbrains
    kind:bug
    on Dec 9, 2024
  2. AfterStories commented on Dec 9, 2024

    @AfterStories
    Author

    When I tried to find out when the program calls addHighlightedCodeToContext, I found some comments in extensions\vscode\src\commands.ts ,I'm not sure if it's the issue described in this comment that's causing my issue because this code exists under vscode folder, and my problem is in IntelliJ

    commands.ts :
    "continue.focusContinueInputWithoutClear": async () => { // This is a temporary fix—sidebar.webviewProtocol.request is blocking // when the GUI hasn't yet been setup and we should instead be // immediately throwing an error, or returning a Result object if (!sidebar.isReady) { focusGUI(); return; }

  3. AfterStories commented on Dec 9, 2024

    @AfterStories
    Author

    I think I found some clues but I don't know the specific reason. I am not very familiar with ts code. I tried to listen to the IDE sending commands to the webview and trigger the update page. It seems that the program was interrupted and did not execute normally.

    In the following file,

    gui\src\components\mainInput\TipTapEditor.tsx

    console.log("ideMessenger",ideMessenger)

    const relativePath = getRelativePath(
    rif.filepath,
    await ideMessenger.ide.getWorkspaceDirs(),
    );

    console.log("relativePath",relativePath)

    ideMessenger is output, but the relativePath log is not output. I suspect that await ideMessenger.ide.getWorkspaceDirs() is not executed normally.

    But I don't know why. How should I check it?

  4. AfterStories commented on Dec 9, 2024

    @AfterStories
    Author

    You can see a red warning in the lower right corner of the new IntelliJ window. Click it and the following warning will be displayed in the pop-up window:

    java.lang.RuntimeException: Index is corrupted at com.intellij.vcs.log.data.index.IndexDiagnosticRunner.runDiagnostic(IndexDiagnosticRunner.kt:54) at com.intellij.vcs.log.data.index.IndexDiagnosticRunner.indexingListener$lambda-0(IndexDiagnosticRunner.kt:28) at com.intellij.vcs.log.data.index.VcsLogPersistentIndex$IndexingRequest.lambda$run$2(VcsLogPersistentIndex.java:551) at com.intellij.util.containers.LockFreeCopyOnWriteArrayList.forEach(LockFreeCopyOnWriteArrayList.java:804) at com.intellij.vcs.log.data.index.VcsLogPersistentIndex$IndexingRequest.run(VcsLogPersistentIndex.java:551) at com.intellij.vcs.log.data.index.VcsLogPersistentIndex$MySingleTaskController.lambda$startNewBackgroundTask$0(VcsLogPersistentIndex.java:437) at com.intellij.vcs.log.impl.HeavyAwareExecutor.executeOutOfHeavyOrPowerSave$lambda-3$lambda-1$lambda-0(HeavyAwareExecutor.kt:53) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:190) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:591) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:666) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:622) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:590) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:177) at com.intellij.vcs.log.impl.HeavyAwareExecutor.executeOutOfHeavyOrPowerSave$lambda-3$lambda-1(HeavyAwareExecutor.kt:53) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833)
    image

  5. AfterStories commented on Dec 9, 2024

    @AfterStories
    Author

    @Patrick-Erichsen If the problem I'm having hasn't been fixed yet and you're still working on fixing it, please let me know, I'm really stumped on this one right now.

  6. Patrick-Erichsen commented on Dec 9, 2024

    @Patrick-Erichsen
    Contributor

    Hi @AfterStories - this log line leads me to believe that the GUI is not successfully connecting to the IDE when you're running the extension locally:

    Exception in thread "DefaultDispatcher-worker-17" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
    

    Can you make sure you've followed all the instructions here? https://github.com/continuedev/continue/blob/main/extensions/intellij/CONTRIBUTING.md

    As for the intended behavior of the shortcut, Cmd + J is used both to create a new session and to add code to the session.

  7. AfterStories commented on Dec 10, 2024

    @AfterStories
    Author

    hi @Patrick-Erichsen ,
    I configured and started the environment according to the contents of Intellij/CONTRIBUTING.md. I have tried it many times. Now please check if there are any mistakes in my use of steps:

    1.use IDE2022.3
    image

    1. IDE project use JAVA17
      image

    config kotlin use java17 → ./build.gradle.kts
    image

    config gradlew use java17

    Since I don't have permission to change the computer's environment variables, I manually set JAVA_HOME to 17 before I run any gradlew command.
    image

    1. use node>20
      image

    2. run .\scripts\install-dependencies.ps1 to Install all dependencies
      before install , I edit the binary\build.js want to only build for windows ,so I commented out other systems

    let targets = [
      //  "darwin-x64",
      //  "darwin-arm64",
      //  "linux-x64",
      //  "linux-arm64",
      "win32-x64",
    ];
    
    const targetToLanceDb = {
      //  "darwin-arm64": "@lancedb/vectordb-darwin-arm64",
      //  "darwin-x64": "@lancedb/vectordb-darwin-x64",
      //  "linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
      //  "linux-x64": "@lancedb/vectordb-linux-x64-gnu",
      "win32-x64": "@lancedb/vectordb-win32-x64-msvc",
      // "win32-arm64": "@lancedb/vectordb-win32-x64-msvc", // they don't have a win32-arm64 build
    };
    
    1. Run Run Continue (CE) ,it will run 3 task

    GUI :
    image

    Prompt Logs:
    image

    Start Core Dev Server (CE)
    image

    When the new IntelliJ window pops up automatically,Trust
    image

    image

    At this time, you can see the following content in the terminal. There is still this problem:

    Exception in thread "DefaultDispatcher-worker-3" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
    kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(CoroutineExceptionHandlerImpl.common.kt:36)
    2024-12-11 02:25:59,490 [ 103433] SEVERE - #c.i.v.l.d.i.IndexDiagnosticRunner - IdeaLoggingEvent[message=Index is corrupted, throwable=java.lang.RuntimeException: Index is corrupted

    2:23:31: Executing 'runIde'...
    
    Starting Gradle Daemon...
    Connected to the target VM, address: '127.0.0.1:51062', transport: 'socket'
    Gradle Daemon started in 5 s 977 ms
    Reusing configuration cache.
    > Task :initializeIntelliJPlugin SKIPPED
    > Task :patchPluginXml UP-TO-DATE
    > Task :processResources UP-TO-DATE
    > Task :verifyPluginConfiguration
    > Task :compileKotlin UP-TO-DATE
    > Task :compileJava NO-SOURCE
    > Task :classes UP-TO-DATE
    > Task :instrumentCode UP-TO-DATE
    > Task :jar UP-TO-DATE
    > Task :instrumentedJar UP-TO-DATE
    > Task :prepareSandbox UP-TO-DATE
    Disconnected from the target VM, address: '127.0.0.1:51062', transport: 'socket'
    
    > Task :runIde
    CompileCommand: exclude com/intellij/openapi/vfs/impl/FilePartNodeRoot.trieDescend bool exclude = true
    Connected to the target VM, address: 'localhost:51075', transport: 'socket'
    2024-12-11 02:24:34,976 [  18919]   WARN - #c.i.e.RunManager - Must be not called before project components initialized
    Info  | RdCoroutineScope          | 33:DefaultDispatcher-worker-17 | RdCoroutineHost overridden 
    JCEF(24:37:839): initialized stderr logger, severity=LOGSEVERITY_DISABLE
    2024-12-11 02:24:37,908 [  21851]   WARN - #c.i.u.j.JBCefClient - JSQueryPool has already been created, this request will be ignored
    2024-12-11 02:24:40,437 [  24380]   WARN - #c.i.o.a.i.ActionUpdater - 1164 ms to call on BGT NewActionGroup#getChildren@MainMenu(preload-bgt) (com.intellij.ide.actions.NewActionGroup)
    2024-12-11 02:24:40,589 [  24532]   WARN - #c.i.o.a.i.ActionUpdater - 1117 ms to call on BGT CopyReferencePopup#update@MainMenu(preload-bgt) (com.intellij.ide.actions.CopyReferencePopup)
    2024-12-11 02:24:43,565 [  27508]   WARN - #c.i.o.a.i.ActionUpdater - 2127 ms to call on BGT FileTemplateSeparator#getChildren@MainMenu(preload-bgt) (com.intellij.ide.fileTemplates.actions.FileTemplateSeparator)
    Identified OS: win32, Arch: x64
    2024-12-11 02:24:46,246 [  30189]   WARN - #c.i.o.a.i.ActionUpdater - 1249 ms to call on BGT DefaultActionGroup#getChildren@MainMenu(preload-bgt) (com.intellij.openapi.actionSystem.DefaultActionGroup)
    2024-12-11 02:25:03,894 [  47837]   WARN - #c.i.o.a.i.ActionUpdater - 1523 ms to call on BGT RunContextAction#update@EditorPopup(preload-bgt) (com.intellij.execution.actions.RunContextAction)
    2024-12-11 02:25:04,013 [  47956]   WARN - #c.i.o.a.i.ActionUpdater - 1643 ms to call on BGT RunContextAction#update@EditorPopup(preload-bgt) (com.intellij.execution.actions.RunContextAction)
    2024-12-11 02:25:15,097 [  59040]   WARN - #c.i.o.a.i.ActionUpdater - 616 ms to grab EDT for ToolWindowHeader$2#update@ToolwindowTitle (com.intellij.toolWindow.ToolWindowHeader$2)
    2024-12-11 02:25:15,096 [  59039]   WARN - #c.i.o.a.i.ActionUpdater - 616 ms to grab EDT for CWMTelephonyGroup#update@NavBarToolbar (com.jetbrains.rd.platform.codeWithMe.telephony.CWMTelephonyGroup)
    2024-12-11 02:25:15,582 [  59525]   WARN - #c.i.u.x.Binding - no accessors for org.jetbrains.kotlin.idea.projectConfiguration.KotlinNotConfiguredSuppressedModulesState
    2024-12-11 02:25:29,860 [  73803]   WARN - #c.i.d.WindowsDefenderChecker - Windows Defender DisableRealtimeMonitoring check exited with status -1: 
    Exception in thread "DefaultDispatcher-worker-3" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
    	at kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(CoroutineExceptionHandlerImpl.common.kt:36)
    	at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:32)
    	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:117)
    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    2024-12-11 02:25:59,490 [ 103433] SEVERE - #c.i.v.l.d.i.IndexDiagnosticRunner - IdeaLoggingEvent[message=Index is corrupted, throwable=java.lang.RuntimeException: Index is corrupted
    	at com.intellij.vcs.log.data.index.IndexDiagnosticRunner.runDiagnostic(IndexDiagnosticRunner.kt:54)
    	at com.intellij.vcs.log.data.index.IndexDiagnosticRunner.indexingListener$lambda-0(IndexDiagnosticRunner.kt:28)
    	at com.intellij.vcs.log.data.index.VcsLogPersistentIndex$IndexingRequest.lambda$run$2(VcsLogPersistentIndex.java:551)
    	at com.intellij.util.containers.LockFreeCopyOnWriteArrayList.forEach(LockFreeCopyOnWriteArrayList.java:804)
    	at com.intellij.vcs.log.data.index.VcsLogPersistentIndex$IndexingRequest.run(VcsLogPersistentIndex.java:551)
    	at com.intellij.vcs.log.data.index.VcsLogPersistentIndex$MySingleTaskController.lambda$startNewBackgroundTask$0(VcsLogPersistentIndex.java:437)
    	at com.intellij.vcs.log.impl.HeavyAwareExecutor.executeOutOfHeavyOrPowerSave$lambda-3$lambda-1$lambda-0(HeavyAwareExecutor.kt:53)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:190)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:591)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:666)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:622)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:590)
    	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:177)
    	at com.intellij.vcs.log.impl.HeavyAwareExecutor.executeOutOfHeavyOrPowerSave$lambda-3$lambda-1(HeavyAwareExecutor.kt:53)
    	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
    	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    	at java.base/java.lang.Thread.run(Thread.java:833)
    ]
    
    

    I right-click in the extended UI to open the dev tool and see the following log in the console tab. It seems that postIntellijMessage can't work ,something did not load successfully:

    image

    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  jetbrains/isOSREnabled undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  getControlPlaneSessionInfo Object
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  getIdeSettings undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  config/listProfiles undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  getOpenFiles undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  config/getSerializedProfileInfo undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  onLoad undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  jetbrains/isOSREnabled undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  getControlPlaneSessionInfo Object
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  getIdeSettings undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  config/listProfiles undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  getOpenFiles undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  config/getSerializedProfileInfo undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    IdeMessenger.ts:72 Unable to send message: postIntellijMessage is undefined.  onLoad undefined
    IdeMessenger.ts:111 Attempt 0 failed. Retrying...
    
  8. AfterStories commented on Dec 10, 2024

    @AfterStories
    Author

    Hi @AfterStories - this log line leads me to believe that the GUI is not successfully connecting to the IDE when you're running the extension locally:

    Exception in thread "DefaultDispatcher-worker-17" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
    

    Can you make sure you've followed all the instructions here? https://github.com/continuedev/continue/blob/main/extensions/intellij/CONTRIBUTING.md

    As for the intended behavior of the shortcut, Cmd + J is used both to create a new session and to add code to the session.

    About this Exception ,I asked to ChatGPT

     Exception in thread "DefaultDispatcher-worker-17" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
    

    get the answer is :

    **Potential Issues and Solutions for `gradle runIde` Command:**
    
    1. **Project Components Not Initialized**:
       - **Error**: `Must be not called before project components initialized`
       - **Solution**: Ensure that all project components and plugins are fully loaded before making calls that depend on them.
    
    2. **JSQueryPool Already Created**:
       - **Error**: `JSQueryPool has already been created, this request will be ignored`
       - **Solution**: Avoid initializing the JSQueryPool multiple times. Check for redundant initializations in your code.
    
    3. **Windows Defender Check Failed**:
       - **Error**: `Windows Defender DisableRealtimeMonitoring check exited with status -1`
       - **Solution**: This indicates a failure in checking the status of Windows Defender's real-time monitoring. Ensure your development environment has the necessary permissions to perform this check, or consider disabling this check if it's not critical.
    
    4. **Class Initialization Failure**:
       - **Error**: `java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt`
       - **Solution**: This is usually caused by missing dependencies or incorrect classpath configurations. Verify that all required dependencies are correctly included in your project.
    
    5. **Index Corruption**:
       - **Error**: `Index is corrupted`
       - **Solution**: Rebuild the project index in IntelliJ IDEA by navigating to `File -> Invalidate Caches / Restart`.
    
    **General Recommendations**:
    - **Check Dependencies**: Ensure all necessary dependencies are correctly configured and downloaded.
    - **Rebuild Index**: Try rebuilding the project index in IntelliJ IDEA.
    - **Update Plugins**: Make sure you are using the latest version of the Gradle IntelliJ plugin.
    - **Review Logs**: Check the detailed logs in IntelliJ IDEA (`Help -> Show Log in Explorer/Finder`) for more information.
    
    

    So I tried to add this : kotlinx-coroutines-coreto the dependencies of build.gradle.kts, like this:

    dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
    
    But it didn't solve the problem
    
    

    verifyPluginConfiguration - Checks if Java and Kotlin compilers configuration meet IntelliJ SDK requirements
    I tried running it, ./gradlew verifyPluginConfiguration
    the result was successful :
    BUILD SUCCESSFUL in 3s 3 actionable tasks: 2 executed, 1 up-to-date Configuration cache entry reused.

    When I select a piece of code and then press CTRL+J, this error will occur,

    Exception in thread "DefaultDispatcher-worker-17" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt
    
    

    And if I press CTRL+J multiple times, an error will be reported:

    Exception in thread "Thread-6576" java.lang.IllegalArgumentException: invalid keyCode
    at java.desktop/java.awt.event.KeyEvent.<init>(KeyEvent.java:1186)
    at com.intellij.ui.jcef.JBCefEventUtils.convertCefKeyEvent(JBCefEventUtils.java:41)
    at com.intellij.ui.jcef.JBCefBrowser$2.onKeyEvent(JBCefBrowser.java:258)
    at com.intellij.ui.jcef.JBCefClient$9.lambda$onKeyEvent$1(JBCefClient.java:474)
    at com.intellij.ui.jcef.JBCefClient$HandlerSupport.lambda$handle$0(JBCefClient.java:717) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2131) at com.intellij.ui.jcef.JBCefClient$HandlerSupport.handle(JBCefClient.java:717) at com.intellij.ui.jcef.JBCefClient$HandlerSupport.handleBoolean(JBCefClient.java:722) at com.intellij.ui.jcef.JBCefClient$9.onKeyEvent(JBCefClient.java:473) at jcef/org.cef.CefClient.onKeyEvent(CefClient.java:572)
    

    I also tried to package it into an installation package
    Run ./gradlew.bat buildPlugin
    The ZIP file in ./build/distributions was successfully installed in IntelliJ, but the CTRL+ J function was not available.

  9. AfterStories commented on Dec 10, 2024

    @AfterStories
    Author

    In addition, I have modified the file : Start Core Dev Server (CE).run.xml

    Because the configuration of the original file cannot be executed on my Windows, it can be run after changing to this configuration, but I don't think this configuration should affect the communication problem between the IDE GUI layer and the IDE layer

  10. AfterStories commented on Dec 12, 2024

    @AfterStories
    Author

    According to Patrick-Erichsen comment, I think the main problem is that the kotlinx class cannot be loaded successfully, right?
    Could not initialize class kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt

    I tried to add it in build.gradle.kts, like this:

    dependencies {
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0"
    // other...
    }
    

    Then run gradlew clean build , then graldew runIde
    The same error still occurs, and the problem is not solved.

    So, I want to ask, based on the local environment configuration and error information I provided above, does anyone have any suggestions to investigate the possible cause of this problem? I am not a kotlink developer, I am not familiar with it at all, and I can't find the direction and ideas to troubleshoot the problem.

    Also, I don't understand why CTRL+ I is OK, but CTRL+J fails, and the code I selected is not added to the UI dialogue. I think the commands that the shortcut keys rely on should have the same logic.

  11. AfterStories commented on Dec 12, 2024

    @AfterStories
    Author

    I found that when I try to run ./gradlew build although Success was displayed at the end, but the following error message was output multiple times during the process:

    Error: no ComponentUI class for: com.intellij.util.ui.tree.PerFileConfigurableBase$PerFileConfigurableComboBoxAction$1[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelecte dIcon=,margin=null,paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true]`
    
    

    I don't know what the cause of this error is, and whether it is possible that this error caused me to execute Run Extension (CE) when using the shortcut key does not work.

    hi @Patrick-Erichsen Do you think this information can provide some clues?Thanks

  12. AfterStories commented on Jan 15, 2025

    @AfterStories
    Author

    now in latest 0.0.86 main branch ,fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:chatide:jetbrainskind:bugneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions