| Summary: | [lsp] DidChangeTextDocumentParams are sent back with incomplete parameters | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Remy Suen <remy.suen> |
| Component: | Client | Assignee: | Remy Suen <remy.suen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Olivier_Thomann |
| Version: | unspecified | ||
| Target Milestone: | 16.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fix pushed to master. https://github.com/eclipse/orion.client/commit/962d727eeae8c5af238a23ab4a082787c676436f |
The 'textDocument/didChange' notification provides range-based TextDocumentContentChangeEvents if the server requests an incremental synchronization method for the documents. /** * An event describing a change to a text document. If range and rangeLength are omitted * the new text is considered to be the full content of the document. */ interface TextDocumentContentChangeEvent { /** * The range of the document that changed. */ range?: Range; /** * The length of the range that got replaced. */ rangeLength?: number; /** * The new text of the range/document. */ text: string; } Currently, the code does not define the 'range' parameter correctly as it always sets a 'range' that has identical 'start' and 'end' positions. Its 'rangeLength' parameter however is correct so servers could technically get by. https://github.com/eclipse/orion.client/blob/83ed03ca018d6f83c94fbc789fb850d9f4bfd3fd/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js#L399-L403 https://github.com/Microsoft/language-server-protocol/issues/9 https://github.com/Microsoft/language-server-protocol/issues/53 Due to the ambiguity in the protocol, we should not rely on the server to correctly discard the 'range.end' value if 'rangeLength' is defined. A language server may instead choose to discard 'rangeLength' because 'range.end' has been defined.