forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Aura Language Server - Request textDocument/hover failed. #1265

Closed scromiecaremore closed 2 years ago

scromiecaremore commented 5 years ago

Summary

While in a separate project folder, I try to work with JavaScript code and get complaints from the Aura Language Server in the Output window. The error is:

[Error - 1:00:10 PM] Request textDocument/hover failed. Message: Request textDocument/hover failed with message: Cannot read property 'aura' of undefined Code: -32603

This is repeated whenever I hover on any text.

Steps To Reproduce:

  1. Open VS Code.
  2. Open a non-sfdc project folder
  3. Open a javascript file
  4. Hover on any word (for instance, I hover on "return", "catch", "finally", "try".

Expected result

The error

[Error - 1:00:10 PM] Request textDocument/hover failed. Message: Request textDocument/hover failed with message: Cannot read property 'aura' of undefined Code: -32603

Should not pop up on the Output window.

Actual result

The error

[Error - 1:00:10 PM] Request textDocument/hover failed. Message: Request textDocument/hover failed with message: Cannot read property 'aura' of undefined Code: -32603

pops up on the Output window.

Additional information

image

VS Code Version: Version: 1.33.1 (user setup) Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8 Date: 2019-04-11T08:27:14.102Z Electron: 3.1.6 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 6.1.7601 SFDX CLI Version: Salesforce Extension Pack (salesforce.salesforcedx-vscode v45.10.0 OS and version: Windows 7 Enterprise SP1

pauljuneau commented 4 years ago

I am getting this output error popping up all the time even when I just have a regular apex classes open in my VS Code.

Here is the error from my output log: [Error - 9:01:08 AM] 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.uniAccept(CompletableFuture.java:659) at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:561) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:580) at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) 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.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) ... 9 more

tgentet-obrien commented 4 years ago

I started getting this with the latest update that I ran... not sure if I was before but it's started force opening the output panel and even when I click on an LWC JS File.

hiteshgodhajain commented 4 years ago

Has anyone found the resolution to this problem, the LWC Language Server in the output panel keeps opening and at this point it's becoming annoying to close it every time or resize it to a small size to hide it, which then you have to restore again to work with SFDX grrrhhh :(

joeferraro commented 4 years ago

It is extremely annoying to have the Apex Language Server panel grab focus

shridharpuntambekar-okta commented 2 years ago

Hello, I am facing the same issue. I have cloned the salesforce e-bikes app and the HTML keeps failing when hovered over the CSS classes. Extremely annoying as the output window is pulled into focus.

image
jeffb-sfdc commented 2 years ago

@scromiecaremore I'm not able to reproduce the issue you described. Are you still able to reproduce this?

If you are still able to reproduce this, could you describe the repro steps again, and add any missing details? For example, for step 2 ("Open a non-sfdc project folder"), in my project's directory I created /non-proj and then created /non-proj/test.js, and then used this for my JS file:

function test() {
  return 'this is a test';
}

When I hovered over return, I didn't get any errors.

no-response[bot] commented 2 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.