Skip to content

Commit b287a9f

Browse files
committed
Remove new option from public API for now
1 parent 1d38012 commit b287a9f

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/compiler/parser.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -1324,14 +1324,10 @@ function setExternalModuleIndicator(sourceFile: SourceFile) {
13241324
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
13251325
}
13261326

1327-
export function createSourceFile(
1328-
fileName: string,
1329-
sourceText: string,
1330-
languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions,
1331-
setParentNodes = false,
1332-
scriptKind?: ScriptKind,
1333-
skipNonSemanticJSDoc?: boolean,
1334-
): SourceFile {
1327+
export function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
1328+
/** @internal */
1329+
export function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind, skipNonSemanticJSDoc?: boolean): SourceFile;
1330+
export function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes = false, scriptKind?: ScriptKind, skipNonSemanticJSDoc?: boolean): SourceFile {
13351331
tracing?.push(tracing.Phase.Parse, "createSourceFile", { path: fileName }, /*separateBeginAndEnd*/ true);
13361332
performance.mark("beforeParse");
13371333
let result: SourceFile;

src/compiler/watchPublic.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ export function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadB
118118
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
119119
}
120120

121+
export function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
122+
/** @internal */
123+
export function createIncrementalCompilerHost(options: CompilerOptions, system?: System, skipNonSemanticJSDocParsing?: boolean): CompilerHost;
121124
export function createIncrementalCompilerHost(options: CompilerOptions, system = sys, skipNonSemanticJSDocParsing?: boolean): CompilerHost {
122125
const host = createCompilerHostWorker(options, /*setParentNodes*/ undefined, skipNonSemanticJSDocParsing, system);
123126
host.createHash = maybeBind(system, system.createHash);
@@ -255,7 +258,11 @@ export interface ProgramHost<T extends BuilderProgram> {
255258
*/
256259
getModuleResolutionCache?(): ModuleResolutionCache | undefined;
257260

258-
/** True if it's safe for the parser to skip parsing non-semantic JSDoc tags. */
261+
/**
262+
* True if it's safe for the parser to skip parsing non-semantic JSDoc tags.
263+
*
264+
* @internal
265+
*/
259266
skipNonSemanticJSDocParsing?: boolean;
260267
}
261268
/**

tests/baselines/reference/api/typescript.d.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -9413,7 +9413,7 @@ declare namespace ts {
94139413
* that they appear in the source code. The language service depends on this property to locate nodes by position.
94149414
*/
94159415
function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
9416-
function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind, skipNonSemanticJSDoc?: boolean): SourceFile;
9416+
function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
94179417
function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
94189418
/**
94199419
* Parse json text into SyntaxTree and return node and parse errors if any
@@ -9930,7 +9930,7 @@ declare namespace ts {
99309930
emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
99319931
}
99329932
function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
9933-
function createIncrementalCompilerHost(options: CompilerOptions, system?: System, skipNonSemanticJSDocParsing?: boolean): CompilerHost;
9933+
function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
99349934
function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
99359935
/**
99369936
* Create the watch compiler host for either configFile or fileNames and its options
@@ -10027,8 +10027,6 @@ declare namespace ts {
1002710027
* Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
1002810028
*/
1002910029
getModuleResolutionCache?(): ModuleResolutionCache | undefined;
10030-
/** True if it's safe for the parser to skip parsing non-semantic JSDoc tags. */
10031-
skipNonSemanticJSDocParsing?: boolean;
1003210030
}
1003310031
interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
1003410032
/** Instead of using output d.ts file from project reference, use its source file */

0 commit comments

Comments
 (0)