From af67b3523a4852967e566d5ff7fbc112e70ac315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Paku=C5=82a?= Date: Fri, 22 Sep 2023 11:21:04 +0200 Subject: [PATCH] Drop Thread.sleep from reconcilers --- .../xml/internal/autoclose/XMLAutoCloseTagReconciler.java | 6 ------ .../html/autoinsert/HTMLAutoInsertReconciler.java | 6 ------ .../vue/autoinsert/VueAutoInsertReconciler.java | 7 +------ 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/autoclose/XMLAutoCloseTagReconciler.java b/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/autoclose/XMLAutoCloseTagReconciler.java index e6d2c26ff6..09f61dc31c 100644 --- a/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/autoclose/XMLAutoCloseTagReconciler.java +++ b/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/autoclose/XMLAutoCloseTagReconciler.java @@ -124,12 +124,6 @@ private void autoInsert(DocumentEvent event) { // The document is bound with XML language server, consumes the xml/closeTag final Display display = viewer.getTextWidget().getDisplay(); CompletableFuture.supplyAsync(() -> { - try { - // Wait for textDocument/didChange - Thread.sleep(100); - } catch (InterruptedException ex) { - Thread.interrupted(); - } try { TextDocumentPositionParams params = LSPEclipseUtils .toTextDocumentPosistionParams(uri, offset, document); diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java index 0e9da59116..4c7120e9c3 100644 --- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java +++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/html/autoinsert/HTMLAutoInsertReconciler.java @@ -92,12 +92,6 @@ private void autoInsert(DocumentEvent event) { // The document is bound with HTML language server, consumes the html/autoInsert final Display display = viewer.getTextWidget().getDisplay(); CompletableFuture.supplyAsync(() -> { - try { - // Wait for textDocument/didChange - Thread.sleep(100); - } catch (InterruptedException ex) { - Thread.interrupted(); - } try { AutoInsertParams params = new AutoInsertParams(); params.setTextDocument(identifier); diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/VueAutoInsertReconciler.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/VueAutoInsertReconciler.java index 790687f635..0406783171 100644 --- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/VueAutoInsertReconciler.java +++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/VueAutoInsertReconciler.java @@ -70,12 +70,7 @@ private void autoInsert(DocumentEvent event) { // The document is bound with HTML language server, consumes the html/autoInsert final Display display = viewer.getTextWidget().getDisplay(); CompletableFuture.supplyAsync(() -> { - try { - // Wait for textDocument/didChange - Thread.sleep(100); - } catch (InterruptedException ex) { - Thread.interrupted(); - } + try { AutoInsertParams params = new AutoInsertParams();