Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Copilot With application.properties cause error wen trying autocomplete #1312

Open
HiltonWS opened this issue Feb 5, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@HiltonWS
Copy link

HiltonWS commented Feb 5, 2024

Hello!

When using the Copilot with Quarkus Tools I have the follow error on autocomplete:

Internal error: java.lang.reflect.InvocationTargetException

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at com.redhat.devtools.intellij.lsp4ij.LanguageServerWrapper.lambda$start$1(LanguageServerWrapper.java:360)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 11 more
Caused by: java.lang.RuntimeException
	at com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient.getProjectInfo(QuarkusLanguageClient.java:161)
	... 16 more

@angelozerr
Copy link
Contributor

Could you share your project please

@fbricon
Copy link
Contributor

fbricon commented Feb 5, 2024

  • which version of Intellij are you using?
  • I take it disabling copilot doesn't trigger the error?

@HiltonWS
Copy link
Author

HiltonWS commented Feb 26, 2024

Could you share your project please

Unfortunately its a company's project I can´t share, basically is a maven project with java Quarkus.

  • which version of Intellij are you using?
  • I take it disabling copilot doesn't trigger the error?

Without Git Copilot works like a charm :)

I also always updating the intellij for last versions

The moment I wrote was 2023.3.4

@michal-sviba-rb
Copy link

I'm using Ultimate 2024.1.2 and Quarkus Tools (1.30.1) plugin case IDE to completly freeze. Without Quarkus tools plugin IDE works fine and it is my workaround.

In Idea log is nothing special (bcs it is frozen). Something related is here:

2024-06-04 14:51:54,596 [ 33667] WARN - com.redhat.devtools.intellij.lsp4ij.internal.PromiseToCompletableFuture - Restart non blocking read action for 'getJavaDiagnostics' with attempt 1/5. com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67) at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:843) at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:791) at com.intellij.psi.stubs.StubIndexEx.getContainingIds(StubIndexEx.java:358) at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:168) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:102) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:90) at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.getClasses(JavaFullClassNameIndex.java:37) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.doFindClasses(JavaFileManagerImpl.java:82) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:105) at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:40) at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:95) at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:73) at com.intellij.psi.util.ClassUtil.findPsiClass(ClassUtil.java:182) at com.redhat.devtools.intellij.qute.psi.utils.PsiTypeUtils.findType(PsiTypeUtils.java:51) at com.redhat.devtools.intellij.qute.psi.utils.PsiQuteProjectUtils.hasQuteSupport(PsiQuteProjectUtils.java:163) at com.redhat.devtools.intellij.qute.psi.internal.java.QuarkusIntegrationForQute.diagnostics(QuarkusIntegrationForQute.java:47) at com.redhat.devtools.intellij.qute.psi.QuteSupportForJava.diagnostics(QuteSupportForJava.java:87) at com.redhat.devtools.intellij.qute.lsp.QuteLanguageClient.lambda$getJavaDiagnostics$11(QuteLanguageClient.java:193) at com.redhat.devtools.intellij.lsp4ij.internal.PromiseToCompletableFuture.lambda$nonBlockingReadActionPromise$2(PromiseToCompletableFuture.java:137) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:851) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:883) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:604) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$4(NonBlockingReadActionImpl.java:567) at com.intellij.openapi.application.impl.RwLockHolder.tryRunReadAction(RwLockHolder.kt:310) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:958) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:93) at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:138) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:100) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:100) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:135) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:93) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:567) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:466) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$2(NonBlockingReadActionImpl.java:481) 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:840)

@angelozerr
Copy link
Contributor

@michal-sviba-rb first of all we plan to do a release soon with the new LSP4IJ project and I hope it will fix your issue.

Could you share your project please.

@angelozerr angelozerr added the bug Something isn't working label Jun 26, 2024
@angelozerr
Copy link
Contributor

Hello!

When using the Copilot with Quarkus Tools I have the follow error on autocomplete:

Internal error: java.lang.reflect.InvocationTargetException

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at com.redhat.devtools.intellij.lsp4ij.LanguageServerWrapper.lambda$start$1(LanguageServerWrapper.java:360)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 11 more
Caused by: java.lang.RuntimeException
	at com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient.getProjectInfo(QuarkusLanguageClient.java:161)
	... 16 more

According to the stack trace the problem could comes from

I suspect that the problem comes from the first case. Perhaps copilot generates some file uri that we cannot take care? I don't know...

@HiltonWS could you please enable LSP trace for Tools for MicroProfile, see https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserGuide.md#lsp-console and share it your LSP traces in the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants