vscode-as3mxml icon indicating copy to clipboard operation
vscode-as3mxml copied to clipboard

Code hovering crash: NullPointerException in NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace()

Open jnpatrick99 opened this issue 5 years ago • 15 comments

I have the new problem. Started after one of the recent updates. I get around 20-30 errors on the Output while Cmd+hovering over keywords. Using version 1.1.1 on macOS 10.14.6, Apache Royale 0.9.6 (swf/js) and Java 1.8.0_201-b09 (latest update from Oracle).

Mostly happens inside .mxml files.

Apr 11, 2020 2:37:18 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace(NamespaceDefinition.java:2213)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveDirective(NamespaceDefinition.java:1785)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1877)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1834)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveNamespaceReference(NamespaceDefinition.java:1792)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetImpl(ASScope.java:552)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSet(ASScopeCache.java:420)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSet(ASScope.java:515)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForNameImpl(ASScope.java:484)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSetForName(ASScopeCache.java:614)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForName(ASScope.java:447)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1428)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:383)
	at com.as3mxml.vscode.utils.DefinitionUtils.resolveWithExtras(DefinitionUtils.java:204)
	at com.as3mxml.vscode.providers.DefinitionProvider.actionScriptDefinition(DefinitionProvider.java:135)
	at com.as3mxml.vscode.providers.DefinitionProvider.definition(DefinitionProvider.java:117)
	at com.as3mxml.vscode.ActionScriptServices.lambda$definition$3(ActionScriptServices.java:441)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	... 5 more

[Error - 2:37:18 PM] Request textDocument/definition failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace(NamespaceDefinition.java:2213)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveDirective(NamespaceDefinition.java:1785)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1877)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1834)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveNamespaceReference(NamespaceDefinition.java:1792)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetImpl(ASScope.java:552)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSet(ASScopeCache.java:420)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSet(ASScope.java:515)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForNameImpl(ASScope.java:484)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSetForName(ASScopeCache.java:614)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForName(ASScope.java:447)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1428)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:383)
	at com.as3mxml.vscode.utils.DefinitionUtils.resolveWithExtras(DefinitionUtils.java:204)
	at com.as3mxml.vscode.providers.DefinitionProvider.actionScriptDefinition(DefinitionProvider.java:135)
	at com.as3mxml.vscode.providers.DefinitionProvider.definition(DefinitionProvider.java:117)
	at com.as3mxml.vscode.ActionScriptServices.lambda$definition$3(ActionScriptServices.java:441)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	... 5 more

jnpatrick99 avatar Apr 11 '20 21:04 jnpatrick99

Looks like a bug in Royale. I'll see if I can reproduce, but I might need your help with that.

joshtynjala avatar Apr 13 '20 15:04 joshtynjala

@jnpatrick99 I tried Ctrl+click and Ctrl+hover on various keywords inside an MXML script block in a Royale project (like private, var, function, if, and for), but unfortunately, I could not reproduce this issue.

You may need to share some code with me that can consistently reproduce the issue.

joshtynjala avatar May 01 '20 16:05 joshtynjala

I am having a similar issue but its instead with the checker itself.

java.lang.NullPointerException
	at org.apache.royale.compiler.internal.as.codegen.LexicalScope.getNameFromDefinition(LexicalScope.java:1178)
	at org.apache.royale.compiler.internal.as.codegen.LexicalScope.getBinding(LexicalScope.java:1069)
	at org.apache.royale.compiler.internal.as.codegen.ABCGeneratingReducer.generateAssignment(ABCGeneratingReducer.java:1408)
	at org.apache.royale.compiler.internal.as.codegen.ABCGeneratingReducer.generateAssignment(ABCGeneratingReducer.java:1311)
	at org.apache.royale.compiler.internal.as.codegen.ABCGeneratingReducer.reduce_assignToNameExpr_to_void_expression(ABCGeneratingReducer.java:2950)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.action_237(CmcEmitter.java:4451)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:8067)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:9362)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39155)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39146)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.burm(CmcEmitter.java:39406)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateInstructions(ABCGenerator.java:233)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:398)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:352)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateFunction(ABCGenerator.java:267)
	at org.apache.royale.compiler.internal.as.codegen.ClassDirectiveProcessor.declareFunction(ClassDirectiveProcessor.java:895)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:218)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:192)
	at org.apache.royale.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareClass(GlobalDirectiveProcessor.java:460)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:210)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:192)
	at org.apache.royale.compiler.internal.as.codegen.GlobalDirectiveProcessor.declarePackage(GlobalDirectiveProcessor.java:486)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:227)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:192)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:124)
	at org.apache.royale.compiler.internal.units.ASCompilationUnit.handleABCBytesRequest(ASCompilationUnit.java:394)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:876)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:109)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:313)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:309)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2038)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker.getRequest(RequestMaker.java:188)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.getABCBytesRequest(CompilationUnitBase.java:624)
	at org.apache.royale.compiler.internal.units.ASCompilationUnit.handleOutgoingDependenciesRequest(ASCompilationUnit.java:476)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.processOutgoingDependenciesRequest(CompilationUnitBase.java:892)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.access$500(CompilationUnitBase.java:109)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$6$1.call(CompilationUnitBase.java:388)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$6$1.call(CompilationUnitBase.java:384)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2038)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker.getRequest(RequestMaker.java:188)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.getOutgoingDependenciesRequest(CompilationUnitBase.java:636)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.startBuildAsync(CompilationUnitBase.java:1095)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.startParsingImports(CompilationUnitBase.java:930)
	at org.apache.royale.compiler.internal.units.ASCompilationUnit.handleOutgoingDependenciesRequest(ASCompilationUnit.java:470)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.processOutgoingDependenciesRequest(CompilationUnitBase.java:892)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.access$500(CompilationUnitBase.java:109)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$6$1.call(CompilationUnitBase.java:388)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$6$1.call(CompilationUnitBase.java:384)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

jfmherokiller avatar May 10 '20 19:05 jfmherokiller

@jfmherokiller Yes, that appears to be a completely different issue. It isn't triggered by hover at all. It seems to be a bug in the compiler that powers code intelligence. Unfortunately, I probably won't be able to do much unless you can figure out the ActionScript code that causes that exception. I tried a few things based on what ABCGeneratingReducer.generateAssignment() is doing internally, but no luck reproducing here.

joshtynjala avatar May 11 '20 16:05 joshtynjala

I have the same problem here.

Is there a way to at least disable this error in Preferences so it wouldn't pop up infinitely? Thanks.

anastasiuspernat avatar Jul 27 '21 20:07 anastasiuspernat

@anastasiuspernat Is your stack trace the same as the original report above? If it's different, can you share it? Thanks!

There's no way to disable the error because it's a bug. It's not intentionally being shown to you.

joshtynjala avatar Jul 27 '21 20:07 joshtynjala

Thanks! Here's the log.

Caused by: java.lang.NullPointerException
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace(NamespaceDefinition.java:2213)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveDirective(NamespaceDefinition.java:1785)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1877)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1834)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveNamespaceReference(NamespaceDefinition.java:1792)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetImpl(ASScope.java:592)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSet(ASScopeCache.java:420)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSet(ASScope.java:555)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForNameImpl(ASScope.java:524)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSetForName(ASScopeCache.java:614)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForName(ASScope.java:487)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1468)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:383)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:399)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition(ASTUtils.java:441)
	at com.as3mxml.vscode.providers.ReferencesProvider.referencesForDefinitionInCompilationUnit(ReferencesProvider.java:266)
	at com.as3mxml.vscode.providers.ReferencesProvider.referencesForDefinition(ReferencesProvider.java:238)
	at com.as3mxml.vscode.providers.ReferencesProvider.actionScriptReferences(ReferencesProvider.java:148)
	at com.as3mxml.vscode.providers.ReferencesProvider.references(ReferencesProvider.java:128)
	at com.as3mxml.vscode.ActionScriptServices.references2(ActionScriptServices.java:530)
	at com.as3mxml.vscode.ActionScriptServices.lambda$references$8(ActionScriptServices.java:516)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
	... 5 more
  1. It starts randomly on the same file on the random part.
  2. It stops randomly on the same code where it happened before
  3. I tried many versions of royale including beta versions - didn't make a difference

When I simply click Ctrl there are hundreds of messages like this and the cursor gets focused on the Output pane constantly so it's impossible to edit code while this happening.

Is there a way to suppress the exception in com.as3mxml.vscode.utils.ASTUtils.findIdentifiersForDefinition?

anastasiuspernat avatar Jul 27 '21 21:07 anastasiuspernat

@anastasiuspernat It looks like you're running the "Go to references" command. That's not usually the command that is triggered in VSCode by pressing the ctrl key and clicking. Are you sure that's the only stack trace that you have in your output? I would expect to see com.as3mxml.vscode.providers.DefinitionProvider.definition in the stack trace for an exception thrown from ctrl+click.

joshtynjala avatar Jul 27 '21 21:07 joshtynjala

Hmm... I just discovered that if you run "Go to definition", and your cursor is already on the definition, VSCode automatically switches to "Go to references" instead.

@anastasiuspernat Could you share some code where you see this happening? Maybe a simple project with just one .as or .mxml, if possible?

joshtynjala avatar Jul 27 '21 21:07 joshtynjala

@joshtynjala Thanks for clarifying! Sorry the code's part of a gigantic project, when there's one/two/three files it does not happen. Also there are other exceptions.

I would really really vote to have a checkmark in Settings that suppresses all exceptions in the main code if that's possible. Thanks!

anastasiuspernat avatar Jul 29 '21 03:07 anastasiuspernat

Here's more exceptions:

Jul 29, 2021 3:29:25 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 1325
Jul 29, 2021 3:30:05 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 1372
...
...
...
Jul 29, 2021 4:33:23 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 2828
Jul 29, 2021 4:33:27 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:618)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace(NamespaceDefinition.java:2213)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveDirective(NamespaceDefinition.java:1785)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1877)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1834)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveNamespaceReference(NamespaceDefinition.java:1792)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetImpl(ASScope.java:592)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSet(ASScopeCache.java:420)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSet(ASScope.java:555)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForNameImpl(ASScope.java:524)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSetForName(ASScopeCache.java:614)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForName(ASScope.java:487)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1468)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:383)
	at com.as3mxml.vscode.utils.DefinitionUtils.resolveWithExtras(DefinitionUtils.java:173)
	at com.as3mxml.vscode.providers.HoverProvider.actionScriptHover(HoverProvider.java:140)
	at com.as3mxml.vscode.providers.HoverProvider.hover(HoverProvider.java:121)
	at com.as3mxml.vscode.ActionScriptServices.hover2(ActionScriptServices.java:368)
	at com.as3mxml.vscode.ActionScriptServices.lambda$hover$3(ActionScriptServices.java:354)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
	... 5 more

Jul 29, 2021 4:33:27 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:618)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace(NamespaceDefinition.java:2213)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveDirective(NamespaceDefinition.java:1785)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1877)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1834)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveNamespaceReference(NamespaceDefinition.java:1792)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetImpl(ASScope.java:592)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSet(ASScopeCache.java:420)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSet(ASScope.java:555)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForNameImpl(ASScope.java:524)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSetForName(ASScopeCache.java:614)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForName(ASScope.java:487)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1468)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:383)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolveType(IdentifierNode.java:458)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolveMemberRef(IdentifierNode.java:877)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:376)
	at com.as3mxml.vscode.utils.DefinitionUtils.resolveWithExtras(DefinitionUtils.java:173)
	at com.as3mxml.vscode.providers.HoverProvider.actionScriptHover(HoverProvider.java:140)
	at com.as3mxml.vscode.providers.HoverProvider.hover(HoverProvider.java:121)
	at com.as3mxml.vscode.ActionScriptServices.hover2(ActionScriptServices.java:368)
	at com.as3mxml.vscode.ActionScriptServices.lambda$hover$3(ActionScriptServices.java:354)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
	... 5 more

[Error - 4:33:27 PM] Request textDocument/hover failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:618)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.addResolvedUsedNamespace(NamespaceDefinition.java:2213)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveDirective(NamespaceDefinition.java:1785)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1877)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$NamespaceDirectiveResolver.resolveNamespaceReferenceInDirective(NamespaceDefinition.java:1834)
	at org.apache.royale.compiler.internal.definitions.NamespaceDefinition$UseNamespaceDirective.resolveNamespaceReference(NamespaceDefinition.java:1792)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetImpl(ASScope.java:592)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSet(ASScopeCache.java:420)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSet(ASScope.java:555)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForNameImpl(ASScope.java:524)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.getNamespaceSetForName(ASScopeCache.java:614)
	at org.apache.royale.compiler.internal.scopes.ASScope.getNamespaceSetForName(ASScope.java:487)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1468)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:383)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolveType(IdentifierNode.java:458)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolveMemberRef(IdentifierNode.java:877)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:376)
	at com.as3mxml.vscode.utils.DefinitionUtils.resolveWithExtras(DefinitionUtils.java:173)
	at com.as3mxml.vscode.providers.HoverProvider.actionScriptHover(HoverProvider.java:140)
	at com.as3mxml.vscode.providers.HoverProvider.hover(HoverProvider.java:121)
	at com.as3mxml.vscode.ActionScriptServices.hover2(ActionScriptServices.java:368)
	at com.as3mxml.vscode.ActionScriptServices.lambda$hover$3(ActionScriptServices.java:354)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
	... 5 more

anastasiuspernat avatar Jul 29 '21 23:07 anastasiuspernat

@anastasiuspernat Interesting! That's the first time I've seen someone report this error happening on mouse hover. Does it happen when you hover over anything, or is it a specific symbol in your code? (such as a particular class, property, or method name?)

joshtynjala avatar Jul 30 '21 16:07 joshtynjala

@joshtynjala it starts when I click ctrl over random keywords and after that it's happening constantly. The problem is that ctrl is bound to other keyboard shortcuts so every time I hit ctrl I get tons of messaging in the Output, and it gets focused.

anastasiuspernat avatar Jul 31 '21 18:07 anastasiuspernat