Repository navigation
Conversation
A late response from the language server was inserted at its original offset even if the document, caret or editor input had changed in the meantime. Assisted-by: multiple AI agents and layers of automated tooling 🤖
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The regression test can pass without the freshness guard because it asserts before the independently dispatched stale response is guaranteed to be processed.
1 open issue
What changed in this PR
This PR protects HTML and Vue auto-insert operations from late language-server responses by checking that the editor still matches the request’s captured state.
Changes:
- Adds a shared
EditorSnapshotfor document, modification-stamp, and caret checks. - Guards both reconcilers against stale responses and removes Vue’s per-change console logging.
- Updates HTML caret setup in tests and adds a stale-response regression test.
| File | Description |
|---|---|
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/VueAutoInsertReconciler.java | Checks response freshness and removes debug logging. |
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/util/EditorSnapshot.java | Introduces shared editor-state capture and validation. |
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java | Checks response freshness before inserting text. |
| org.eclipse.wildwebdeveloper.tests/src/org/eclipse/wildwebdeveloper/tests/TestHTML.java | Updates caret setup and tests stale-response handling. |
Review effort: Balanced
| DisplayHelper.waitForCondition(PlatformUI.getWorkbench().getDisplay(), 5000, | ||
| () -> document.get().startsWith("<foo></foo>")), | ||
| "Autoclose not done"); | ||
| assertFalse(document.get().contains("</bar>"), "Stale response was applied"); |
This file contains hidden or 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
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.

A late auto-insert response from the HTML or Vue language server was inserted at its original offset even if the user had kept typing, moved the caret or switched the editor input, which could put closing tags or quotes in the wrong place. Both reconcilers now capture the editor state with the request in a shared
EditorSnapshotand drop the response if that state has changed. This also removes a straySystem.out.printlnthat ran on every change in Vue editors.