Skip to content

Commit 4927091

Browse files
committed
Update LKG
1 parent e473d53 commit 4927091

File tree

6 files changed

+1414
-217
lines changed

6 files changed

+1414
-217
lines changed

lib/tsc.js

Lines changed: 133 additions & 27 deletions
Large diffs are not rendered by default.

lib/tsserver.js

Lines changed: 363 additions & 60 deletions
Large diffs are not rendered by default.

lib/typescript.d.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,20 @@ declare namespace ts {
14801480
noImplicitUseStrict?: boolean;
14811481
[option: string]: string | number | boolean;
14821482
}
1483+
interface TypingOptions {
1484+
enableAutoDiscovery?: boolean;
1485+
include?: string[];
1486+
exclude?: string[];
1487+
[option: string]: string[] | boolean;
1488+
}
1489+
interface DiscoverTypingsInfo {
1490+
fileNames: string[];
1491+
projectRootPath: string;
1492+
safeListPath: string;
1493+
packageNameToTypingLocation: Map<string>;
1494+
typingOptions: TypingOptions;
1495+
compilerOptions: CompilerOptions;
1496+
}
14831497
enum ModuleKind {
14841498
None = 0,
14851499
CommonJS = 1,
@@ -1502,6 +1516,13 @@ declare namespace ts {
15021516
line: number;
15031517
character: number;
15041518
}
1519+
enum ScriptKind {
1520+
Unknown = 0,
1521+
JS = 1,
1522+
JSX = 2,
1523+
TS = 3,
1524+
TSX = 4,
1525+
}
15051526
enum ScriptTarget {
15061527
ES3 = 0,
15071528
ES5 = 1,
@@ -1515,6 +1536,7 @@ declare namespace ts {
15151536
}
15161537
interface ParsedCommandLine {
15171538
options: CompilerOptions;
1539+
typingOptions?: TypingOptions;
15181540
fileNames: string[];
15191541
errors: Diagnostic[];
15201542
}
@@ -1663,7 +1685,7 @@ declare namespace ts {
16631685
declare namespace ts {
16641686
function createNode(kind: SyntaxKind, pos?: number, end?: number): Node;
16651687
function forEachChild<T>(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T;
1666-
function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile;
1688+
function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
16671689
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
16681690
}
16691691
declare namespace ts {
@@ -1798,6 +1820,7 @@ declare namespace ts {
17981820
getNewLine?(): string;
17991821
getProjectVersion?(): string;
18001822
getScriptFileNames(): string[];
1823+
getScriptKind?(fileName: string): ScriptKind;
18011824
getScriptVersion(fileName: string): string;
18021825
getScriptSnapshot(fileName: string): IScriptSnapshot;
18031826
getLocalizedDiagnosticMessages?(): any;
@@ -2166,7 +2189,7 @@ declare namespace ts {
21662189
* @parm version Current version of the file. Only used if the file was not found
21672190
* in the registry and a new one was created.
21682191
*/
2169-
acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
2192+
acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
21702193
/**
21712194
* Request an updated version of an already existing SourceFile with a given fileName
21722195
* and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
@@ -2179,7 +2202,7 @@ declare namespace ts {
21792202
* @param scriptSnapshot Text of the file.
21802203
* @param version Current version of the file.
21812204
*/
2182-
updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
2205+
updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
21832206
/**
21842207
* Informs the DocumentRegistry that a file is not needed any longer.
21852208
*
@@ -2303,7 +2326,7 @@ declare namespace ts {
23032326
}
23042327
function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
23052328
function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
2306-
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
2329+
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
23072330
let disableIncrementalParsing: boolean;
23082331
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
23092332
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;

0 commit comments

Comments
 (0)