diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 2b8b376d34059..ca1b0ba458d90 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -965,7 +965,7 @@ export function createSystemWatchFunctions({ ]; sysLog(`Enabling watchFactory ${isString(options.watchFactory) ? options.watchFactory : JSON.stringify(options.watchFactory)} from candidate paths: ${searchPaths.join(",")}`); const { resolvedModule, errorLogs, pluginConfigEntry } = resolveModule( - isString(options.watchFactory) ? { name: options.watchFactory } : options.watchFactory, + getWatchFactoryPlugin(options), searchPaths, getSystem(), sysLog @@ -983,6 +983,11 @@ export function createSystemWatchFunctions({ return setUserWatchFactory(options, /*userWatchFactory*/ undefined); } + function getWatchFactoryPlugin(options: WatchOptions) { + const plugin = isString(options.watchFactory) ? { name: options.watchFactory } : options.watchFactory!; + return options.getHost?.().getPluginWithConfigOverride(plugin) || plugin; + } + function setUserWatchFactory(options: WatchOptions, userWatchFactory: UserWatchFactory | undefined) { setWatchOptionInternalProperty(options, "getResolvedWatchFactory", userWatchFactory ? () => userWatchFactory : returnUndefined); return userWatchFactory; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 06f4c1e43239b..bad44d2c94fce 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6790,6 +6790,7 @@ export interface UserWatchFactory { /**@internal*/ export interface WatchOptionsFactoryHost { searchPaths: readonly string[]; + getPluginWithConfigOverride(plugin: PluginImport): PluginImport; } export interface WatchOptions { watchFile?: WatchFileKind; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index ede9f375d48b4..e9e4c387f4080 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -827,7 +827,7 @@ export class ProjectService { public readonly pluginProbeLocations: readonly string[]; public readonly allowLocalPluginLoads: boolean; /** @internal */ - currentPluginConfigOverrides: Map | undefined; + private currentPluginConfigOverrides: Map | undefined; public readonly typesMapLocation: string | undefined; @@ -3138,7 +3138,8 @@ export class ProjectService { /** @internal */ private setWatchOptionsFactoryHost(options: WatchOptions, canonicalConfigFilePath: NormalizedPath | undefined) { setWatchOptionInternalProperty(options, "getHost", memoize(() => ({ - searchPaths: this.getProjectPluginSearchPaths(canonicalConfigFilePath) + searchPaths: this.getProjectPluginSearchPaths(canonicalConfigFilePath), + getPluginWithConfigOverride: plugin => this.getPluginWithConfigOverride(plugin), }))); } @@ -4185,6 +4186,18 @@ export class ProjectService { return searchPaths; } + /** @internal */ + getPluginWithConfigOverride(pluginConfigEntry: PluginImport) { + const configurationOverride = this.currentPluginConfigOverrides?.get(pluginConfigEntry.name); + if (configurationOverride) { + // Preserve the name property since it's immutable + const pluginName = pluginConfigEntry.name; + pluginConfigEntry = configurationOverride; + pluginConfigEntry.name = pluginName; + } + return pluginConfigEntry; + } + /** @internal */ requestEnablePlugin(project: Project, pluginConfigEntry: PluginImport, searchPaths: string[]) { if (!this.host.importPlugin && !this.host.require) { diff --git a/src/server/project.ts b/src/server/project.ts index ba114dcaa3153..5a2df5b916c21 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1679,15 +1679,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo */ endEnablePlugin({ pluginConfigEntry, resolvedModule, errorLogs }: BeginEnablePluginResult) { if (resolvedModule) { - const configurationOverride = this.projectService.currentPluginConfigOverrides?.get(pluginConfigEntry.name); - if (configurationOverride) { - // Preserve the name property since it's immutable - const pluginName = pluginConfigEntry.name; - pluginConfigEntry = configurationOverride; - pluginConfigEntry.name = pluginName; - } - - this.enableProxy(resolvedModule, pluginConfigEntry); + this.enableProxy(resolvedModule, this.projectService.getPluginWithConfigOverride(pluginConfigEntry)); } else { forEach(errorLogs, message => this.projectService.logger.info(message)); diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js index 92d0e23a09c57..2f49d677d34f8 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js @@ -139,7 +139,7 @@ Info 10 [00:00:33.000] For info: /user/username/projects/myproject/a.ts :: Con Info 11 [00:00:34.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 12 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Info 13 [00:00:36.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js index 3509086b80dad..bdb5b79b13d61 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js @@ -136,7 +136,7 @@ Info 10 [00:00:33.000] For info: /user/username/projects/myproject/a.ts :: Con Info 11 [00:00:34.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 12 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin"} and options: {"watchFactory":"myplugin"} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":"myplugin"} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Info 13 [00:00:36.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-object.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-object.js index 92d0e23a09c57..2f49d677d34f8 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-object.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride-object.js @@ -139,7 +139,7 @@ Info 10 [00:00:33.000] For info: /user/username/projects/myproject/a.ts :: Con Info 11 [00:00:34.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 12 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Info 13 [00:00:36.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride.js index 3509086b80dad..bdb5b79b13d61 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-as-configuration-of-host-with-pluginOverride.js @@ -136,7 +136,7 @@ Info 10 [00:00:33.000] For info: /user/username/projects/myproject/a.ts :: Con Info 11 [00:00:34.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 12 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin"} and options: {"watchFactory":"myplugin"} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":"myplugin"} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Info 13 [00:00:36.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js index df5c2499c5a5d..26e56b2eea8c7 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads-object.js @@ -218,7 +218,7 @@ Info 13 [00:00:36.000] For info: /user/username/projects/myproject/a.ts :: Con Info 14 [00:00:37.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 15 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin2 from /a/pluginprobe1/node_modules -Require:: Module myplugin2 created with config: {"name":"myplugin2","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} +Require:: Module myplugin2 created with config: {"init2":"initialConfig2","name":"myplugin2"} and options: {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Custom myplugin2watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Info 16 [00:00:39.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ @@ -239,7 +239,7 @@ Info 17 [00:00:40.000] FileWatcher:: Close:: WatchInfo: /user/username/project Info 18 [00:00:41.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 19 [00:00:42.000] Local plugin loading enabled; adding /user/username/projects/myproject to search paths CustomRequire:: Resolving myplugin from /user/username/projects/myproject/node_modules -Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Info 20 [00:00:43.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js index 16a9edb829c5d..eb795f2c68600 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-allowLocalPluginLoads.js @@ -215,7 +215,7 @@ Info 13 [00:00:36.000] For info: /user/username/projects/myproject/a.ts :: Con Info 14 [00:00:37.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 15 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin2"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin2 from /a/pluginprobe1/node_modules -Require:: Module myplugin2 created with config: {"name":"myplugin2"} and options: {"watchFactory":"myplugin2"} +Require:: Module myplugin2 created with config: {"init2":"initialConfig2","name":"myplugin2"} and options: {"watchFactory":"myplugin2"} Custom myplugin2watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin2"} Info 16 [00:00:39.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ @@ -233,7 +233,7 @@ Info 17 [00:00:40.000] FileWatcher:: Close:: WatchInfo: /user/username/project Info 18 [00:00:41.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 19 [00:00:42.000] Local plugin loading enabled; adding /user/username/projects/myproject to search paths CustomRequire:: Resolving myplugin from /user/username/projects/myproject/node_modules -Require:: Module myplugin created with config: {"name":"myplugin"} and options: {"watchFactory":"myplugin"} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":"myplugin"} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Info 20 [00:00:43.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":"myplugin"} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":"myplugin"} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-object.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-object.js index fe6e9777a99a2..205d60b6ce4d9 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-object.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride-object.js @@ -218,7 +218,7 @@ Info 13 [00:00:36.000] For info: /user/username/projects/myproject/a.ts :: Con Info 14 [00:00:37.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 15 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin2 from /a/pluginprobe1/node_modules -Require:: Module myplugin2 created with config: {"name":"myplugin2","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} +Require:: Module myplugin2 created with config: {"init2":"initialConfig2","name":"myplugin2"} and options: {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Custom myplugin2watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Info 16 [00:00:39.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ @@ -238,7 +238,7 @@ Info 16 [00:00:39.000] Config: /user/username/projects/myproject/tsconfig.json Info 17 [00:00:40.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin2","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 18 [00:00:41.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Info 19 [00:00:42.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride.js index c8193b44cc2a3..e64c5caba4018 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-as-well-as-configuration-of-host-with-pluginOverride.js @@ -215,7 +215,7 @@ Info 13 [00:00:36.000] For info: /user/username/projects/myproject/a.ts :: Con Info 14 [00:00:37.000] Creating configuration project /user/username/projects/myproject/tsconfig.json Info 15 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin2"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin2 from /a/pluginprobe1/node_modules -Require:: Module myplugin2 created with config: {"name":"myplugin2"} and options: {"watchFactory":"myplugin2"} +Require:: Module myplugin2 created with config: {"init2":"initialConfig2","name":"myplugin2"} and options: {"watchFactory":"myplugin2"} Custom myplugin2watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin2"} Info 16 [00:00:39.000] Config: /user/username/projects/myproject/tsconfig.json : { "rootNames": [ @@ -232,7 +232,7 @@ Info 16 [00:00:39.000] Config: /user/username/projects/myproject/tsconfig.json Info 17 [00:00:40.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin2"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 18 [00:00:41.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin"} and options: {"watchFactory":"myplugin"} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":"myplugin"} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Info 19 [00:00:42.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":"myplugin"} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":"myplugin"} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads-object.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads-object.js index 60469b30d7bf2..635eac849ac31 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads-object.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads-object.js @@ -110,7 +110,7 @@ Info 10 [00:00:33.000] FileWatcher:: Close:: WatchInfo: /user/username/project Info 11 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 12 [00:00:35.000] Local plugin loading enabled; adding /user/username/projects/myproject to search paths CustomRequire:: Resolving myplugin from /user/username/projects/myproject/node_modules -Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Info 13 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads.js index de0cdc243ae03..ddd5b7f28d6ad 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-allowLocalPluginLoads.js @@ -107,7 +107,7 @@ Info 10 [00:00:33.000] FileWatcher:: Close:: WatchInfo: /user/username/project Info 11 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 12 [00:00:35.000] Local plugin loading enabled; adding /user/username/projects/myproject to search paths CustomRequire:: Resolving myplugin from /user/username/projects/myproject/node_modules -Require:: Module myplugin created with config: {"name":"myplugin"} and options: {"watchFactory":"myplugin"} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":"myplugin"} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Info 13 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":"myplugin"} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":"myplugin"} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-object.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-object.js index 218703f5afde3..0130352bef600 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-object.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride-object.js @@ -109,7 +109,7 @@ Info 9 [00:00:32.000] Config: /user/username/projects/myproject/tsconfig.json Info 10 [00:00:33.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 11 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"somethingelse"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Info 12 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride.js b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride.js index aa776fc21fc48..e76d9827439d9 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watchFactory-in-config-file-with-pluginOverride.js @@ -106,7 +106,7 @@ Info 9 [00:00:32.000] Config: /user/username/projects/myproject/tsconfig.json Info 10 [00:00:33.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file Info 11 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file CustomRequire:: Resolving myplugin from /a/pluginprobe1/node_modules -Require:: Module myplugin created with config: {"name":"myplugin"} and options: {"watchFactory":"myplugin"} +Require:: Module myplugin created with config: {"init":"initialConfig","name":"myplugin"} and options: {"watchFactory":"myplugin"} Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFactory":"myplugin"} Info 12 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"watchFactory":"myplugin"} Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Custom watchDirectory: /user/username/projects/myproject true {"watchFactory":"myplugin"}