-
Notifications
You must be signed in to change notification settings - Fork 121
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
refactor(lsp): batch updates with a zipper #1004
Merged
rgrinberg
merged 1 commit into
master
from
ps/rr/refactor_lsp___batch_updates_with_a_zipper
Jan 19, 2023
Merged
refactor(lsp): batch updates with a zipper #1004
rgrinberg
merged 1 commit into
master
from
ps/rr/refactor_lsp___batch_updates_with_a_zipper
Jan 19, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
rgrinberg
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
2 times, most recently
from
January 10, 2023 03:07
8f6bf23
to
cfa4a41
Compare
rgrinberg
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
3 times, most recently
from
January 10, 2023 15:38
b606c07
to
c78d0f2
Compare
rgrinberg
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
4 times, most recently
from
January 11, 2023 22:14
76ed9c7
to
2decda8
Compare
rgrinberg
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
from
January 12, 2023 00:22
2decda8
to
af0b870
Compare
@ulugbekna in addition to code review, it would be nice if you could test this in day to day usage. I'm doing so already, but I'm on neovim. |
rgrinberg
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
from
January 14, 2023 00:40
af0b870
to
8400ad6
Compare
I will finish the review tomorrow. Sorry for the wait
…On Sat, 14 Jan 2023 at 05:30, Rudi Grinberg ***@***.***> wrote:
@ulugbekna <https://github.com/ulugbekna> in addition to code review, it
would be nice if you could test this in day to day usage. I'm doing so
already, but I'm on neovim.
—
Reply to this email directly, view it on GitHub
<#1004 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4YR66YJPOWWK6N62TIBETWSHXTLANCNFSM6AAAAAATWB7KVE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks. Take your time. This is a sensitive PR so let's make sure to get it right.
…On Jan 16, 2023, 12:47 PM -0600, Ulugbek Abdullaev ***@***.***>, wrote:
I will finish the review tomorrow. Sorry for the wait
On Sat, 14 Jan 2023 at 05:30, Rudi Grinberg ***@***.***>
wrote:
> @ulugbekna <https://github.com/ulugbekna> in addition to code review, it
> would be nice if you could test this in day to day usage. I'm doing so
> already, but I'm on neovim.
>
> —
> Reply to this email directly, view it on GitHub
> <#1004 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD4YR66YJPOWWK6N62TIBETWSHXTLANCNFSM6AAAAAATWB7KVE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
ulugbekna
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
from
January 19, 2023 12:00
8400ad6
to
0759a17
Compare
ulugbekna
approved these changes
Jan 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased and made a couple of small changes. Hope that's okay. Let me know if not.
Looks good, great work
<!-- ps-id: f22a5053-5768-454b-9007-8e8993f80f0b -->
rgrinberg
force-pushed
the
ps/rr/refactor_lsp___batch_updates_with_a_zipper
branch
from
January 19, 2023 17:40
0759a17
to
e05e120
Compare
rgrinberg
added a commit
to rgrinberg/opam-repository
that referenced
this pull request
Jun 18, 2023
CHANGES: ## Fixes - Disable code lens by default. The support can be re-enabled by explicitly setting it in the configuration. (ocaml/ocaml-lsp#1134) - Fix initilization of `ocamlformat-rpc` in some edge cases when ocamlformat is initialized concurrently (ocaml/ocaml-lsp#1132) - Kill unnecessary `$ dune ocaml-merlin` with SIGTERM rather than SIGKILL (ocaml/ocaml-lsp#1124) - Refactor comment parsing to use `odoc-parser` and `cmarkit` instead of `octavius` and `omd` (ocaml/ocaml-lsp#1088) This allows users who migrated to omd 2.X to install ocaml-lsp-server in the same opam switch. We also slightly improved markdown generation support and fixed a couple in the generation of inline heading and module types. - Allow opening documents that were already open. This is a workaround for neovim's lsp client (ocaml/ocaml-lsp#1067) - Disable type annotation for functions (ocaml/ocaml-lsp#1054) - Respect codeActionLiteralSupport capability (ocaml/ocaml-lsp#1046) - Fix a document syncing issue when utf-16 is the position encoding (ocaml/ocaml-lsp#1004) - Disable "Type-annotate" action for code that is already annotated. ([ocaml/ocaml-lsp#1037](ocaml/ocaml-lsp#1037)), fixes [ocaml/ocaml-lsp#1036](ocaml/ocaml-lsp#1036) - Fix semantic highlighting of long identifiers when using preprocessors ([ocaml/ocaml-lsp#1049](ocaml/ocaml-lsp#1049), fixes [ocaml/ocaml-lsp#1034](ocaml/ocaml-lsp#1034)) - Fix the type of DocumentSelector in cram document registration (ocaml/ocaml-lsp#1068) - Accept the `--clientProcessId` command line argument. (ocaml/ocaml-lsp#1074) - Accept `--port` as a synonym for `--socket`. (ocaml/ocaml-lsp#1075) - Fix connecting to dune rpc on Windows. (ocaml/ocaml-lsp#1080) ## Features - Add "Remove type annotation" code action. (ocaml/ocaml-lsp#1039) - Support settings through `didChangeConfiguration` notification (ocaml/ocaml-lsp#1103) - Add "Extract local" and "Extract function" code actions. (ocaml/ocaml-lsp#870) - Depend directly on `merlin-lib` 4.9 (ocaml/ocaml-lsp#1070)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Neovim is particularly guilty of sending a ton of change notifications - essentially one for every character change. The end result is that editing large documents slows the lsp server to a crawl. The issue is somewhat mitigated by debouncing, but the delays that introduces are rather annoying.
We fix the issue by batching the updates in a single notification. We move along the WIP document using a zipper to insert the edits. In the end, we flatten everything into a string without allocating large intermediate strings. Insertions near the zipper location are fast.
@copy no more debouncing should be necessary in neovim.