-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate opportunities for asynchronous operation (at least eye-candies) #14
Comments
I'm in the case of my JSON server which is started with launch VSCode-JSON doesn't give response (I don't know why?). It means that this code freeze Eclipse and I must kill it after:
It should be better to use get with a little timeout (and try several time). This timeout + number of test could be customized with eclipse preferences. We could display too a popup to the user when timeout + number of test is done "Do you want to continue to wait?". The open (or not) of the popup could be too an eclipse preferences. |
Note that with use-case #39 being fixed, this is likely to become more easily detected when debugging a language-server: the Eclipse IDE will freeze if a breakpoint happens in a synchronous operation of the UI Thread. |
Spawn a background thread, await the output there, and meanwhile present a progress dialog to the user? This is a problem already addressed in MelnormeEclipse, see https://github.com/bruno-medeiros/MelnormeEclipse/blob/master/plugin_ide.ui/src-lang/melnorme/lang/ide/ui/utils/operations/AbstractUIOperation.java and related classes. All common editor operations that rely on external tools (such as code completion, open definition, formatting) are based on AbstractUIOperation which spawns a background thread to await the output of the external tool. The UI doesn't freeze but a modal progress dialog is presented. (but only if the operation takes too long, more than 200ms or so, since it uses the workbench's The other aspect of doing things this way is that futures should be awaited by means of polling, using the |
The scope of the issue was more about really supporting asynchronous non-blocking work. Showing a progress report doesn't make it really asynchronous, as user is still stuck, it's "only" giving an eye-candy. |
Well, it depends on the operation. If it's code completion or find definition there is really no point in doing anything other that a (delayed-start) progress dialog. You could technically do it completely asynchronously and not block the workbench with a dialog, but that would be super weird - if the user edits the source it would invalidate the background operation. Or even if the user didn't modify the source, but just navigated around, when the operation completed it would show a completion popup, or move to a different file/location out of nowhere, etc. ... |
Those topics are actually part of what I imagine in supporting asynchronous: start compoutation, do not block user (let them change to another line column if that's what they want) and then when result is received, decide whether to show them or not according to whether the current state has changed. |
Let me correct my previous statement: code-completion makes sense to block the UI with a progress monitor when code completion was invoked explicitly. If it invoked automatically (because user types
What operations are those? |
@bruno-medeiros completion for example is requested in UI Thread IIRC, so it's tricky to have it fully asynchronous. https://bugs.eclipse.org/bugs/show_bug.cgi?id=251156 |
Another place where non UI blocking behavior would be welcome :) |
Replaced with https://bugs.eclipse.org/bugs/show_bug.cgi?id=508457 |
Connection with a language server is asynchronous. However, in most cases, the operations happen in the UI Thread and wait (with timeout) for the Language Server to respond. This freezes the UI.
We should investigate opportunity to introduce better support for asynchronous operations in the supported operations.
The text was updated successfully, but these errors were encountered: