From f660f6b59e467777789b42122f08955d3cde1201 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 10 Mar 2023 11:49:22 -0800 Subject: [PATCH] Add allowPlugins on commandline which is needed to resolve watchFactory --- src/compiler/commandLineParser.ts | 57 +++++- src/compiler/diagnosticMessages.json | 8 + src/compiler/tsbuildPublic.ts | 3 +- src/compiler/types.ts | 1 + src/compiler/watch.ts | 12 +- src/compiler/watchPublic.ts | 8 +- src/executeCommandLine/executeCommandLine.ts | 4 +- .../unittests/reuseProgramStructure.ts | 2 +- .../unittests/tsbuild/outputPaths.ts | 2 +- .../tsbuildWatch/watchEnvironment.ts | 52 +++-- .../unittests/tsc/cancellationToken.ts | 7 +- .../unittests/tscWatch/incremental.ts | 4 +- .../unittests/tscWatch/watchEnvironment.ts | 52 +++-- .../reference/api/tsserverlibrary.d.ts | 4 +- tests/baselines/reference/api/typescript.d.ts | 4 +- .../allowPlugins/tsconfig.json | 5 + .../allowPlugins-is-in-tsconfig-object.js | 114 +++++++++++ .../allowPlugins-is-in-tsconfig.js | 114 +++++++++++ .../watchFactory/in-config-file-object.js | 6 +- .../in-config-file-with-error-object.js | 6 +- .../watchFactory/in-config-file-with-error.js | 6 +- .../watchFactory/in-config-file.js | 6 +- .../through-commandline-object.js | 6 +- .../through-commandline-with-error-object.js | 2 +- .../through-commandline-with-error.js | 2 +- .../watchFactory/through-commandline.js | 6 +- ...-host-does-not-implement-require-object.js | 6 +- .../when-host-does-not-implement-require.js | 6 +- ...in-does-not-implements-watchFile-object.js | 8 +- ...en-plugin-does-not-implements-watchFile.js | 8 +- ...n-doesnt-return-factory-function-object.js | 6 +- ...n-plugin-doesnt-return-factory-function.js | 6 +- .../when-plugin-not-found-object.js | 6 +- .../watchFactory/when-plugin-not-found.js | 6 +- .../without-allowPlugins-object.js | 104 ++++++++++ .../watchFactory/without-allowPlugins.js | 104 ++++++++++ .../allowPlugins-is-in-tsconfig-object.js | 185 ++++++++++++++++++ .../allowPlugins-is-in-tsconfig.js | 185 ++++++++++++++++++ .../watchFactory/in-config-file-object.js | 10 +- .../in-config-file-with-error-object.js | 10 +- .../watchFactory/in-config-file-with-error.js | 10 +- .../watchFactory/in-config-file.js | 10 +- .../through-commandline-object.js | 10 +- .../through-commandline-with-error-object.js | 2 +- .../through-commandline-with-error.js | 2 +- .../watchFactory/through-commandline.js | 10 +- ...-host-does-not-implement-require-object.js | 10 +- .../when-host-does-not-implement-require.js | 10 +- ...in-does-not-implements-watchFile-object.js | 14 +- ...en-plugin-does-not-implements-watchFile.js | 14 +- ...n-doesnt-return-factory-function-object.js | 10 +- ...n-plugin-doesnt-return-factory-function.js | 10 +- .../when-plugin-not-found-object.js | 10 +- .../watchFactory/when-plugin-not-found.js | 10 +- .../without-allowPlugins-object.js | 175 +++++++++++++++++ .../watchFactory/without-allowPlugins.js | 175 +++++++++++++++++ 56 files changed, 1455 insertions(+), 170 deletions(-) create mode 100644 tests/baselines/reference/config/showConfig/Shows tsconfig for single option/allowPlugins/tsconfig.json create mode 100644 tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js create mode 100644 tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js create mode 100644 tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js create mode 100644 tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins.js create mode 100644 tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js create mode 100644 tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js create mode 100644 tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js create mode 100644 tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins.js diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index d64e08712da14..3e233f4928598 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -62,9 +62,11 @@ import { getSupportedExtensions, getSupportedExtensionsWithJsonIfResolveJsonModule, getTextOfPropertyName, + getTsConfigObjectLiteralExpression, getTsConfigPropArrayElementValue, hasExtension, hasProperty, + identity, ImportsNotUsedAsValues, isArray, isArrayLiteralExpression, @@ -527,6 +529,14 @@ export const commonOptionsWithBuild: CommandLineOption[] = [ description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, defaultValueDescription: Diagnostics.Platform_specific }, + { + name: "allowPlugins", + type: "boolean", + category: Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: Diagnostics.Allow_running_plugins, + defaultValueDescription: false, + }, ]; /** @internal */ @@ -1821,6 +1831,10 @@ export function parseCommandLineWorker( const errors: Diagnostic[] = []; parseStrings(commandLine); + if (options.watch && watchOptions?.watchFactory && !options.allowPlugins) { + errors.push(createCompilerDiagnostic(Diagnostics.Option_watchFactory_cannot_be_specified_without_passing_allowPlugins_on_command_line)); + watchOptions.watchFactory = undefined; + } return { options, watchOptions, @@ -2098,6 +2112,7 @@ export function getParsedCommandLineOfConfigFile( extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[], + checkAllowPlugins?: boolean, ): ParsedCommandLine | undefined { const configFileText = tryReadFile(configFileName, fileName => host.readFile(fileName)); if (!isString(configFileText)) { @@ -2119,7 +2134,8 @@ export function getParsedCommandLineOfConfigFile( /*resolutionStack*/ undefined, extraFileExtensions, extendedConfigCache, - watchOptionsToExtend + watchOptionsToExtend, + checkAllowPlugins, ); } @@ -2854,9 +2870,20 @@ export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, bas * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ -export function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map, existingWatchOptions?: WatchOptions): ParsedCommandLine { +export function parseJsonSourceFileConfigFileContent( + sourceFile: TsConfigSourceFile, + host: ParseConfigHost, + basePath: string, + existingOptions?: CompilerOptions, + configFileName?: string, + resolutionStack?: Path[], + extraFileExtensions?: readonly FileExtensionInfo[], + extendedConfigCache?: Map, + existingWatchOptions?: WatchOptions, + checkAllowPlugins?: boolean, +): ParsedCommandLine { tracing?.push(tracing.Phase.Parse, "parseJsonSourceFileConfigFileContent", { path: sourceFile.fileName }); - const result = parseJsonConfigFileContentWorker(/*json*/ undefined, sourceFile, host, basePath, existingOptions, existingWatchOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache); + const result = parseJsonConfigFileContentWorker(/*json*/ undefined, sourceFile, host, basePath, existingOptions, existingWatchOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, checkAllowPlugins); tracing?.pop(); return result; } @@ -2900,7 +2927,8 @@ function parseJsonConfigFileContentWorker( configFileName?: string, resolutionStack: Path[] = [], extraFileExtensions: readonly FileExtensionInfo[] = [], - extendedConfigCache?: Map + extendedConfigCache?: Map, + checkAllowPlugins?: boolean, ): ParsedCommandLine { Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); const errors: Diagnostic[] = []; @@ -2912,6 +2940,21 @@ function parseJsonConfigFileContentWorker( extend(existingWatchOptions || {}, parsedConfig.watchOptions || {}) : undefined; + if (options.watch && watchOptions?.watchFactory && checkAllowPlugins && !options.allowPlugins) { + const watchFactoryNameProp = forEachPropertyAssignment( + getTsConfigObjectLiteralExpression(sourceFile), + "watchOptions", + prop => isObjectLiteralExpression(prop.initializer) ? + forEachPropertyAssignment(prop.initializer, "watchFactory", watchFactoryProp => isObjectLiteralExpression(watchFactoryProp.initializer) ? + forEachPropertyAssignment(watchFactoryProp.initializer, "name", identity) || watchFactoryProp : + watchFactoryProp + ) : + undefined + ); + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, watchFactoryNameProp?.name, Diagnostics.Option_watchFactory_cannot_be_specified_without_passing_allowPlugins_on_command_line)); + watchOptions.watchFactory = undefined; + } + options.configFilePath = configFileName && normalizeSlashes(configFileName); const configFileSpecs = getConfigFileSpecs(); if (sourceFile) sourceFile.configFileSpecs = configFileSpecs; @@ -3535,7 +3578,11 @@ export function convertJsonOption( convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression as ArrayLiteralExpression | undefined, sourceFile) : convertJsonOption(opt.element, value, basePath, errors, propertyAssignment, valueExpression, sourceFile); } - else if (!isString(opt.type)) { + if (opt.isCommandLineOnly) { + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.Option_0_can_only_be_specified_on_command_line, opt.name)); + return; + } + if (!isString(opt.type)) { return convertJsonOptionOfCustomType(opt as CommandLineOptionOfCustomType, value as string, errors, valueExpression, sourceFile); } const validatedValue = validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3666f73db9036..8260eb8636139 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4337,6 +4337,10 @@ "category": "Error", "code": 5109 }, + "Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line.": { + "category": "Error", + "code": 5110 + }, "Generates a sourcemap for each corresponding '.d.ts' file.": { "category": "Message", @@ -6107,6 +6111,10 @@ "category": "Message", "code": 6804 }, + "Allow running plugins.": { + "category": "Message", + "code": 6805 + }, "one of:": { "category": "Message", diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 95668468d36f0..b0b45c00aafae 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -161,6 +161,7 @@ export interface BuildOptions { /** @internal */ locale?: string; /** @internal */ generateCpuProfile?: string; /** @internal */ generateTrace?: string; + /** @internal */ allowPlugins?: boolean; [option: string]: CompilerOptionsValue | undefined; } @@ -567,7 +568,7 @@ function parseConfigFile(state: SolutionBuilderState diagnostic = d; - parsed = getParsedCommandLineOfConfigFile(configFileName, baseCompilerOptions, parseConfigFileHost, extendedConfigCache, baseWatchOptions); + parsed = getParsedCommandLineOfConfigFile(configFileName, baseCompilerOptions, parseConfigFileHost, extendedConfigCache, baseWatchOptions, /*extraFileExtensions*/ undefined, state.hostWithWatch.checkAllowPlugins); parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = noop; } configFileCache.set(configFilePath, parsed || diagnostic!); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e7883c7c88862..caa029b0d65fc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7158,6 +7158,7 @@ export interface CompilerOptions { */ pathsBasePath?: string; /** @internal */ plugins?: PluginImport[]; + /** @internal */ allowPlugins?: boolean; preserveConstEnums?: boolean; noImplicitOverride?: boolean; preserveSymlinks?: boolean; diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 682430f0776f0..1dc381bb71599 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -213,10 +213,18 @@ export function createWatchStatusReporter(system: System, pretty?: boolean): Wat * * @internal */ -export function parseConfigFileWithSystem(configFileName: string, optionsToExtend: CompilerOptions, extendedConfigCache: Map | undefined, watchOptionsToExtend: WatchOptions | undefined, system: System, reportDiagnostic: DiagnosticReporter): ParsedCommandLine | undefined { +export function parseConfigFileWithSystem( + configFileName: string, + optionsToExtend: CompilerOptions, + extendedConfigCache: Map | undefined, + watchOptionsToExtend: WatchOptions | undefined, + system: System, + reportDiagnostic: DiagnosticReporter, + checkAllowPlugins: boolean, +): ParsedCommandLine | undefined { const host: ParseConfigFileHost = system as any; host.onUnRecoverableConfigFileDiagnostic = diagnostic => reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); - const result = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend); + const result = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend, /*extraFileExtensions*/ undefined, checkAllowPlugins); host.onUnRecoverableConfigFileDiagnostic = undefined!; // TODO: GH#18217 return result; } diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index fec0b5e34611b..332dc64b7d246 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -161,6 +161,7 @@ export interface WatchHost { setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; /** If provided, will be used to reset existing delayed compilation */ clearTimeout?(timeoutId: any): void; + /** @internal */ checkAllowPlugins?: boolean; } export interface ProgramHost { /** @@ -902,7 +903,8 @@ export function createWatchProgram(host: WatchCompiler parseConfigFileHost, extendedConfigCache ||= new Map(), watchOptionsToExtend, - extraFileExtensions + extraFileExtensions, + host.checkAllowPlugins, )!); // TODO: GH#18217 } @@ -962,7 +964,9 @@ export function createWatchProgram(host: WatchCompiler /*optionsToExtend*/ undefined, parseConfigFileHost, extendedConfigCache ||= new Map(), - watchOptionsToExtend + watchOptionsToExtend, + host.extraFileExtensions, + host.checkAllowPlugins, ); parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = onUnRecoverableConfigFileDiagnostic; return parsedCommandLine; diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/executeCommandLine/executeCommandLine.ts index 7ea7917d36853..5608376411d7e 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/executeCommandLine/executeCommandLine.ts @@ -645,7 +645,7 @@ function executeCommandLineWorker( ); if (configFileName) { const extendedConfigCache = new Map(); - const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys, reportDiagnostic)!; // TODO: GH#18217 + const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys, reportDiagnostic, /*checkAllowPlugins*/ true)!; // TODO: GH#18217 if (commandLineOptions.showConfig) { if (configParseResult.errors.length !== 0) { reportDiagnostic = updateReportDiagnostic( @@ -847,6 +847,7 @@ function performBuild( ); const solutionPerformance = enableSolutionPerformance(sys, buildOptions); updateSolutionBuilderHost(sys, cb, buildHost, solutionPerformance); + buildHost.checkAllowPlugins = true; const onWatchStatusChange = buildHost.onWatchStatusChange; let reportBuildStatistics = false; buildHost.onWatchStatusChange = (d, newLine, options, errorCount) => { @@ -979,6 +980,7 @@ function updateWatchCompilationHost( cb: ExecuteCommandLineCallbacks, watchCompilerHost: WatchCompilerHost, ) { + watchCompilerHost.checkAllowPlugins = true; updateCreateProgram(sys, watchCompilerHost, /*isBuildMode*/ false); const emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate!; // TODO: GH#18217 watchCompilerHost.afterProgramCreate = builderProgram => { diff --git a/src/testRunner/unittests/reuseProgramStructure.ts b/src/testRunner/unittests/reuseProgramStructure.ts index e987263cd81c3..d1d46a01f3e35 100644 --- a/src/testRunner/unittests/reuseProgramStructure.ts +++ b/src/testRunner/unittests/reuseProgramStructure.ts @@ -586,7 +586,7 @@ describe("unittests:: Reuse program structure:: isProgramUptoDate", () => { configFileName, system })).getCurrentProgram().getProgram(); - const { fileNames, options } = ts.parseConfigFileWithSystem(configFileName, {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, ts.notImplemented)!; // TODO: GH#18217 + const { fileNames, options } = ts.parseConfigFileWithSystem(configFileName, {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, ts.notImplemented, /*checkAllowPlugins*/ true)!; // TODO: GH#18217 verifyProgramIsUptoDate(program, fileNames, options); } diff --git a/src/testRunner/unittests/tsbuild/outputPaths.ts b/src/testRunner/unittests/tsbuild/outputPaths.ts index 9623743ed4de3..261d373df98d9 100644 --- a/src/testRunner/unittests/tsbuild/outputPaths.ts +++ b/src/testRunner/unittests/tsbuild/outputPaths.ts @@ -32,7 +32,7 @@ describe("unittests:: tsbuild - output file paths", () => { assert.deepEqual( ts.getOutputFileNames( - ts.parseConfigFileWithSystem("/src/tsconfig.json", {}, /*extendedConfigCache*/ undefined, {}, sys, ts.noop)!, + ts.parseConfigFileWithSystem("/src/tsconfig.json", {}, /*extendedConfigCache*/ undefined, {}, sys, ts.noop, /*checkAllowPlugins*/ true)!, "/src/src/index.ts", /*ignoreCase*/ false ), diff --git a/src/testRunner/unittests/tsbuildWatch/watchEnvironment.ts b/src/testRunner/unittests/tsbuildWatch/watchEnvironment.ts index 70765d6690940..80ee8b8f1af22 100644 --- a/src/testRunner/unittests/tsbuildWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tsbuildWatch/watchEnvironment.ts @@ -128,7 +128,7 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi describe("watchFactory", () => { verifyWatchFactory({ subScenario: `watchFactory/in config file`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--allowPlugins"], sys: createSystemWithFactory, edits: [ { @@ -146,7 +146,7 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi verifyWatchFactory({ subScenario: `watchFactory/in config file with error`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--allowPlugins"], sys: createSystemWithFactory, edits: [ { @@ -186,7 +186,7 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi verifyWatchFactory({ subScenario: `watchFactory/when plugin not found`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--allowPlugins"], sys: watchOptions => { const system = createSystem(watchOptions); system.require = (initialPath, moduleName) => { @@ -209,8 +209,8 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi verifyWatchFactory({ subScenario: `watchFactory/when plugin does not implements watchFile`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], - sys: watchOptions => createSystemWithFactory(watchOptions, /*excludeWatchFile*/ true), + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--allowPlugins"], + sys: watchOptions => createSystemWithFactory(watchOptions, /*compilerOptions*/ undefined, /*excludeWatchFile*/ true), edits: [ { caption: "Change file", @@ -232,7 +232,7 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi verifyWatchFactory({ subScenario: `watchFactory/when plugin doesnt return factory function`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--allowPlugins"], sys: watchOptions => { const system = createSystem(watchOptions); system.require = (initialPath, moduleName) => { @@ -255,7 +255,7 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi verifyWatchFactory({ subScenario: `watchFactory/when host does not implement require`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--allowPlugins"], sys: createSystem, edits: [ { @@ -266,10 +266,36 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi ] }, "myplugin"); - function createSystem(watchOptions?: ts.WatchOptions) { + verifyWatchFactory({ + subScenario: `watchFactory/without allowPlugins`, + commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + sys: () => createSystemWithFactory({ watchFactory: "myplugin" }), + edits: [ + { + caption: "Change file", + edit: sys => sys.appendFile(`/user/username/projects/myproject/b.ts`, "export function foo() { }"), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ] + }, "myplugin"); + + verifyWatchFactory({ + subScenario: `watchFactory/allowPlugins is in tsconfig`, + commandLineArgs: ["-b", "-w", "--extendedDiagnostics"], + sys: watchOptions => createSystemWithFactory(watchOptions, { allowPlugins: true }), + edits: [ + { + caption: "Change file", + edit: sys => sys.appendFile(`/user/username/projects/myproject/b.ts`, "export function foo() { }"), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ] + }, "myplugin"); + + function createSystem(watchOptions?: ts.WatchOptions, compilerOptions?: ts.CompilerOptions) { const configFile: File = { path: `/user/username/projects/myproject/tsconfig.json`, - content: JSON.stringify({ watchOptions }) + content: JSON.stringify({ watchOptions, compilerOptions }) }; const aTs: File = { path: `/user/username/projects/myproject/a.ts`, @@ -283,8 +309,8 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi return createWatchFactorySystem(createWatchedSystem([aTs, bTs, configFile, libFile], { currentDirectory: "/user/username/projects/myproject" })); } - function createSystemWithFactory(watchOptions?: ts.WatchOptions, excludeWatchFile?: boolean) { - return implementRequireForWatchFactorySystem(createSystem(watchOptions), !!excludeWatchFile); + function createSystemWithFactory(watchOptions?: ts.WatchOptions, compilerOptions?: ts.CompilerOptions, excludeWatchFile?: boolean) { + return implementRequireForWatchFactorySystem(createSystem(watchOptions, compilerOptions), !!excludeWatchFile); } function verifyWatchFactory( @@ -311,13 +337,13 @@ describe("unittests:: tsbuildWatch:: watchEnvironment:: tsbuild:: watchMode:: wi verifyTscWatch({ scenario: "watchEnvironment", ...input, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--watchFactory", watchFactory], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--watchFactory", watchFactory, "--allowPlugins"], }); verifyTscWatch({ scenario: "watchEnvironment", ...input, subScenario: `${input.subScenario} object`, - commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--watchFactory", JSON.stringify({ name: watchFactory, myconfig: "somethingelse" })], + commandLineArgs: ["-b", "-w", "--extendedDiagnostics", "--watchFactory", JSON.stringify({ name: watchFactory, myconfig: "somethingelse" }), "--allowPlugins"], }); } }); diff --git a/src/testRunner/unittests/tsc/cancellationToken.ts b/src/testRunner/unittests/tsc/cancellationToken.ts index 04eeb68ebbad0..fdb399e0252bd 100644 --- a/src/testRunner/unittests/tsc/cancellationToken.ts +++ b/src/testRunner/unittests/tsc/cancellationToken.ts @@ -61,10 +61,11 @@ describe("unittests:: tsc:: builder cancellationToken", () => { const parsedConfig = ts.parseConfigFileWithSystem( "tsconfig.json", {}, - /*extendedConfigCache*/ undefined, - /*watchOptionsToExtend*/ undefined, + /*extendedConfigCache*/ undefined, + /*watchOptionsToExtend*/ undefined, sys, - reportDiagnostic + reportDiagnostic, + /*checkAllowPlugins*/ true, )!; const host = ts.createIncrementalCompilerHost(parsedConfig.options, sys); let programs: CommandLineProgram[] = ts.emptyArray; diff --git a/src/testRunner/unittests/tscWatch/incremental.ts b/src/testRunner/unittests/tscWatch/incremental.ts index bc73995f46282..7888a4277ba04 100644 --- a/src/testRunner/unittests/tscWatch/incremental.ts +++ b/src/testRunner/unittests/tscWatch/incremental.ts @@ -154,7 +154,7 @@ describe("unittests:: tsc-watch:: emit file --incremental", () => { it("verify that state is read correctly", () => { const system = createWatchedSystem([libFile, file1, fileModified, config], { currentDirectory: project }); const reportDiagnostic = ts.createDiagnosticReporter(system); - const parsedConfig = ts.parseConfigFileWithSystem("tsconfig.json", {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, reportDiagnostic)!; + const parsedConfig = ts.parseConfigFileWithSystem("tsconfig.json", {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, reportDiagnostic, /*checkAllowPlugins*/ true)!; ts.performIncrementalCompilation({ rootNames: parsedConfig.fileNames, options: parsedConfig.options, @@ -164,7 +164,7 @@ describe("unittests:: tsc-watch:: emit file --incremental", () => { system }); - const command = ts.parseConfigFileWithSystem("tsconfig.json", {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, ts.noop)!; + const command = ts.parseConfigFileWithSystem("tsconfig.json", {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, ts.noop, /*checkAllowPlugins*/ true)!; const builderProgram = ts.createIncrementalProgram({ rootNames: command.fileNames, options: command.options, diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index eb0ea1d37a87e..a8978ab548d5a 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -718,7 +718,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po describe("watchFactory", () => { verifyWatchFactory({ subScenario: `watchFactory/in config file`, - commandLineArgs: ["-w", "--extendedDiagnostics"], + commandLineArgs: ["-w", "--extendedDiagnostics", "--allowPlugins"], sys: createSystemWithFactory, edits: [ { @@ -736,7 +736,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po verifyWatchFactory({ subScenario: `watchFactory/in config file with error`, - commandLineArgs: ["-w", "--extendedDiagnostics"], + commandLineArgs: ["-w", "--extendedDiagnostics", "--allowPlugins"], sys: createSystemWithFactory, edits: [ { @@ -776,7 +776,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po verifyWatchFactory({ subScenario: `watchFactory/when plugin not found`, - commandLineArgs: ["-w", "--extendedDiagnostics"], + commandLineArgs: ["-w", "--extendedDiagnostics", "--allowPlugins"], sys: watchOptions => { const system = createSystem(watchOptions); system.require = (initialPath, moduleName) => { @@ -799,8 +799,8 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po verifyWatchFactory({ subScenario: `watchFactory/when plugin does not implements watchFile`, - commandLineArgs: ["-w", "--extendedDiagnostics"], - sys: watchOptions => createSystemWithFactory(watchOptions, /*excludeWatchFile*/ true), + commandLineArgs: ["-w", "--extendedDiagnostics", "--allowPlugins"], + sys: watchOptions => createSystemWithFactory(watchOptions, /*compilerOptions*/ undefined, /*excludeWatchFile*/ true), edits: [ { caption: "Change file", @@ -822,7 +822,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po verifyWatchFactory({ subScenario: `watchFactory/when plugin doesnt return factory function`, - commandLineArgs: ["-w", "--extendedDiagnostics"], + commandLineArgs: ["-w", "--extendedDiagnostics", "--allowPlugins"], sys: watchOptions => { const system = createSystem(watchOptions); system.require = (initialPath, moduleName) => { @@ -845,7 +845,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po verifyWatchFactory({ subScenario: `watchFactory/when host does not implement require`, - commandLineArgs: ["-w", "--extendedDiagnostics"], + commandLineArgs: ["-w", "--extendedDiagnostics", "--allowPlugins"], sys: createSystem, edits: [ { @@ -856,10 +856,36 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po ] }, "myplugin"); - function createSystem(watchOptions?: ts.WatchOptions) { + verifyWatchFactory({ + subScenario: `watchFactory/without allowPlugins`, + commandLineArgs: ["-w", "--extendedDiagnostics"], + sys: () => createSystemWithFactory({ watchFactory: "myplugin" }), + edits: [ + { + caption: "Change file", + edit: sys => sys.appendFile(`/user/username/projects/myproject/b.ts`, "export function foo() { }"), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ] + }, "myplugin"); + + verifyWatchFactory({ + subScenario: `watchFactory/allowPlugins is in tsconfig`, + commandLineArgs: ["-w", "--extendedDiagnostics"], + sys: watchOptions => createSystemWithFactory(watchOptions, { allowPlugins: true }), + edits: [ + { + caption: "Change file", + edit: sys => sys.appendFile(`/user/username/projects/myproject/b.ts`, "export function foo() { }"), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ] + }, "myplugin"); + + function createSystem(watchOptions?: ts.WatchOptions, compilerOptions?: ts.CompilerOptions) { const configFile: File = { path: `/user/username/projects/myproject/tsconfig.json`, - content: JSON.stringify({ watchOptions }) + content: JSON.stringify({ watchOptions, compilerOptions }) }; const aTs: File = { path: `/user/username/projects/myproject/a.ts`, @@ -873,8 +899,8 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po return createWatchFactorySystem(createWatchedSystem([aTs, bTs, configFile, libFile], { currentDirectory: "/user/username/projects/myproject" })); } - function createSystemWithFactory(watchOptions?: ts.WatchOptions, excludeWatchFile?: boolean) { - return implementRequireForWatchFactorySystem(createSystem(watchOptions), !!excludeWatchFile); + function createSystemWithFactory(watchOptions?: ts.WatchOptions, compilerOptions?: ts.CompilerOptions, excludeWatchFile?: boolean) { + return implementRequireForWatchFactorySystem(createSystem(watchOptions, compilerOptions), !!excludeWatchFile); } function verifyWatchFactory( @@ -901,13 +927,13 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po verifyTscWatch({ scenario, ...input, - commandLineArgs: ["-w", "--extendedDiagnostics", "--watchFactory", watchFactory], + commandLineArgs: ["-w", "--extendedDiagnostics", "--watchFactory", watchFactory, "--allowPlugins"], }); verifyTscWatch({ scenario, ...input, subScenario: `${input.subScenario} object`, - commandLineArgs: ["-w", "--extendedDiagnostics", "--watchFactory", JSON.stringify({ name: watchFactory, myconfig: "somethingelse" })], + commandLineArgs: ["-w", "--extendedDiagnostics", "--watchFactory", JSON.stringify({ name: watchFactory, myconfig: "somethingelse" }), "--allowPlugins"], }); } }); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index d6224d0558602..6613844af7f84 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -9140,7 +9140,7 @@ declare namespace ts { /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ - function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined; + function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[], checkAllowPlugins?: boolean): ParsedCommandLine | undefined; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -9182,7 +9182,7 @@ declare namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map, existingWatchOptions?: WatchOptions): ParsedCommandLine; + function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map, existingWatchOptions?: WatchOptions, checkAllowPlugins?: boolean): ParsedCommandLine; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; errors: Diagnostic[]; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index de7b8703ba765..62cb83ce2015a 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5128,7 +5128,7 @@ declare namespace ts { /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ - function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined; + function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[], checkAllowPlugins?: boolean): ParsedCommandLine | undefined; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -5170,7 +5170,7 @@ declare namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map, existingWatchOptions?: WatchOptions): ParsedCommandLine; + function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map, existingWatchOptions?: WatchOptions, checkAllowPlugins?: boolean): ParsedCommandLine; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; errors: Diagnostic[]; diff --git a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/allowPlugins/tsconfig.json b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/allowPlugins/tsconfig.json new file mode 100644 index 0000000000000..6e51943502d7d --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/allowPlugins/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "allowPlugins": true + } +} diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js new file mode 100644 index 0000000000000..c31d9a0e66765 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js @@ -0,0 +1,114 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -b -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +tsconfig.json:1:100 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +tsconfig.json:1:34 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~ + +[12:00:24 AM] Found 2 errors. Watching for file changes. + +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file /user/username/projects/myproject/tsconfig.json +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +[12:00:27 AM] File change detected. Starting incremental compilation... + +tsconfig.json:1:100 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +tsconfig.json:1:34 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~ + +[12:00:28 AM] Found 2 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js new file mode 100644 index 0000000000000..f3baff03ef4b6 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js @@ -0,0 +1,114 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -b -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +tsconfig.json:1:64 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +[12:00:24 AM] Found 2 errors. Watching for file changes. + +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file /user/username/projects/myproject/tsconfig.json +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +[12:00:27 AM] File change detected. Starting incremental compilation... + +tsconfig.json:1:64 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 2 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-object.js index dca983ccb5e35..c6cffd0505c8e 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -45,7 +45,7 @@ Custom watchFile: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"n Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -136,7 +136,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js index 7320aadd67e61..a8e94ccfedbcb 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -42,7 +42,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} S Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -93,7 +93,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error.js index f1219d063d1dc..51f9c8e85f3a4 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file-with-error.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -42,7 +42,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} S Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -93,7 +93,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file.js index 39c4204942a75..7581ad5133b43 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/in-config-file.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -45,7 +45,7 @@ Custom watchFile: /user/username/projects/myproject/b.ts 250 {"watchFactory":"my Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -136,7 +136,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-object.js index 363065bc08ed9..0061f33fe3c51 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory {"name":"myplugin","myconfig":"somethingelse"} +/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory {"name":"myplugin","myconfig":"somethingelse"} --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -45,7 +45,7 @@ Custom watchFile: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"n Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -136,7 +136,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js index 525c2136b4d7c..b001646297e2f 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory {"name":"myplugin/../malicious","myconfig":"somethingelse"} +/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory {"name":"myplugin/../malicious","myconfig":"somethingelse"} --allowPlugins Output:: error TS5109: 'watchFactory' name can only be a package name. diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error.js index af294142d0cca..27736fbbd7da0 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline-with-error.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory myplugin/../malicious +/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory myplugin/../malicious --allowPlugins Output:: error TS5109: 'watchFactory' name can only be a package name. diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline.js index 92241db67a8b3..a657d8ee58464 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/through-commandline.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory myplugin +/a/lib/tsc.js -b -w --extendedDiagnostics --watchFactory myplugin --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -45,7 +45,7 @@ Custom watchFile: /user/username/projects/myproject/b.ts 250 {"watchFactory":"my Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -136,7 +136,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js index 6b354fc77091f..6a3a05031bb50 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -38,7 +38,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -118,7 +118,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js index 1c2353fa6d021..c23b964949afa 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -38,7 +38,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -118,7 +118,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js index eb508429143a3..c0875bb5a7ee1 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -42,7 +42,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -122,7 +122,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -187,7 +187,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/c.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js index 29cc38b59ffd9..a82db309f4512 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -42,7 +42,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -122,7 +122,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -187,7 +187,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/c.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js index a00adede265d0..74f57bb66aa87 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -41,7 +41,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -121,7 +121,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js index 4e6465c695c70..5dcff669a6366 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -41,7 +41,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -121,7 +121,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js index 766580908246c..f0c43c5c263e6 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -42,7 +42,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -122,7 +122,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found.js index 28d67acdd3567..e3f3462695255 100644 --- a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found.js +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/when-plugin-not-found.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -b -w --extendedDiagnostics +/a/lib/tsc.js -b -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -42,7 +42,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"wa Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -122,7 +122,7 @@ Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.t Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js new file mode 100644 index 0000000000000..5757f7e12ef70 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js @@ -0,0 +1,104 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":"myplugin"}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -b -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:24 AM] Found 1 error. Watching for file changes. + +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file /user/username/projects/myproject/tsconfig.json +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +[12:00:27 AM] File change detected. Starting incremental compilation... + +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins.js b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins.js new file mode 100644 index 0000000000000..5757f7e12ef70 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/watchEnvironment/watchFactory/without-allowPlugins.js @@ -0,0 +1,104 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":"myplugin"}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -b -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:24 AM] Found 1 error. Watching for file changes. + +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file /user/username/projects/myproject/tsconfig.json +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file /user/username/projects/myproject/tsconfig.json +[12:00:27 AM] File change detected. Starting incremental compilation... + +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js new file mode 100644 index 0000000000000..e95663e6892d7 --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig-object.js @@ -0,0 +1,185 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +Current directory: /user/username/projects/myproject CaseSensitiveFileNames: false +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file +Synchronizing program +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {} Source file +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +tsconfig.json:1:34 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~ + +tsconfig.json:1:100 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 2 errors. Watching for file changes. + +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (used version) + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +var a = /** @class */ (function () { + function a() { + this.prop = "hello"; + } + a.prototype.foo = function () { return this.prop; }; + return a; +}()); +exports.a = a; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; + + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Synchronizing program +[12:00:31 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +tsconfig.json:1:34 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~ + +tsconfig.json:1:100 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +[12:00:35 AM] Found 2 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/b.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; +function foo() { } +exports.foo = foo; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js new file mode 100644 index 0000000000000..22be024d84ee5 --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/allowPlugins-is-in-tsconfig.js @@ -0,0 +1,185 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +Current directory: /user/username/projects/myproject CaseSensitiveFileNames: false +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file +Synchronizing program +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {} Source file +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +tsconfig.json:1:64 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 2 errors. Watching for file changes. + +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (used version) + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +var a = /** @class */ (function () { + function a() { + this.prop = "hello"; + } + a.prototype.foo = function () { return this.prop; }; + return a; +}()); +exports.a = a; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; + + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Synchronizing program +[12:00:31 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +tsconfig.json:1:64 - error TS6266: Option 'allowPlugins' can only be specified on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"},"compilerOptions":{"allowPlugins":true}} +   ~~~~~~~~~~~~~~ + +[12:00:35 AM] Found 2 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/b.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; +function foo() { } +exports.foo = foo; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-object.js index 64c7174e900f7..cd7e5eff59e8c 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -37,7 +37,7 @@ Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFa Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file Custom watchFile: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file @@ -55,7 +55,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -149,13 +149,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js index b6f676bf7c37f..118552ac68deb 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -32,7 +32,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {} Source file @@ -50,7 +50,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -135,7 +135,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} tsconfig.json:1:41 - error TS5109: 'watchFactory' name can only be a package name. 1 {"watchOptions":{"watchFactory":{"name":"myplugin/../malicious","myconfig":"somethingelse"}}} @@ -146,7 +146,7 @@ CreatingProgramWith:: Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error.js index 4de9ca9bc8aa3..0ef4517da3b4a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file-with-error.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -32,7 +32,7 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {} Source file @@ -50,7 +50,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -135,7 +135,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} tsconfig.json:1:33 - error TS5109: 'watchFactory' name can only be a package name. 1 {"watchOptions":{"watchFactory":"myplugin/../malicious"}} @@ -146,7 +146,7 @@ CreatingProgramWith:: Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file.js index d91f539abdf5f..6eb3c85cd063a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/in-config-file.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -37,7 +37,7 @@ Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFa Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} Source file Custom watchFile: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":"myplugin"} Source file @@ -55,7 +55,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -149,13 +149,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-object.js index 556cb988365c6..c8a2808a85912 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics --watchFactory {"name":"myplugin","myconfig":"somethingelse"} +/a/lib/tsc.js -w --extendedDiagnostics --watchFactory {"name":"myplugin","myconfig":"somethingelse"} --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -37,7 +37,7 @@ Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFa Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file Custom watchFile: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file @@ -55,7 +55,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -149,13 +149,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js index 86283fea172bc..7f546dddc7404 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics --watchFactory {"name":"myplugin/../malicious","myconfig":"somethingelse"} +/a/lib/tsc.js -w --extendedDiagnostics --watchFactory {"name":"myplugin/../malicious","myconfig":"somethingelse"} --allowPlugins Output:: error TS5109: 'watchFactory' name can only be a package name. diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error.js index b9b25c21827dd..d0af41748424a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline-with-error.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics --watchFactory myplugin/../malicious +/a/lib/tsc.js -w --extendedDiagnostics --watchFactory myplugin/../malicious --allowPlugins Output:: error TS5109: 'watchFactory' name can only be a package name. diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline.js index 3cfa08a53ffa4..962863958da89 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/through-commandline.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics --watchFactory myplugin +/a/lib/tsc.js -w --extendedDiagnostics --watchFactory myplugin --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -37,7 +37,7 @@ Custom watchFile: /user/username/projects/myproject/tsconfig.json 2000 {"watchFa Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} Source file Custom watchFile: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":"myplugin"} Source file @@ -55,7 +55,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -149,13 +149,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js index 23cb059194c90..6f35cfe8b6e8f 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -33,7 +33,7 @@ Custom watchFactory is ignored because of not running in environment that suppor Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file @@ -46,7 +46,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -131,13 +131,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js index b71d313d8c278..f5eab72f79521 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-host-does-not-implement-require.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -33,7 +33,7 @@ Custom watchFactory is ignored because of not running in environment that suppor Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":"myplugin"} Source file @@ -46,7 +46,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -131,13 +131,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js index 489c8adf666b0..2bdc3dd66b3e0 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -36,7 +36,7 @@ Require:: Module myplugin created with config: {"name":"myplugin","myconfig":"so Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file @@ -51,7 +51,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -134,13 +134,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts @@ -203,14 +203,14 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/c.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file [12:00:41 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js index bd78a9bbe4adc..92303e0bc92bc 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-does-not-implements-watchFile.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -36,7 +36,7 @@ Require:: Module myplugin created with config: {"name":"myplugin"} and options: Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":"myplugin"} Source file @@ -51,7 +51,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -134,13 +134,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts @@ -203,14 +203,14 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/c.ts 250 {"watchFactory":"myplugin"} Source file [12:00:41 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js index 4d4694658c086..f37c2b12aff42 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -36,7 +36,7 @@ Skipped loading plugin myplugin because it did not expose a proper factory funct Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file @@ -49,7 +49,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -134,13 +134,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js index 0603355480af0..0d975ba18f444 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-doesnt-return-factory-function.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -36,7 +36,7 @@ Skipped loading plugin myplugin because it did not expose a proper factory funct Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":"myplugin"} Source file @@ -49,7 +49,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -134,13 +134,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js index d2df900cc04df..786b6f584c390 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found-object.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -37,7 +37,7 @@ Couldn't find myplugin Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":{"name":"myplugin","myconfig":"somethingelse"}} Source file @@ -50,7 +50,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -135,13 +135,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found.js index 0f65303a0f1fb..553485e3aa33a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/when-plugin-not-found.js @@ -23,7 +23,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -/a/lib/tsc.js -w --extendedDiagnostics +/a/lib/tsc.js -w --extendedDiagnostics --allowPlugins Output:: [12:00:23 AM] Starting compilation in watch mode... @@ -37,7 +37,7 @@ Couldn't find myplugin Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {"watchFactory":"myplugin"} Source file FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {"watchFactory":"myplugin"} Source file @@ -50,7 +50,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/mypr Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -135,13 +135,13 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] - options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} + options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} [12:00:35 AM] Found 0 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"watch":true,"extendedDiagnostics":true,"allowPlugins":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Completely Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js new file mode 100644 index 0000000000000..35467ddb913ef --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins-object.js @@ -0,0 +1,175 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":"myplugin"}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +Current directory: /user/username/projects/myproject CaseSensitiveFileNames: false +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file +Synchronizing program +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {} Source file +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 1 error. Watching for file changes. + +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (used version) + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +var a = /** @class */ (function () { + function a() { + this.prop = "hello"; + } + a.prototype.foo = function () { return this.prop; }; + return a; +}()); +exports.a = a; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; + + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Synchronizing program +[12:00:31 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:35 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/b.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; +function foo() { } +exports.foo = foo; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins.js new file mode 100644 index 0000000000000..35467ddb913ef --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFactory/without-allowPlugins.js @@ -0,0 +1,175 @@ +Input:: +//// [/user/username/projects/myproject/a.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } } + +//// [/user/username/projects/myproject/tsconfig.json] +{"watchOptions":{"watchFactory":"myplugin"}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w --extendedDiagnostics +Output:: +[12:00:23 AM] Starting compilation in watch mode... + +Current directory: /user/username/projects/myproject CaseSensitiveFileNames: false +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 {} Config file +Synchronizing program +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/a.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 {} Source file +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 {} Type roots +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:28 AM] Found 1 error. Watching for file changes. + +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {} Wild card directory + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (used version) + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/b.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +var a = /** @class */ (function () { + function a() { + this.prop = "hello"; + } + a.prototype.foo = function () { return this.prop; }; + return a; +}()); +exports.a = a; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; + + + +Change:: Change file + +Input:: +//// [/user/username/projects/myproject/b.ts] +export class b { prop = "hello"; foo() { return this.prop; } }export function foo() { } + + +Output:: +FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 250 {} Source file +Synchronizing program +[12:00:31 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] + options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +tsconfig.json:1:18 - error TS5110: Option 'watchFactory' cannot be specified without passing '--allowPlugins' on command line. + +1 {"watchOptions":{"watchFactory":"myplugin"}} +   ~~~~~~~~~~~~~~ + +[12:00:35 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/b.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = exports.b = void 0; +var b = /** @class */ (function () { + function b() { + this.prop = "hello"; + } + b.prototype.foo = function () { return this.prop; }; + return b; +}()); +exports.b = b; +function foo() { } +exports.foo = foo; + +