Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
12.4
Description
In a sense, the thread which receives / sends LSP events is the "UI dispatch thread" - similar to Swing EDT, it cannot be blocked (for long) and definitely it cannot be blocked waiting for "user input", since there would be noone who would deliver the user input.
NetBeans already have safeguards against this, but they use either SwingUtilities (which should be changed to Mutex.EVENT), or the Mutex.EVENT - but that one lacks a special impl for LSP server environment.
In addition, it might be desirable to extend the API with something similar to EventQueue.createSecondaryLoop, that would allow any thread to wait for the 'nested' interaction to finish. Unlike createSecondaryLoop, the API should use CompletionStage so that if the LSP communication thread is the one that shoudl wait, it would terminate the current action, and complete the Stage after it receives an appropriate event.