Skip to content

Commit a36b5eb

Browse files
committed
Revert "Don't use waitForFuture for open, close, change tsserver request to avoid freeze. See #160 (comment)"
This reverts commit b73e5cc.
1 parent 19ffac5 commit a36b5eb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/ts.core/src/ts/client/TypeScriptServiceClient.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,12 @@ public void openFile(String fileName, String content) throws TypeScriptException
291291

292292
@Override
293293
public void openFile(String fileName, String content, ScriptKindName scriptKindName) throws TypeScriptException {
294-
//waitForFuture(executeNoResult(new OpenRequest(fileName, null, content, scriptKindName)));
295-
executeNoResult(new OpenRequest(fileName, null, content, scriptKindName));
294+
waitForFuture(executeNoResult(new OpenRequest(fileName, null, content, scriptKindName)));
296295
}
297296

298297
@Override
299298
public void closeFile(String fileName) throws TypeScriptException {
300-
//waitForFuture(executeNoResult(new CloseRequest(fileName)));
301-
executeNoResult(new CloseRequest(fileName));
299+
waitForFuture(executeNoResult(new CloseRequest(fileName)));
302300
}
303301

304302
// @Override
@@ -311,8 +309,7 @@ public void closeFile(String fileName) throws TypeScriptException {
311309
@Override
312310
public void changeFile(String fileName, int line, int offset, int endLine, int endOffset, String insertString)
313311
throws TypeScriptException {
314-
//waitForFuture(executeNoResult(new ChangeRequest(fileName, line, offset, endLine, endOffset, insertString)));
315-
executeNoResult(new ChangeRequest(fileName, line, offset, endLine, endOffset, insertString));
312+
waitForFuture(executeNoResult(new ChangeRequest(fileName, line, offset, endLine, endOffset, insertString)));
316313
}
317314

318315
/**

0 commit comments

Comments
 (0)