43
43
import ts .client .projectinfo .ProjectInfo ;
44
44
import ts .client .quickinfo .QuickInfo ;
45
45
import ts .client .references .ReferencesResponseBody ;
46
+ import ts .client .rename .RenameResponseBody ;
46
47
import ts .client .signaturehelp .SignatureHelpItems ;
47
48
import ts .internal .FileTempHelper ;
48
49
import ts .internal .SequenceHelper ;
71
72
import ts .internal .client .protocol .QuickInfoRequest ;
72
73
import ts .internal .client .protocol .ReferencesRequest ;
73
74
import ts .internal .client .protocol .ReloadRequest ;
75
+ import ts .internal .client .protocol .RenameRequest ;
74
76
import ts .internal .client .protocol .Request ;
75
77
import ts .internal .client .protocol .Response ;
76
78
import ts .internal .client .protocol .SemanticDiagnosticsSyncRequest ;
81
83
import ts .nodejs .INodejsProcessListener ;
82
84
import ts .nodejs .NodejsProcessAdapter ;
83
85
import ts .nodejs .NodejsProcessManager ;
86
+ import ts .repository .TypeScriptRepositoryManager ;
84
87
import ts .utils .FileUtils ;
85
88
86
89
/**
@@ -154,11 +157,12 @@ public TypeScriptServiceClient(final File projectDir, File tsserverFile, File no
154
157
this (projectDir , tsserverFile , nodeFile , false , false , null );
155
158
}
156
159
157
- public TypeScriptServiceClient (final File projectDir , File tsserverFile , File nodeFile , boolean enableTelemetry ,
160
+ public TypeScriptServiceClient (final File projectDir , File typescriptDir , File nodeFile , boolean enableTelemetry ,
158
161
boolean disableAutomaticTypingAcquisition , File tsserverPluginsFile ) throws TypeScriptException {
159
162
this (NodejsProcessManager .getInstance ().create (projectDir ,
160
- tsserverPluginsFile != null ? tsserverPluginsFile : tsserverFile , nodeFile ,
161
- new INodejsLaunchConfiguration () {
163
+ tsserverPluginsFile != null ? tsserverPluginsFile
164
+ : TypeScriptRepositoryManager .getTsserverFile (typescriptDir ),
165
+ nodeFile , new INodejsLaunchConfiguration () {
162
166
163
167
@ Override
164
168
public List <String > createNodeArgs () {
@@ -173,7 +177,7 @@ public List<String> createNodeArgs() {
173
177
}
174
178
if (tsserverPluginsFile != null ) {
175
179
args .add ("--typescriptDir" );
176
- args .add (FileUtils .getPath (tsserverFile . getParentFile (). getParentFile () ));
180
+ args .add (FileUtils .getPath (typescriptDir ));
177
181
}
178
182
// args.add("--useSingleInferredProject");
179
183
return args ;
@@ -386,6 +390,12 @@ public CompletableFuture<List<OccurrencesResponseItem>> occurrences(String fileN
386
390
return execute (new OccurrencesRequest (fileName , line , offset ), true );
387
391
}
388
392
393
+ @ Override
394
+ public CompletableFuture <RenameResponseBody > rename (String file , int line , int offset , Boolean findInComments ,
395
+ Boolean findInStrings ) throws TypeScriptException {
396
+ return execute (new RenameRequest (file , line , offset , findInComments , findInStrings ), true );
397
+ }
398
+
389
399
@ Override
390
400
public CompletableFuture <List <NavigationBarItem >> navbar (String fileName , IPositionProvider positionProvider )
391
401
throws TypeScriptException {
0 commit comments