| Summary: | Merge LSP support into master | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | Client | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | remy.suen, Silenio_Quarti |
| Version: | 16.0 | ||
| Target Milestone: | 18.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | 525573, 528093 | ||
| Bug Blocks: | |||
|
Description
Michael Rennie
I have merged the client-side classes into master from the branch: https://github.com/eclipse/orion.client/commit/1668a6c109a8d38f273111b8abc2cd135fb92eab they are not hooked up to the editor yet though - this is just a move / refactor. The editor.js changes: https://github.com/eclipse/orion.client/commit/136451838b0eb375e097baea3131aa3e6ca228d7 textView changes: https://github.com/eclipse/orion.client/commit/32764494a47a3282dca6ba8a0dfd1a62be9467e6 Move event range compatibility to textModel and provide it for onChanged* events as well: https://github.com/eclipse/orion.client/commit/b47c70b228580eb4c9403c159160f763c40c6c62 (In reply to Michael Rennie from comment #3) > textView changes: > > https://github.com/eclipse/orion.client/commit/ > 32764494a47a3282dca6ba8a0dfd1a62be9467e6 This commit seems to be causing selection problems in the editor. Try drag selecting in the middle of a line and move the mouse down. Only the bottom of the selection should change, but the top flickers back and forward in the line. Pushed this to fix the problem above https://github.com/eclipse/orion.client/commit/b2e56157e3ced7b371651090e7261491e677a271 The LSP / LS build files for Orion (scripts and Dockerfile): https://github.com/eclipse/orion.client/commit/26745ee4074fe2c1bb9a24b1a6a1814ccd3c175d inputManager.js changes introduced by bug 518735: https://github.com/eclipse/orion.client/commit/62e60e09849e5ce4645587be4b1022b5f190676c problems.js changes: https://github.com/eclipse/orion.client/commit/7571bc0c7f61982b9805951a8fc945be08ca2f6e This extra parameter is used by languageServer.js although nothing's going to happen right now as it's not fully setup yet. https://github.com/eclipse/orion.client/blob/e176d23591774585de3220f957f10faacdfcf70f/bundles/org.eclipse.orion.client.core/web/lsp/languageServer.js#L70 formatter.js changes: https://github.com/eclipse/orion.client/commit/f9d57f001d74c5eb21f577debb812079a70f990b outliner.js changes: https://github.com/eclipse/orion.client/commit/64afac6c7ee84a3b89f41d7ff24ec31e4a1178e9 hover.js changes: https://github.com/eclipse/orion.client/commit/d612d2b7228710145b78c08f72205112f01f3cd9 markOccurrences.js changes: https://github.com/eclipse/orion.client/commit/169c7f1b5b202cc329e069ba41b0a16840494365 There are some changes to how offsets and the text is adjusted in contentAssist.js. This is what the file looks like in the java-lsp branch: https://github.com/eclipse/orion.client/blob/a711742cfedc45710437c2c9e69e8676fae87fcc/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js#L194-L203 If you search for the string "additionalEdits" in the master branch, you will actually find nothing outside of references in org.eclipse.client.core/web/lsp/utils.js which implies that the existence and use of this additionalEdits array existed before LSP but not in Orion internally (or at least not anymore). When you dig further, you will find that this code was originally added for bug 439272 by someone who was extending Orion. https://github.com/eclipse/orion.client/commit/3b300cdb6e4dea266cd0463214855580ca866b39 The original applies the content in order and the LSP way applies the content backwards (to preserve the offsets). Presumably the original implementation used offsets that were already adjusted (I guess?). In LSP, the offsets are not adjusted. Please refer to the discussion on GitHub and the specification. https://github.com/Microsoft/language-server-protocol/issues/104 https://github.com/Microsoft/language-server-protocol/commit/e1e59508d52e7451ed8cf94bee99e5b5cbdfd99c Consider the following where the string is "12345" and you want "1x2y345". You would need to insert x at index 1 and y at index 3 (instead of 2 because the content will have shifted). insert x at index 1 insert y at index 3 Original code: 1x2345 1x2y345 LSP code: 123y45 1x23y45 So as we can see, if we apply the changes to contentAssist.js as-is from the java-lsp branch then we will break clients who are using this additionalEdits property. contentAssist.js changes minus the diff described in comment 14: https://github.com/eclipse/orion.client/commit/15c2706cf0c389b236736febd407357e5920b6e1 The support is as "merged" as it is going to get right now. I will open up separate issues as needed to track more additions. |