@@ -29,7 +29,7 @@ namespace ts.projectSystem {
2929 }
3030 }
3131
32- function setup ( logLevel : server . LogLevel | undefined , options ?: Partial < server . StartSessionOptions > , importServicePlugin ?: server . ServerHost [ "importServicePlugin " ] ) {
32+ function setup ( logLevel : server . LogLevel | undefined , options ?: Partial < server . StartSessionOptions > , importPlugin ?: server . ServerHost [ "importPlugin " ] ) {
3333 const host = createServerHost ( [ libFile ] , { windowsStyleRoot : "c:/" } ) ;
3434 const messages : any [ ] = [ ] ;
3535 const webHost : server . WebHost = {
@@ -38,7 +38,7 @@ namespace ts.projectSystem {
3838 writeMessage : s => messages . push ( s ) ,
3939 } ;
4040 const webSys = server . createWebSystem ( webHost , emptyArray , ( ) => host . getExecutingFilePath ( ) ) ;
41- webSys . importServicePlugin = importServicePlugin ;
41+ webSys . importPlugin = importPlugin ;
4242 const logger = logLevel !== undefined ? new server . MainProcessLogger ( logLevel , webHost ) : nullLogger ( ) ;
4343 const session = new TestWorkerSession ( webSys , webHost , { serverMode : LanguageServiceMode . PartialSemantic , ...options } , logger ) ;
4444 return { getMessages : ( ) => messages , clearMessages : ( ) => messages . length = 0 , session } ;
@@ -161,7 +161,7 @@ namespace ts.projectSystem {
161161 it ( "plugins are not loaded immediately" , async ( ) => {
162162 let pluginModuleInstantiated = false ;
163163 let pluginInvoked = false ;
164- const importServicePlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
164+ const importPlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
165165 await Promise . resolve ( ) ; // simulate at least a single turn delay
166166 pluginModuleInstantiated = true ;
167167 return {
@@ -173,7 +173,7 @@ namespace ts.projectSystem {
173173 } ;
174174 } ;
175175
176- const { session } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importServicePlugin ) ;
176+ const { session } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importPlugin ) ;
177177 const projectService = session . getProjectService ( ) ;
178178
179179 session . executeCommand ( { seq : 1 , type : "request" , command : protocol . CommandTypes . Open , arguments : { file : "^memfs:/foo.ts" , content : "" } } ) ;
@@ -201,7 +201,7 @@ namespace ts.projectSystem {
201201 const pluginADeferred = Utils . defer ( ) ;
202202 const pluginBDeferred = Utils . defer ( ) ;
203203 const log : string [ ] = [ ] ;
204- const importServicePlugin = async ( _root : string , moduleName : string ) : Promise < server . ModuleImportResult > => {
204+ const importPlugin = async ( _root : string , moduleName : string ) : Promise < server . ModuleImportResult > => {
205205 log . push ( `request import ${ moduleName } ` ) ;
206206 const promise = moduleName === "plugin-a" ? pluginADeferred . promise : pluginBDeferred . promise ;
207207 await promise ;
@@ -215,7 +215,7 @@ namespace ts.projectSystem {
215215 } ;
216216 } ;
217217
218- const { session } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" , "plugin-b" ] } , importServicePlugin ) ;
218+ const { session } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" , "plugin-b" ] } , importPlugin ) ;
219219 const projectService = session . getProjectService ( ) ;
220220
221221 session . executeCommand ( { seq : 1 , type : "request" , command : protocol . CommandTypes . Open , arguments : { file : "^memfs:/foo.ts" , content : "" } } ) ;
@@ -241,15 +241,15 @@ namespace ts.projectSystem {
241241 } ) ;
242242
243243 it ( "sends projectsUpdatedInBackground event" , async ( ) => {
244- const importServicePlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
244+ const importPlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
245245 await Promise . resolve ( ) ; // simulate at least a single turn delay
246246 return {
247247 module : ( ( ) => ( { create : info => info . languageService } ) ) as server . PluginModuleFactory ,
248248 error : undefined
249249 } ;
250250 } ;
251251
252- const { session, getMessages } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importServicePlugin ) ;
252+ const { session, getMessages } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importPlugin ) ;
253253 const projectService = session . getProjectService ( ) ;
254254
255255 session . executeCommand ( { seq : 1 , type : "request" , command : protocol . CommandTypes . Open , arguments : { file : "^memfs:/foo.ts" , content : "" } } ) ;
@@ -270,7 +270,7 @@ namespace ts.projectSystem {
270270 const pluginAShouldLoad = Utils . defer ( ) ;
271271 const pluginAExternalFilesRequested = Utils . defer ( ) ;
272272
273- const importServicePlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
273+ const importPlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
274274 // wait until the initial external files are requested from the project service.
275275 await pluginAShouldLoad . promise ;
276276
@@ -287,7 +287,7 @@ namespace ts.projectSystem {
287287 } ;
288288 } ;
289289
290- const { session } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importServicePlugin ) ;
290+ const { session } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importPlugin ) ;
291291 const projectService = session . getProjectService ( ) ;
292292
293293 session . executeCommand ( { seq : 1 , type : "request" , command : protocol . CommandTypes . Open , arguments : { file : "^memfs:/foo.ts" , content : "" } } ) ;
@@ -316,7 +316,7 @@ namespace ts.projectSystem {
316316 it ( "project is closed before plugins are loaded" , async ( ) => {
317317 const pluginALoaded = Utils . defer ( ) ;
318318 const projectClosed = Utils . defer ( ) ;
319- const importServicePlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
319+ const importPlugin = async ( _root : string , _moduleName : string ) : Promise < server . ModuleImportResult > => {
320320 // mark that the plugin has started loading
321321 pluginALoaded . resolve ( ) ;
322322
@@ -328,7 +328,7 @@ namespace ts.projectSystem {
328328 } ;
329329 } ;
330330
331- const { session, getMessages } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importServicePlugin ) ;
331+ const { session, getMessages } = setup ( /*logLevel*/ undefined , { globalPlugins : [ "plugin-a" ] } , importPlugin ) ;
332332 const projectService = session . getProjectService ( ) ;
333333
334334 session . executeCommand ( { seq : 1 , type : "request" , command : protocol . CommandTypes . Open , arguments : { file : "^memfs:/foo.ts" , content : "" } } ) ;
0 commit comments