Chatted with Nathan about this. Apologies that I don't have steps to reproduce. Now 'n then, the Apex Language Server just likes to... pop up... and steal focus away from what I'm doing. It's incredibly annoying. I don't care about that panel.
I'll try to keep a better eye on whether there are reproducible steps here.. but I just remember coding stuff... probably Apex.
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
Thanks for opening this @dcstuff , please let us know when you have some steps to replicate what you are experiencing and we'll take a look at it.
So just scrolling around an Apex class, it popped up. So I cleared the log... scrolled around again.. and a few seconds later, again.
Here's the log in its entirety.
16:21:00.143 [ForkJoinPool.commonPool-worker-7] ERROR a.j.l.i.c.CodeActionsProviderAggregator - Encountered an error with code action provider apex.jorje.lsp.impl.codeActions.quickFix.DeclareMissingMethodProvider@3a0807b7
java.lang.IllegalStateException: Duplicate field: logsByEvent
at apex.common.base.Result.throwIfError(Result.java:112)
at apex.jorje.lsp.impl.index.symbol.VirtualFieldTableInitializer.create(VirtualFieldTableInitializer.java:103)
at apex.jorje.lsp.impl.index.symbol.VirtualFieldTableInitializer.get(VirtualFieldTableInitializer.java:94)
at apex.jorje.lsp.impl.index.symbol.VirtualFieldTableInitializer.get(VirtualFieldTableInitializer.java:38)
at apex.common.base.Initializers$MemoizingInitializer.get(Initializers.java:74)
at apex.jorje.semantic.symbol.type.AbstractTypeInfo.fields(AbstractTypeInfo.java:132)
at apex.jorje.semantic.symbol.resolver.VariableResolver.lookup(VariableResolver.java:171)
at apex.jorje.semantic.symbol.resolver.VariableResolver.lookup(VariableResolver.java:101)
at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupVariableInfo(StandardSymbolResolver.java:229)
at apex.jorje.semantic.ast.expression.VariableExpression.validate(VariableExpression.java:96)
at apex.jorje.semantic.ast.expression.BooleanExpression.validate(BooleanExpression.java:110)
at apex.jorje.semantic.ast.condition.StandardCondition.validate(StandardCondition.java:66)
at apex.jorje.semantic.ast.statement.IfBlockStatement.validate(IfBlockStatement.java:61)
at apex.jorje.semantic.ast.statement.IfElseBlockStatement.validate(IfElseBlockStatement.java:118)
at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154)
at apex.jorje.semantic.ast.statement.ForEachStatement.validate(ForEachStatement.java:124)
at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154)
at apex.jorje.semantic.ast.statement.IfBlockStatement.validate(IfBlockStatement.java:62)
at apex.jorje.semantic.ast.statement.IfElseBlockStatement.validate(IfElseBlockStatement.java:118)
at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154)
at apex.jorje.semantic.ast.statement.MethodBlockStatement.validate(MethodBlockStatement.java:82)
at apex.jorje.semantic.ast.member.Method.validate(Method.java:172)
at apex.jorje.semantic.ast.compilation.UserClass.validate(UserClass.java:183)
at apex.jorje.semantic.compiler.CodeUnit.validate(CodeUnit.java:220)
at apex.jorje.semantic.compiler.CompilerOperations$ValidateOperation.invoke(CompilerOperations.java:96)
at apex.jorje.semantic.compiler.CompilerStageProcessor.processFirstStage(CompilerStageProcessor.java:134)
at apex.jorje.semantic.compiler.CompilerStageProcessor.processToStage(CompilerStageProcessor.java:103)
at apex.jorje.semantic.compiler.ApexCompiler.compile(ApexCompiler.java:120)
at apex.jorje.lsp.impl.services.StandardCompilerService.compile(StandardCompilerService.java:110)
at apex.jorje.lsp.impl.services.StandardCompilerService.fetchCodeUnit(StandardCompilerService.java:159)
at apex.jorje.lsp.impl.services.StandardCompilerService.compile(StandardCompilerService.java:90)
at apex.jorje.lsp.impl.codeActions.BaseCodeActionsProvider.compileAndTraverse(BaseCodeActionsProvider.java:90)
at apex.jorje.lsp.impl.codeActions.quickFix.DeclareMissingMethodProvider.getCodeActions(DeclareMissingMethodProvider.java:78)
at apex.jorje.lsp.impl.codeActions.BaseCodeActionsProvider.lambda$provideCodeActions$0(BaseCodeActionsProvider.java:79)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at apex.jorje.lsp.impl.codeActions.BaseCodeActionsProvider.provideCodeActions(BaseCodeActionsProvider.java:77)
at apex.jorje.lsp.impl.codeActions.CodeActionsProviderAggregator.lambda$provideCodeActions$0(CodeActionsProviderAggregator.java:59)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at apex.jorje.lsp.impl.codeActions.CodeActionsProviderAggregator.provideCodeActions(CodeActionsProviderAggregator.java:57)
at apex.jorje.lsp.impl.services.StandardTextDocumentService.lambda$codeAction$7(StandardTextDocumentService.java:291)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
16:21:00.149 [ForkJoinPool.commonPool-worker-7] ERROR a.j.l.i.c.CodeActionsProviderAggregator - Encountered an error with code action provider apex.jorje.lsp.impl.codeActions.ApexCodeActionsProvider@5769e7ae
java.lang.IllegalStateException: Duplicate field: logsByEvent
at apex.common.base.Result.throwIfError(Result.java:112)
at apex.jorje.lsp.impl.index.symbol.VirtualFieldTableInitializer.create(VirtualFieldTableInitializer.java:103)
at apex.jorje.lsp.impl.index.symbol.VirtualFieldTableInitializer.get(VirtualFieldTableInitializer.java:94)
at apex.jorje.lsp.impl.index.symbol.VirtualFieldTableInitializer.get(VirtualFieldTableInitializer.java:38)
at apex.common.base.Initializers$MemoizingInitializer.get(Initializers.java:74)
at apex.jorje.semantic.symbol.type.AbstractTypeInfo.fields(AbstractTypeInfo.java:132)
at apex.jorje.semantic.symbol.resolver.VariableResolver.lookup(VariableResolver.java:171)
at apex.jorje.semantic.symbol.resolver.VariableResolver.lookup(VariableResolver.java:101)
at apex.jorje.semantic.symbol.resolver.StandardSymbolResolver.lookupVariableInfo(StandardSymbolResolver.java:229)
at apex.jorje.semantic.ast.expression.VariableExpression.validate(VariableExpression.java:96)
at apex.jorje.semantic.ast.expression.BooleanExpression.validate(BooleanExpression.java:110)
at apex.jorje.semantic.ast.condition.StandardCondition.validate(StandardCondition.java:66)
at apex.jorje.semantic.ast.statement.IfBlockStatement.validate(IfBlockStatement.java:61)
at apex.jorje.semantic.ast.statement.IfElseBlockStatement.validate(IfElseBlockStatement.java:118)
at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154)
at apex.jorje.semantic.ast.statement.ForEachStatement.validate(ForEachStatement.java:124)
at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154)
at apex.jorje.semantic.ast.statement.IfBlockStatement.validate(IfBlockStatement.java:62)
at apex.jorje.semantic.ast.statement.IfElseBlockStatement.validate(IfElseBlockStatement.java:118)
at apex.jorje.semantic.ast.statement.BlockStatement.validate(BlockStatement.java:154)
at apex.jorje.semantic.ast.statement.MethodBlockStatement.validate(MethodBlockStatement.java:82)
at apex.jorje.semantic.ast.member.Method.validate(Method.java:172)
at apex.jorje.semantic.ast.compilation.UserClass.validate(UserClass.java:183)
at apex.jorje.semantic.compiler.CodeUnit.validate(CodeUnit.java:220)
at apex.jorje.semantic.compiler.CompilerOperations$ValidateOperation.invoke(CompilerOperations.java:96)
at apex.jorje.semantic.compiler.CompilerStageProcessor.processFirstStage(CompilerStageProcessor.java:134)
at apex.jorje.semantic.compiler.CompilerStageProcessor.processToStage(CompilerStageProcessor.java:103)
at apex.jorje.semantic.compiler.ApexCompiler.compile(ApexCompiler.java:120)
at apex.jorje.lsp.impl.services.StandardCompilerService.compile(StandardCompilerService.java:110)
at apex.jorje.lsp.impl.services.StandardCompilerService.fetchCodeUnit(StandardCompilerService.java:159)
at apex.jorje.lsp.impl.services.StandardCompilerService.compile(StandardCompilerService.java:90)
at apex.jorje.lsp.impl.codeActions.ApexCodeActionsProvider.getCodeActions(ApexCodeActionsProvider.java:67)
at apex.jorje.lsp.impl.codeActions.BaseCodeActionsProvider.lambda$provideCodeActions$0(BaseCodeActionsProvider.java:79)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at apex.jorje.lsp.impl.codeActions.BaseCodeActionsProvider.provideCodeActions(BaseCodeActionsProvider.java:77)
at apex.jorje.lsp.impl.codeActions.CodeActionsProviderAggregator.lambda$provideCodeActions$0(CodeActionsProviderAggregator.java:59)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at apex.jorje.lsp.impl.codeActions.CodeActionsProviderAggregator.provideCodeActions(CodeActionsProviderAggregator.java:57)
at apex.jorje.lsp.impl.services.StandardTextDocumentService.lambda$codeAction$7(StandardTextDocumentService.java:291)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Feb 19, 2021 4:21:02 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NullPointerException
at org.eclipse.lsp4j.adapters.HoverTypeAdapter.writeContents(HoverTypeAdapter.java:82)
at org.eclipse.lsp4j.adapters.HoverTypeAdapter.write(HoverTypeAdapter.java:142)
at org.eclipse.lsp4j.adapters.HoverTypeAdapter.write(HoverTypeAdapter.java:38)
at com.google.gson.TypeAdapter$1.write(TypeAdapter.java:191)
at com.google.gson.Gson.toJson(Gson.java:669)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.write(MessageTypeAdapter.java:412)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.write(MessageTypeAdapter.java:55)
at com.google.gson.Gson.toJson(Gson.java:669)
at com.google.gson.Gson.toJson(Gson.java:648)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.serialize(MessageJsonHandler.java:143)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.serialize(MessageJsonHandler.java:138)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:59)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.lambda$handleRequest$1(RemoteEndpoint.java:281)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
... 9 more
[Error - 4:21:02 PM] Request textDocument/hover failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.NullPointerException
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NullPointerException
at org.eclipse.lsp4j.adapters.HoverTypeAdapter.writeContents(HoverTypeAdapter.java:82)
at org.eclipse.lsp4j.adapters.HoverTypeAdapter.write(HoverTypeAdapter.java:142)
at org.eclipse.lsp4j.adapters.HoverTypeAdapter.write(HoverTypeAdapter.java:38)
at com.google.gson.TypeAdapter$1.write(TypeAdapter.java:191)
at com.google.gson.Gson.toJson(Gson.java:669)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.write(MessageTypeAdapter.java:412)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.write(MessageTypeAdapter.java:55)
at com.google.gson.Gson.toJson(Gson.java:669)
at com.google.gson.Gson.toJson(Gson.java:648)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.serialize(MessageJsonHandler.java:143)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.serialize(MessageJsonHandler.java:138)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:59)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.lambda$handleRequest$1(RemoteEndpoint.java:281)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
... 9 more
I beg you not to abandon this one. This issue is the bane of my existence.
Hi @dcstuff - Thanks for the additional details. We're trying to repro this and will circle back if we have more questions.
Just bumping for an update. What does it mean that the status:needs eng review label was removed? Thanks!
Hi @dcstuff - We haven't been about to repro this one. Do you have any public repo you can point us to where we could repro this? We'd love to get it solved if we can reproduce it and get to the bottom of it.
(don't worry too much on labels - we just use these to organize within our team)
@smaddox-sf I don't have a public repo to test this in, but this is happening in each and every repo I work in. See the animated gif attached. I'm just scrolling along my code... minding my own business... when bam! The Apex Language Server panel takes over.
Here you're seeing it take over the previously displayed Salesforce CLI panel. If the terminal was not displayed all, this error would cause it to popup. WHICH IS THE WORST.
I'm using the most recent version of everything... _AND WINDOWS_... which may or may not be relevant.
The error that takes over the Apex panel is the same as what I pasted previously. I see:
Good luck to us all. And thank you.

It seems like we might be able to initialize the language client with an option to not forcibly reveal the output panel @smaddox-sf
I don't care if nothing else worked. This bug is the bane of my existence. (My _work_ existence. Let's not get too carried away.)
Heya, team. Has this ticket gotten any love over the past month? Thanks.
@dcstuff We have scheduled to fix this within the next couple of releases
THANK YOU
馃槃 sure thing, this problem is incredibly annoying. I found an older issue #1429 reporting the same thing so I'm going to close this one as a dupe and use that for tracking if that's alright.
yep yep