Skip to content

Commit 1a579d9

Browse files
committed
Update LKG
1 parent e023dc3 commit 1a579d9

9 files changed

+853
-775
lines changed

lib/tsc.js

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ var ts;
142142
})(ts || (ts = {}));
143143
var ts;
144144
(function (ts) {
145-
ts.version = "2.3.3";
145+
ts.version = "2.3.4";
146146
})(ts || (ts = {}));
147147
(function (ts) {
148148
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined;
@@ -55301,7 +55301,6 @@ var ts;
5530155301
optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames };
5530255302
return optionNameMapCache;
5530355303
}
55304-
ts.getOptionNameMap = getOptionNameMap;
5530555304
function createCompilerDiagnosticForInvalidCustomType(opt) {
5530655305
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
5530755306
return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
@@ -55335,7 +55334,6 @@ var ts;
5533555334
var options = {};
5533655335
var fileNames = [];
5533755336
var errors = [];
55338-
var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
5533955337
parseStrings(commandLine);
5534055338
return {
5534155339
options: options,
@@ -55351,12 +55349,7 @@ var ts;
5535155349
parseResponseFile(s.slice(1));
5535255350
}
5535355351
else if (s.charCodeAt(0) === 45) {
55354-
s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
55355-
var short = shortOptionNames.get(s);
55356-
if (short !== undefined) {
55357-
s = short;
55358-
}
55359-
var opt = optionNameMap.get(s);
55352+
var opt = getOptionFromName(s.slice(s.charCodeAt(1) === 45 ? 2 : 1), true);
5536055353
if (opt) {
5536155354
if (opt.isTSConfigOnly) {
5536255355
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
@@ -55440,6 +55433,18 @@ var ts;
5544055433
}
5544155434
}
5544255435
ts.parseCommandLine = parseCommandLine;
55436+
function getOptionFromName(optionName, allowShort) {
55437+
if (allowShort === void 0) { allowShort = false; }
55438+
optionName = optionName.toLowerCase();
55439+
var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
55440+
if (allowShort) {
55441+
var short = shortOptionNames.get(optionName);
55442+
if (short !== undefined) {
55443+
optionName = short;
55444+
}
55445+
}
55446+
return optionNameMap.get(optionName);
55447+
}
5544355448
function readConfigFile(fileName, readFile) {
5544455449
var text = "";
5544555450
try {
@@ -55988,6 +55993,39 @@ var ts;
5598855993
function caseInsensitiveKeyMapper(key) {
5598955994
return key.toLowerCase();
5599055995
}
55996+
function convertCompilerOptionsForTelemetry(opts) {
55997+
var out = {};
55998+
for (var key in opts)
55999+
if (opts.hasOwnProperty(key)) {
56000+
var type = getOptionFromName(key);
56001+
if (type !== undefined) {
56002+
out[key] = getOptionValueWithEmptyStrings(opts[key], type);
56003+
}
56004+
}
56005+
return out;
56006+
}
56007+
ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry;
56008+
function getOptionValueWithEmptyStrings(value, option) {
56009+
switch (option.type) {
56010+
case "object":
56011+
return "";
56012+
case "string":
56013+
return "";
56014+
case "number":
56015+
return typeof value === "number" ? value : "";
56016+
case "boolean":
56017+
return typeof value === "boolean" ? value : "";
56018+
case "list":
56019+
var elementType_1 = option.element;
56020+
return ts.isArray(value) ? value.map(function (v) { return getOptionValueWithEmptyStrings(v, elementType_1); }) : "";
56021+
default:
56022+
return ts.forEachEntry(option.type, function (optionEnumValue, optionStringValue) {
56023+
if (optionEnumValue === value) {
56024+
return optionStringValue;
56025+
}
56026+
});
56027+
}
56028+
}
5599156029
})(ts || (ts = {}));
5599256030
var ts;
5599356031
(function (ts) {

lib/tsserver.js

Lines changed: 208 additions & 188 deletions
Large diffs are not rendered by default.

lib/tsserverlibrary.d.ts

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ declare namespace ts {
22752275
}
22762276
}
22772277
declare namespace ts {
2278-
const version = "2.3.3";
2278+
const version = "2.3.4";
22792279
}
22802280
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
22812281
declare function clearTimeout(handle: any): void;
@@ -3483,9 +3483,10 @@ declare namespace ts.server {
34833483
const LogFile = "--logFile";
34843484
const EnableTelemetry = "--enableTelemetry";
34853485
const TypingSafeListLocation = "--typingSafeListLocation";
3486+
const NpmLocation = "--npmLocation";
34863487
}
34873488
function hasArgument(argumentName: string): boolean;
3488-
function findArgument(argumentName: string): string;
3489+
function findArgument(argumentName: string): string | undefined;
34893490
}
34903491
declare namespace ts.server {
34913492
enum LogLevel {
@@ -3538,7 +3539,10 @@ declare namespace ts.server {
35383539
}
35393540
function createNormalizedPathMap<T>(): NormalizedPathMap<T>;
35403541
interface ProjectOptions {
3541-
configHasFilesProperty?: boolean;
3542+
configHasExtendsProperty: boolean;
3543+
configHasFilesProperty: boolean;
3544+
configHasIncludeProperty: boolean;
3545+
configHasExcludeProperty: boolean;
35423546
files?: string[];
35433547
wildcardDirectories?: Map<WatchDirectoryFlags>;
35443548
compilerOptions?: CompilerOptions;
@@ -4833,6 +4837,7 @@ declare namespace ts.server {
48334837
Configured = 1,
48344838
External = 2,
48354839
}
4840+
function countEachFileTypes(infos: ScriptInfo[]): FileStats;
48364841
function allRootFilesAreJsOrDts(project: Project): boolean;
48374842
function allFilesAreJsOrDts(project: Project): boolean;
48384843
class UnresolvedImportsMap {
@@ -4993,6 +4998,7 @@ declare namespace ts.server {
49934998
const ContextEvent = "context";
49944999
const ConfigFileDiagEvent = "configFileDiag";
49955000
const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
5001+
const ProjectInfoTelemetryEvent = "projectInfo";
49965002
interface ContextEvent {
49975003
eventName: typeof ContextEvent;
49985004
data: {
@@ -5015,7 +5021,37 @@ declare namespace ts.server {
50155021
languageServiceEnabled: boolean;
50165022
};
50175023
}
5018-
type ProjectServiceEvent = ContextEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent;
5024+
interface ProjectInfoTelemetryEvent {
5025+
readonly eventName: typeof ProjectInfoTelemetryEvent;
5026+
readonly data: ProjectInfoTelemetryEventData;
5027+
}
5028+
interface ProjectInfoTelemetryEventData {
5029+
readonly fileStats: FileStats;
5030+
readonly compilerOptions: ts.CompilerOptions;
5031+
readonly extends: boolean | undefined;
5032+
readonly files: boolean | undefined;
5033+
readonly include: boolean | undefined;
5034+
readonly exclude: boolean | undefined;
5035+
readonly compileOnSave: boolean;
5036+
readonly typeAcquisition: ProjectInfoTypeAcquisitionData;
5037+
readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other";
5038+
readonly projectType: "external" | "configured";
5039+
readonly languageServiceEnabled: boolean;
5040+
readonly version: string;
5041+
}
5042+
interface ProjectInfoTypeAcquisitionData {
5043+
readonly enable: boolean;
5044+
readonly include: boolean;
5045+
readonly exclude: boolean;
5046+
}
5047+
interface FileStats {
5048+
readonly js: number;
5049+
readonly jsx: number;
5050+
readonly ts: number;
5051+
readonly tsx: number;
5052+
readonly dts: number;
5053+
}
5054+
type ProjectServiceEvent = ContextEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent;
50195055
interface ProjectServiceEventHandler {
50205056
(event: ProjectServiceEvent): void;
50215057
}
@@ -5081,6 +5117,7 @@ declare namespace ts.server {
50815117
readonly globalPlugins: ReadonlyArray<string>;
50825118
readonly pluginProbeLocations: ReadonlyArray<string>;
50835119
readonly allowLocalPluginLoads: boolean;
5120+
private readonly seenProjects;
50845121
constructor(opts: ProjectServiceOptions);
50855122
ensureInferredProjectsUpToDate_TestOnly(): void;
50865123
getCompilerOptionsForInferredProjects(): CompilerOptions;
@@ -5113,6 +5150,7 @@ declare namespace ts.server {
51135150
private convertConfigFileContentToProjectOptions(configFilename);
51145151
private exceededTotalSizeLimitForNonTsFiles<T>(name, options, fileNames, propertyReader);
51155152
private createAndAddExternalProject(projectFileName, files, options, typeAcquisition);
5153+
private sendProjectTelemetry(projectKey, project, projectOptions?);
51165154
private reportConfigFileDiagnostics(configFileName, diagnostics, triggerFile);
51175155
private createAndAddConfiguredProject(configFileName, projectOptions, configFileErrors, clientFileName?);
51185156
private watchConfigDirectoryForProject(project, options);

0 commit comments

Comments
 (0)