vieiro opened a new issue #3812:
URL: https://github.com/apache/netbeans/issues/3812


   ### Description
   
   ide/lsp.client could make sure that the lsp server is informed about 
currently opened files in the editor immediately after start
   
   ### Use case/motivation
   
   The LSP server (clangd in this case) complaining about a request of semantic 
highlighting for files not previously opened with `didOpen`:
   
   ```
   I[10:02:13.646] <-- textDocument/semanticTokens/full("10")
   I[10:02:13.646] --> reply:textDocument/semanticTokens/full("10") 0 ms, 
error: -32602: trying to get AST for non-added document
   V[10:02:13.646] >>> {"error":{"code":-32602,"message":"trying to get AST for 
non-added document"},"id":"10","jsonrpc":"2.0"}
   
   SEVERE [org.openide.util.Exceptions]
   org.eclipse.lsp4j.jsonrpc.ResponseErrorException: trying to get AST for 
non-added document
        at 
org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
        at 
org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
        at 
org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
        at 
org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
        at 
org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
        at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
   Caused: java.util.concurrent.ExecutionException
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
   [catch] at 
org.netbeans.modules.lsp.client.bindings.MarkOccurrences.computeHighlights(MarkOccurrences.java:102)
        at 
org.netbeans.modules.lsp.client.bindings.MarkOccurrences.run(MarkOccurrences.java:82)
        at 
org.netbeans.modules.lsp.client.LSPBindings.lambda$addBackgroundTask$14(LSPBindings.java:472)
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
        at 
org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
        at 
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
   SEVERE [org.openide.util.Exceptions]
   org.eclipse.lsp4j.jsonrpc.ResponseErrorException: trying to get AST for 
non-added document
        at 
org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
        at 
org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
        at 
org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
        at 
org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
        at 
org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
        at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
   Caused: java.util.concurrent.ExecutionException
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
   [catch] at 
org.netbeans.modules.lsp.client.bindings.BreadcrumbsImpl.run(BreadcrumbsImpl.java:87)
        at 
org.netbeans.modules.lsp.client.LSPBindings.lambda$addBackgroundTask$14(LSPBindings.java:472)
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
        at 
org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
        at 
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
   ```
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow the Apache Software Foundation's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to