XText Web - assist cancels validation [message #1794658] |
Tue, 04 September 2018 10:57  |
Eclipse User |
|
|
|
Hi
I've run into a problem with XText web editor using Ace editor.
I want to trigger auto-completion automatically whenever user changes content of the editor, or changes position of the cursor in the editor.
I've found ways to do that, but, apparently, this has created another issue - concurrent call to assist endpoint cancels currently running validate call. Validate simply returns
{ "conflict": "canceled" }
and ACE editor doesn't seem to do anything about it.
As a result, validation has practically stopped working.
It seems that cancellation is peformed by org.eclipse.xtext.web.server.model.DocumentSynchronizer, but it's hard to tell because of the weird way XTextServlet is implemented (with abstract set of "services" called via dispatcher, and everything being implemented in Xtend instead of Java doesn't help the case either).
Looking at DocumentSynchronizer it seems that it's acting as an optimistic lock of sorts, essentially failing any job on parallel execution.
It's not clear how is it possible to use XText Web at all then, since all AJAX calls to it would be asynchronous and concurrent, and they're going to cancel each other. Moreover, it's not clear why this synchronization takes effect for services like content assist and validation, that don't actually change the content - they only need read access to current state of AST.
Can anyone tell me how to circumvent the issue? Where do I even being with all this?
Thanks!
[Updated on: Tue, 04 September 2018 11:00] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04822 seconds