continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://continue.dev/docs
Apache License 2.0
13.1k stars 890 forks source link

Jetbrains plugin not working with Ollama, but VSCode plugin is working #1382

Open rcastagno opened 1 month ago

rcastagno commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue: 0.0.47
- IDE: Intellij Idea Ultimate 2024.1.2

Description

Plugin 0.0.47 is not working, is not loading the model list, etc. Plugin 0.0.46 is loading the models from Ollama, but seems not to be working properly (I'm unable to select models, etc) Plugin 0.0.45 is loading the models from Ollama, and allows me to change model and interact with the chat, etc.

To reproduce

No response

Log output

2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR - java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.application.Application.getService(java.lang.Class)" because the return value of "com.intellij.openapi.application.ApplicationManager.getApplication()" is null
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.intellij.openapi.vfs.newvfs.ManagingFS.getInstance(ManagingFS.java:19)
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.intellij.openapi.vfs.newvfs.VfsImplUtil.extractRootFromPath(VfsImplUtil.java:203)
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.intellij.openapi.vfs.newvfs.VfsImplUtil.prepare(VfsImplUtil.java:179)
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.intellij.openapi.vfs.newvfs.VfsImplUtil.findFileByPath(VfsImplUtil.java:40)
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.findFileByPath(LocalFileSystemBase.java:115)
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient.readFile$lambda$0(IdeProtocolClient.kt:618)
2024-05-29 11:20:49,246 [ 161650]   INFO - STDERR -     at com.intellij.openapi.application.impl.RwLockHolder.runReadAction(RwLockHolder.kt:271)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:845)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient.readFile(IdeProtocolClient.kt:617)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient$handleMessage$1.invokeSuspend(IdeProtocolClient.kt:224)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
2024-05-29 11:20:49,247 [ 161651]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
2024-05-29 11:20:49,248 [ 161652]   INFO - STDERR - java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.application.Application.getService(java.lang.Class)" because the return value of "com.intellij.openapi.application.ApplicationManager.getApplication()" is null
2024-05-29 11:20:49,248 [ 161652]   INFO - STDERR -     at com.intellij.openapi.vfs.newvfs.ManagingFS.getInstance(ManagingFS.java:19)

This appears every 1-2 seconds

2024-05-29 09:31:18,291 [ 427387]   INFO - STDERR - java.io.IOException: The pipe is being closed
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/java.io.FileOutputStream.writeBytes(Native Method)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/java.io.FileOutputStream.write(FileOutputStream.java:349)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:127)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:234)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:313)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:318)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:160)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at java.base/java.io.OutputStreamWriter.flush(OutputStreamWriter.java:248)
2024-05-29 09:31:18,292 [ 427388]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.continue.CoreMessenger.write(CoreMessenger.kt:30)
2024-05-29 09:31:18,293 [ 427389]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.continue.CoreMessenger.request(CoreMessenger.kt:48)
2024-05-29 09:31:18,293 [ 427389]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.toolWindow.ContinueBrowser$1.invoke(ContinueBrowser.kt:125)
2024-05-29 09:31:18,293 [ 427389]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.toolWindow.ContinueBrowser$1.invoke(ContinueBrowser.kt:100)
2024-05-29 09:31:18,293 [ 427389]   INFO - STDERR -     at com.github.continuedev.continueintellijextension.toolWindow.ContinueBrowser._init_$lambda$0(ContinueBrowser.kt:100)
2024-05-29 09:31:18,293 [ 427389]   INFO - STDERR -     at com.intellij.ui.jcef.JBCefJSQuery$1.onQuery(JBCefJSQuery.java:123)

I found also a longer version of this trace:

2024-05-29 09:47:39,754 [1408850] SEVERE - #c.i.o.v.n.AsyncEventSupport - The pipe is being closed
java.io.IOException: The pipe is being closed
    at java.base/java.io.FileOutputStream.writeBytes(Native Method)
    at java.base/java.io.FileOutputStream.write(FileOutputStream.java:349)
    at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
    at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:127)
    at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:234)
    at java.base/sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:313)
    at java.base/sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:318)
    at java.base/sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:160)
    at java.base/java.io.OutputStreamWriter.flush(OutputStreamWriter.java:248)
    at com.github.continuedev.continueintellijextension.continue.CoreMessenger.write(CoreMessenger.kt:30)
    at com.github.continuedev.continueintellijextension.continue.CoreMessenger.request(CoreMessenger.kt:48)
    at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient.configUpdate(IdeProtocolClient.kt:537)
    at com.github.continuedev.continueintellijextension.continue.AsyncFileSaveListener$prepareChange$1.afterVfsChange(IdeProtocolClient.kt:116)
    at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.afterVfsChange(AsyncEventSupport.java:136)
    at com.intellij.openapi.vfs.newvfs.AsyncEventSupport$1.after(AsyncEventSupport.java:65)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:700)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:660)
    at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:492)
    at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:279)
    at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:449)
    at jdk.proxy2/jdk.proxy2.$Proxy88.after(Unknown Source)
    at com.intellij.util.FileContentUtilCore.lambda$reparseFiles$0(FileContentUtilCore.java:47)
    at com.intellij.openapi.application.impl.RwLockHolder.runWriteAction(RwLockHolder.kt:344)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:883)
    at com.intellij.util.FileContentUtilCore.reparseFiles(FileContentUtilCore.java:35)
    at com.intellij.util.FileContentUtil.reparseFiles(FileContentUtil.java:21)
    at com.intellij.database.psi.DbPsiFacadeImpl.reparseDependentFiles(DbPsiFacadeImpl.java:154)
    at com.intellij.database.psi.DbPsiFacadeImpl.onLanguagesChanged(DbPsiFacadeImpl.java:130)
    at com.intellij.database.psi.DbPsiFacadeImpl.clearCachesImpl(DbPsiFacadeImpl.java:100)
    at com.intellij.database.psi.DbPsiFacadeImpl$1.lambda$clearCaches$0(DbPsiFacadeImpl.java:63)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:419)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1152)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:81)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:123)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:699)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    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)
rcastagno commented 1 month ago

Curiously, the 0.0.47 seems to work just fine in Jetbrains Writerside, so maybe is a conflict among plugins?

webmasterjedi commented 1 month ago

I am having similar issues but only in one single Laravel project. The rest of my projects seem to work fine. I am using PHPStorm. It seems to have an issue index parsing all the vendor and node_modules folder, runs out of memory in nodejs (javascript heap out of memory error) and crashes, then the java pipe is being closed fires. The Model chooser UI in Continue will be empty, and say no models found. If I delete vendor and node_modules directories from my project folder, it will load continue, take a minute, then start indexing and finally show the green dot indicator.

I have hundreds of lines in my core.log that are similar to this [2024-05-29T20:21:39] Error parsing line: {"messageId":"1707ae98-cda0-4761-8ce1-0fd1a0e0a74a","messageType":"readFile","data":"\u003c?php decl...identification \u003c%s\u003e\u0027,\n $id,\n ),\n );\n }\n}\n"} SyntaxError: Unexpected token { in JSON at position 8192

It just seems to happen for this particular project.

rcastagno commented 1 month ago

I've checked and found similar errors I missed the first time, because they were at the very beginning.

May it be that my project is simply too large? (which it is, by the way, it's multiple sub-projects etc.)

rcastagno commented 1 month ago

Adding "disableIndexing": true, to the config seems to allow the plugin to fully load, so it seems to actually be something related to indexing.