Repository navigation
Description
Before submitting your bug report
- I believe this is a bug. I'll try to join the Continue Discord for questions
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS:Windows
- Continue version:The latest main branch
- IDE version:IDEAC 2022.3.3Files 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 && set CONTINUE_GLOBAL_DIR=C:\Users\hzheng057\Desktop\Code\ContinueTest\continue\extensions\.continue-debug && 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
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
AfterStories commentedon Dec 9, 2024
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; }AfterStories commentedon Dec 9, 2024
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?
AfterStories commentedon Dec 9, 2024
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)AfterStories commentedon Dec 9, 2024
@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.
Patrick-Erichsen commentedon Dec 9, 2024
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:
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.
AfterStories commentedon Dec 10, 2024
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

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

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.

use node>20

run
.\scripts\install-dependencies.ps1to Install all dependenciesbefore install , I edit the binary\build.js want to only build for windows ,so I commented out other systems
GUI :

Prompt Logs:

Start Core Dev Server (CE)

When the new IntelliJ window pops up automatically,Trust

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
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:
AfterStories commentedon Dec 10, 2024
About this Exception ,I asked to ChatGPT
get the answer is :
So I tried to add this :
kotlinx-coroutines-coretothe dependencies of build.gradle.kts, like this:verifyPluginConfiguration - Checks if Java and Kotlin compilers configuration meet IntelliJ SDK requirementsI 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,
And if I press CTRL+J multiple times, an error will be reported:
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.
AfterStories commentedon Dec 10, 2024
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
AfterStories commentedon Dec 12, 2024
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.CoroutineExceptionHandlerImplKtI tried to add it in build.gradle.kts, like this:
Then run
gradlew clean build, thengraldew runIdeThe 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.
AfterStories commentedon Dec 12, 2024
I found that when I try to run
./gradlew buildalthough Success was displayed at the end, but the following error message was output multiple times during the process: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
AfterStories commentedon Jan 15, 2025
now in latest 0.0.86 main branch ,fixed