Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 518631

Summary: [lsp] Orion does not consider TextDocumentSyncOptions from the server
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: ClientAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: unspecified   
Target Milestone: 15.0   
Hardware: All   
OS: All   
See Also: https://github.com/eclipse/orion.client/pull/87
Whiteboard:

Description Remy Suen CLA 2017-06-22 07:44:21 EDT
There is code in editorView.js that sends 'textDocument/didChange' notifications to the server when the backing text model has been modified.

https://github.com/eclipse/orion.client/blob/40cd394f1df05da74ed31b46833f82777f6805d9/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js#L387-L393

The code however does not consider the ServerCapabilities.textDocumentSync property. It always sends incremental changes back to the server even if a) the server doesn't want to sync any documents at all to begin with or b) only supports a full sync of the document via the transfer of its complete content.
Comment 1 Remy Suen CLA 2017-06-22 08:51:44 EDT
Fix pushed to the java-lsp branch.

https://github.com/eclipse/orion.client/commit/83ed03ca018d6f83c94fbc789fb850d9f4bfd3fd
Comment 2 Remy Suen CLA 2017-06-23 04:37:52 EDT
Fixed the synchronization code. Looks like I got it wrong and I should be including the event's text in the document as the event is sent out before the document has actually been modified.

https://github.com/eclipse/orion.client/commit/86944a9ac50b72944d8b8d2db9b1698360d46f2d
Comment 3 Eclipse Genie CLA 2017-06-23 09:39:27 EDT
GitHub Pull Request 87 created by [rcjsuen]
https://github.com/eclipse/orion.client/pull/87