Skip to content

Commit 0a0b7e4

Browse files
committed
Update LKG
1 parent 59b12d7 commit 0a0b7e4

10 files changed

Lines changed: 6439 additions & 66 deletions

lib/cancellationToken.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
"use strict";
17+
var fs = require("fs");
18+
function createCancellationToken(args) {
19+
var cancellationPipeName;
20+
for (var i = 0; i < args.length - 1; i++) {
21+
if (args[i] === "--cancellationPipeName") {
22+
cancellationPipeName = args[i + 1];
23+
break;
24+
}
25+
}
26+
if (!cancellationPipeName) {
27+
return { isCancellationRequested: function () { return false; } };
28+
}
29+
return {
30+
isCancellationRequested: function () {
31+
try {
32+
fs.statSync(cancellationPipeName);
33+
return true;
34+
}
35+
catch (e) {
36+
return false;
37+
}
38+
}
39+
};
40+
}
41+
module.exports = createCancellationToken;

lib/tsc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ var ts;
18341834
var originalWriteFile_1 = sys.writeFile;
18351835
sys.writeFile = function (path, data, writeBom) {
18361836
var directoryPath = ts.getDirectoryPath(ts.normalizeSlashes(path));
1837-
if (!sys.directoryExists(directoryPath)) {
1837+
if (directoryPath && !sys.directoryExists(directoryPath)) {
18381838
recursiveCreateDirectory(directoryPath, sys);
18391839
}
18401840
originalWriteFile_1.call(sys, path, data, writeBom);

lib/tsserver.js

Lines changed: 136 additions & 29 deletions
Large diffs are not rendered by default.

lib/tsserverlibrary.d.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8105,6 +8105,7 @@ declare namespace ts {
81058105
readDirectory?(path: string, extensions?: string[], exclude?: string[], include?: string[]): string[];
81068106
readFile?(path: string, encoding?: string): string;
81078107
fileExists?(path: string): boolean;
8108+
getTypeRootsVersion?(): number;
81088109
resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[];
81098110
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
81108111
directoryExists?(directoryName: string): boolean;
@@ -8567,11 +8568,12 @@ declare namespace ts.server {
85678568
isOpen: boolean;
85688569
hasMixedContent: boolean;
85698570
readonly containingProjects: Project[];
8570-
readonly formatCodeSettings: ts.FormatCodeSettings;
8571+
private formatCodeSettings;
85718572
readonly path: Path;
85728573
private fileWatcher;
85738574
private svc;
85748575
constructor(host: ServerHost, fileName: NormalizedPath, content: string, scriptKind: ScriptKind, isOpen?: boolean, hasMixedContent?: boolean);
8576+
getFormatCodeSettings(): FormatCodeSettings;
85758577
attachToProject(project: Project): boolean;
85768578
isAttached(project: Project): boolean;
85778579
detachFromProject(project: Project): void;
@@ -8615,6 +8617,7 @@ declare namespace ts.server {
86158617
getDefaultLibFileName(): string;
86168618
getScriptSnapshot(filename: string): ts.IScriptSnapshot;
86178619
getScriptFileNames(): string[];
8620+
getTypeRootsVersion(): number;
86188621
getScriptKind(fileName: string): ScriptKind;
86198622
getScriptVersion(filename: string): string;
86208623
getCurrentDirectory(): string;
@@ -8699,6 +8702,7 @@ declare namespace ts.server {
86998702
private projectStateVersion;
87008703
private typingFiles;
87018704
protected projectErrors: Diagnostic[];
8705+
typesVersion: number;
87028706
isJsOnlyProject(): boolean;
87038707
constructor(projectKind: ProjectKind, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, hasExplicitListOfFiles: boolean, languageServiceEnabled: boolean, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean);
87048708
getProjectErrors(): Diagnostic[];
@@ -8711,6 +8715,7 @@ declare namespace ts.server {
87118715
abstract getProjectRootPath(): string | undefined;
87128716
abstract getTypingOptions(): TypingOptions;
87138717
getSourceFile(path: Path): SourceFile;
8718+
updateTypes(): void;
87148719
close(): void;
87158720
getCompilerOptions(): CompilerOptions;
87168721
hasRoots(): boolean;
@@ -8759,6 +8764,7 @@ declare namespace ts.server {
87598764
private projectFileWatcher;
87608765
private directoryWatcher;
87618766
private directoriesWatchedForWildcards;
8767+
private typeRootsWatchers;
87628768
openRefCount: number;
87638769
constructor(configFileName: NormalizedPath, projectService: ProjectService, documentRegistry: ts.DocumentRegistry, hasExplicitListOfFiles: boolean, compilerOptions: CompilerOptions, wildcardDirectories: Map<WatchDirectoryFlags>, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean);
87648770
getProjectRootPath(): string;
@@ -8769,12 +8775,14 @@ declare namespace ts.server {
87698775
__normalizedPathTag: any;
87708776
};
87718777
watchConfigFile(callback: (project: ConfiguredProject) => void): void;
8778+
watchTypeRoots(callback: (project: ConfiguredProject, path: string) => void): void;
87728779
watchConfigDirectory(callback: (project: ConfiguredProject, path: string) => void): void;
87738780
watchWildcards(callback: (project: ConfiguredProject, path: string) => void): void;
87748781
stopWatchingDirectory(): void;
87758782
close(): void;
87768783
addOpenRef(): void;
87778784
deleteOpenRef(): number;
8785+
getEffectiveTypeRoots(): string[];
87788786
}
87798787
class ExternalProject extends Project {
87808788
readonly externalProjectName: string;
@@ -8853,6 +8861,7 @@ declare namespace ts.server {
88538861
private updateProjectGraphs(projects);
88548862
private onSourceFileChanged(fileName);
88558863
private handleDeletedFile(info);
8864+
private onTypeRootFileChanged(project, fileName);
88568865
private onSourceFileInDirectoryChangedForConfiguredProject(project, fileName);
88578866
private handleChangeInSourceFileForConfiguredProject(project);
88588867
private onConfigChangedForConfiguredProject(project);
@@ -8891,7 +8900,8 @@ declare namespace ts.server {
88918900
private collectChanges(lastKnownProjectVersions, currentProjects, result);
88928901
synchronizeProjectList(knownProjects: protocol.ProjectVersionInfo[]): ProjectFilesWithTSDiagnostics[];
88938902
applyChangesInOpenFiles(openFiles: protocol.ExternalFile[], changedFiles: protocol.ChangedOpenFile[], closedFiles: string[]): void;
8894-
closeExternalProject(uncheckedFileName: string): void;
8903+
private closeConfiguredProject(configFile);
8904+
closeExternalProject(uncheckedFileName: string, suppressRefresh?: boolean): void;
88958905
openExternalProject(proj: protocol.ExternalProject): void;
88968906
}
88978907
}
@@ -8983,7 +8993,6 @@ declare namespace ts.server {
89838993
configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: ts.Diagnostic[]): void;
89848994
event(info: any, eventName: string): void;
89858995
output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
8986-
private getLocation(position, scriptInfo);
89878996
private semanticCheck(file, project);
89888997
private syntacticCheck(file, project);
89898998
private updateProjectStructure(seq, matchSeq, ms?);
@@ -9209,6 +9218,7 @@ declare namespace ts {
92099218
getNewLine?(): string;
92109219
getProjectVersion?(): string;
92119220
useCaseSensitiveFileNames?(): boolean;
9221+
getTypeRootsVersion?(): number;
92129222
readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string;
92139223
readFile(path: string, encoding?: string): string;
92149224
fileExists(path: string): boolean;
@@ -9303,6 +9313,7 @@ declare namespace ts {
93039313
trace(s: string): void;
93049314
error(s: string): void;
93059315
getProjectVersion(): string;
9316+
getTypeRootsVersion(): number;
93069317
useCaseSensitiveFileNames(): boolean;
93079318
getCompilationSettings(): CompilerOptions;
93089319
getScriptFileNames(): string[];

0 commit comments

Comments
 (0)