Skip to content
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

Add support for skipping propagation of TextEdit #2312

Closed
mickaelistria opened this issue Nov 8, 2022 · 6 comments
Closed

Add support for skipping propagation of TextEdit #2312

mickaelistria opened this issue Nov 8, 2022 · 6 comments

Comments

@mickaelistria
Copy link
Contributor

I'm trying to use JDT-LS directly inside the Eclipse IDE, as a thread (same VM, same workspace, same JDT-Core...).
When editing the document in the IDE, the change is then sent to the LS as a didChange notification. JDT-LS assumes it owns the document thus it transform the change back into a document edit and re-applies it; then the document receives a change notification and LSP4E will then send a new didChange for it, then JDT-LS re-applies the change on the doc, then...

@rgrunber
Copy link
Contributor

rgrunber commented Nov 9, 2022

Looks like the server only supports https://github.com/eclipse/eclipse.jdt.ls/blob/c9a2d051fc084f2d658c7326956c9698d12bee46/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InitHandler.java#L180 currently. So we send the full text document on open, and incremental updates on changes.

There's an option for TextDocumentSyncKind.None. I wonder if we can make a configurable option for this (via. extended client capabilities sent on initialize) so that the server completely skips updating the document, and just goes directly to validation.

@mickaelistria
Copy link
Contributor Author

Support for TextDocumentSyncKind.None seems to be the proper approach. It might actually require some updates on client side as well, but it's worth doing things proper.
I've updated the priorities and am currently starting with simpler approaches to start JDT-LS as a separate process for a first milestone; so this is not an immediate requirement. I'll come back to this issue when there is a stronger need for it.

@rgrunber rgrunber changed the title An option to not repeat change to document when document is already driving the change Add support for TextDocumentSyncKind.None Nov 10, 2022
mickaelistria added a commit to mickaelistria/eclipse.jdt.ls that referenced this issue Nov 24, 2022
mickaelistria added a commit to mickaelistria/eclipse.jdt.ls that referenced this issue Nov 24, 2022
@mickaelistria mickaelistria changed the title Add support for TextDocumentSyncKind.None Add support for skipping propagation of TextEdit Nov 28, 2022
@mickaelistria
Copy link
Contributor Author

Current workaround: mickaelistria@57e38e3

@mickaelistria
Copy link
Contributor Author

Suggested #2423

@mickaelistria
Copy link
Contributor Author

Related PR: #2522

@mickaelistria
Copy link
Contributor Author

Fixed with #2522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants