@@ -151,14 +151,17 @@ public final ITypeScriptServiceClient getClient() throws TypeScriptException {
151
151
this .client = createServiceClient (getProjectDir ());
152
152
copyListeners ();
153
153
onCreateClient (client );
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 )));
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 );
159
164
}
160
- // opens or updates the external project
161
- client .openExternalProject (projectName , rootFiles );
162
165
} catch (Exception e ) {
163
166
if (e instanceof TypeScriptException ) {
164
167
throw (TypeScriptException ) e ;
@@ -196,7 +199,8 @@ protected ITypeScriptServiceClient createServiceClient(File projectDir) throws T
196
199
File nodeFile = getProjectSettings ().getNodejsInstallPath ();
197
200
File typescriptDir = getProjectSettings ().getTypesScriptDir ();
198
201
TypeScriptServiceClient client = new TypeScriptServiceClient (getProjectDir (), typescriptDir , nodeFile ,
199
- getProjectSettings ().isEnableTelemetry (), getProjectSettings ().isDisableAutomaticTypingAcquisition (), getProjectSettings ().getTsserverPluginsFile ());
202
+ getProjectSettings ().isEnableTelemetry (), getProjectSettings ().isDisableAutomaticTypingAcquisition (),
203
+ getProjectSettings ().getTsserverPluginsFile ());
200
204
client .setCompletionEntryMatcherProvider (this );
201
205
return client ;
202
206
}
0 commit comments