Skip to content

Commit 19ffac5

Browse files
committed
Revert "Check if TypeScript Runtime is >=2.0.5 to consume OpenExternalProject. See #160"
This reverts commit 03cc7a4.
1 parent 03cc7a4 commit 19ffac5

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

core/ts.core/src/ts/client/CommandNames.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public enum CommandNames {
3737
Configure("configure"),
3838
ProjectInfo("projectInfo"),
3939
Rename("rename"),
40+
OpenExternalProject("openExternalProject"),
4041

4142
// 2.0.3
4243
SemanticDiagnosticsSync("semanticDiagnosticsSync", "2.0.3"),
@@ -45,7 +46,6 @@ public enum CommandNames {
4546
// 2.0.5
4647
CompileOnSaveAffectedFileList("compileOnSaveAffectedFileList", "2.0.5"),
4748
CompileOnSaveEmitFile("compileOnSaveEmitFile", "2.0.5"),
48-
OpenExternalProject("openExternalProject", "2.0.5"),
4949

5050
// 2.0.6
5151
NavTree("navtree", "2.0.6"),

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ public CompletableFuture<ProjectInfo> projectInfo(String file, String projectFil
421421
return execute(new ProjectInfoRequest(file, needFileNameList));
422422
}
423423

424+
@Override
425+
public CompletableFuture<Void> openExternalProject(String projectFileName, List<String> rootFileNames) {
426+
return executeCausingWait(new OpenExternalProjectRequest(projectFileName, rootFileNames));
427+
}
428+
424429
// Since 2.0.3
425430

426431
@Override
@@ -450,11 +455,6 @@ public CompletableFuture<List<CompileOnSaveAffectedFileListSingleProject>> compi
450455
return execute(new CompileOnSaveAffectedFileListRequest(fileName));
451456
}
452457

453-
@Override
454-
public CompletableFuture<Void> openExternalProject(String projectFileName, List<String> rootFileNames) {
455-
return executeCausingWait(new OpenExternalProjectRequest(projectFileName, rootFileNames));
456-
}
457-
458458
// Since 2.0.6
459459

460460
@Override

core/ts.core/src/ts/resources/TypeScriptProject.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,14 @@ public final ITypeScriptServiceClient getClient() throws TypeScriptException {
151151
this.client = createServiceClient(getProjectDir());
152152
copyListeners();
153153
onCreateClient(client);
154-
if (canSupport(CommandNames.OpenExternalProject)) {
155-
// OpenExternalProject is available since 2.0.5.
156-
// determine root files and project name
157-
String projectName = projectDir.getCanonicalPath();
158-
List<String> rootFiles = new ArrayList<>();
159-
for (String tsconfigFilePath : getTsconfigFilePaths()) {
160-
rootFiles.add(FileUtils.getPath(new File(projectDir, tsconfigFilePath)));
161-
}
162-
// opens or updates the external project
163-
client.openExternalProject(projectName, rootFiles);
154+
// determine root files and project name
155+
String projectName = projectDir.getCanonicalPath();
156+
List<String> rootFiles = new ArrayList<>();
157+
for (String tsconfigFilePath : getTsconfigFilePaths()) {
158+
rootFiles.add(FileUtils.getPath(new File(projectDir, tsconfigFilePath)));
164159
}
160+
// opens or updates the external project
161+
client.openExternalProject(projectName, rootFiles);
165162
} catch (Exception e) {
166163
if (e instanceof TypeScriptException) {
167164
throw (TypeScriptException) e;
@@ -199,8 +196,7 @@ protected ITypeScriptServiceClient createServiceClient(File projectDir) throws T
199196
File nodeFile = getProjectSettings().getNodejsInstallPath();
200197
File typescriptDir = getProjectSettings().getTypesScriptDir();
201198
TypeScriptServiceClient client = new TypeScriptServiceClient(getProjectDir(), typescriptDir, nodeFile,
202-
getProjectSettings().isEnableTelemetry(), getProjectSettings().isDisableAutomaticTypingAcquisition(),
203-
getProjectSettings().getTsserverPluginsFile());
199+
getProjectSettings().isEnableTelemetry(), getProjectSettings().isDisableAutomaticTypingAcquisition(), getProjectSettings().getTsserverPluginsFile());
204200
client.setCompletionEntryMatcherProvider(this);
205201
return client;
206202
}

0 commit comments

Comments
 (0)