apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.64k stars 849 forks source link

Revert: Let lsp.client display completions provided by CompletionCollector (#7505) #7528

Closed matthiasblaesing closed 3 months ago

matthiasblaesing commented 3 months ago

The PR reverts "Let lsp.client display completions provided by CompletionCollector" (#7505) as it introduces regressions for typescript editing:

java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4j.jsonrpc.messages.Either.isLeft()" because the return value of "org.eclipse.lsp4j.CompletionItem.getDocumentation()" is null
    at org.netbeans.modules.lsp.client.bindings.LspCompletionItem.lambda$resolveDocumentation$0(LspCompletionItem.java:116)
    at org.netbeans.modules.lsp.client.bindings.AbstractCompletionItem$1$1.getText(AbstractCompletionItem.java:159)
    at org.netbeans.modules.editor.completion.DocumentationScrollPane.setDocumentation(DocumentationScrollPane.java:232)
    at org.netbeans.modules.editor.completion.DocumentationScrollPane.setData(DocumentationScrollPane.java:144)
    at org.netbeans.modules.editor.completion.CompletionLayout$DocPopup.show(CompletionLayout.java:546)
    at org.netbeans.modules.editor.completion.CompletionLayout.showDocumentation(CompletionLayout.java:203)
    at org.netbeans.modules.editor.completion.CompletionImpl$11.run(CompletionImpl.java:1313)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
[catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

and general completion:

java.lang.AssertionError: AsyncCompletionTask: query=org.netbeans.modules.lsp.client.bindings.LspCompletionProviderImpl$1@31d7f5c5: query.query(): Result set not finished by resultSet.finish()
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:200)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
Caused: org.openide.util.RequestProcessor$FastItem

Context: This happens when I call for code completion in "Evaluate expression", which is now broken.

matthiasblaesing commented 3 months ago

@jtulach this PR reverts your changeset from #7505. It is meant as a last resort fix. Either there will be a real fix for the introduced regression or this needs to be merged before further LSP changes go in.

Please indicate if/when you will have a look at this?

matthiasblaesing commented 3 months ago

@mbien FYI

mbien commented 3 months ago

+10h, no comments -> merging

jtulach commented 3 months ago

Please indicate if/when you will have a look at this?

Yes, I want to take a look now, when I got a notification about the revert

matthiasblaesing commented 3 months ago

@jtulach

Yes, I want to take a look now, when I got a notification about the revert

not sure where the communication broke of, but there were two independent comments on #7505, that things broke (https://github.com/apache/netbeans/pull/7505#issuecomment-2192400361, https://github.com/apache/netbeans/pull/7505#issuecomment-2194316253), in #7528 you were explicitly pinged (https://github.com/apache/netbeans/pull/7528#issuecomment-2197259395) and requested to review.