Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed May 30, 2017
1 parent e023dc3 commit 1a579d9
Show file tree
Hide file tree
Showing 9 changed files with 853 additions and 775 deletions.
56 changes: 47 additions & 9 deletions lib/tsc.js
Expand Up @@ -142,7 +142,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.3.3";
ts.version = "2.3.4";
})(ts || (ts = {}));
(function (ts) {
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined;
Expand Down Expand Up @@ -55301,7 +55301,6 @@ var ts;
optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames };
return optionNameMapCache;
}
ts.getOptionNameMap = getOptionNameMap;
function createCompilerDiagnosticForInvalidCustomType(opt) {
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
Expand Down Expand Up @@ -55335,7 +55334,6 @@ var ts;
var options = {};
var fileNames = [];
var errors = [];
var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
parseStrings(commandLine);
return {
options: options,
Expand All @@ -55351,12 +55349,7 @@ var ts;
parseResponseFile(s.slice(1));
}
else if (s.charCodeAt(0) === 45) {
s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
var short = shortOptionNames.get(s);
if (short !== undefined) {
s = short;
}
var opt = optionNameMap.get(s);
var opt = getOptionFromName(s.slice(s.charCodeAt(1) === 45 ? 2 : 1), true);
if (opt) {
if (opt.isTSConfigOnly) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
Expand Down Expand Up @@ -55440,6 +55433,18 @@ var ts;
}
}
ts.parseCommandLine = parseCommandLine;
function getOptionFromName(optionName, allowShort) {
if (allowShort === void 0) { allowShort = false; }
optionName = optionName.toLowerCase();
var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
if (allowShort) {
var short = shortOptionNames.get(optionName);
if (short !== undefined) {
optionName = short;
}
}
return optionNameMap.get(optionName);
}
function readConfigFile(fileName, readFile) {
var text = "";
try {
Expand Down Expand Up @@ -55988,6 +55993,39 @@ var ts;
function caseInsensitiveKeyMapper(key) {
return key.toLowerCase();
}
function convertCompilerOptionsForTelemetry(opts) {
var out = {};
for (var key in opts)
if (opts.hasOwnProperty(key)) {
var type = getOptionFromName(key);
if (type !== undefined) {
out[key] = getOptionValueWithEmptyStrings(opts[key], type);
}
}
return out;
}
ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry;
function getOptionValueWithEmptyStrings(value, option) {
switch (option.type) {
case "object":
return "";
case "string":
return "";
case "number":
return typeof value === "number" ? value : "";
case "boolean":
return typeof value === "boolean" ? value : "";
case "list":
var elementType_1 = option.element;
return ts.isArray(value) ? value.map(function (v) { return getOptionValueWithEmptyStrings(v, elementType_1); }) : "";
default:
return ts.forEachEntry(option.type, function (optionEnumValue, optionStringValue) {
if (optionEnumValue === value) {
return optionStringValue;
}
});
}
}
})(ts || (ts = {}));
var ts;
(function (ts) {
Expand Down
396 changes: 208 additions & 188 deletions lib/tsserver.js

Large diffs are not rendered by default.

46 changes: 42 additions & 4 deletions lib/tsserverlibrary.d.ts
Expand Up @@ -2275,7 +2275,7 @@ declare namespace ts {
}
}
declare namespace ts {
const version = "2.3.3";
const version = "2.3.4";
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
Expand Down Expand Up @@ -3483,9 +3483,10 @@ declare namespace ts.server {
const LogFile = "--logFile";
const EnableTelemetry = "--enableTelemetry";
const TypingSafeListLocation = "--typingSafeListLocation";
const NpmLocation = "--npmLocation";
}
function hasArgument(argumentName: string): boolean;
function findArgument(argumentName: string): string;
function findArgument(argumentName: string): string | undefined;
}
declare namespace ts.server {
enum LogLevel {
Expand Down Expand Up @@ -3538,7 +3539,10 @@ declare namespace ts.server {
}
function createNormalizedPathMap<T>(): NormalizedPathMap<T>;
interface ProjectOptions {
configHasFilesProperty?: boolean;
configHasExtendsProperty: boolean;
configHasFilesProperty: boolean;
configHasIncludeProperty: boolean;
configHasExcludeProperty: boolean;
files?: string[];
wildcardDirectories?: Map<WatchDirectoryFlags>;
compilerOptions?: CompilerOptions;
Expand Down Expand Up @@ -4833,6 +4837,7 @@ declare namespace ts.server {
Configured = 1,
External = 2,
}
function countEachFileTypes(infos: ScriptInfo[]): FileStats;
function allRootFilesAreJsOrDts(project: Project): boolean;
function allFilesAreJsOrDts(project: Project): boolean;
class UnresolvedImportsMap {
Expand Down Expand Up @@ -4993,6 +4998,7 @@ declare namespace ts.server {
const ContextEvent = "context";
const ConfigFileDiagEvent = "configFileDiag";
const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
const ProjectInfoTelemetryEvent = "projectInfo";
interface ContextEvent {
eventName: typeof ContextEvent;
data: {
Expand All @@ -5015,7 +5021,37 @@ declare namespace ts.server {
languageServiceEnabled: boolean;
};
}
type ProjectServiceEvent = ContextEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent;
interface ProjectInfoTelemetryEvent {
readonly eventName: typeof ProjectInfoTelemetryEvent;
readonly data: ProjectInfoTelemetryEventData;
}
interface ProjectInfoTelemetryEventData {
readonly fileStats: FileStats;
readonly compilerOptions: ts.CompilerOptions;
readonly extends: boolean | undefined;
readonly files: boolean | undefined;
readonly include: boolean | undefined;
readonly exclude: boolean | undefined;
readonly compileOnSave: boolean;
readonly typeAcquisition: ProjectInfoTypeAcquisitionData;
readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other";
readonly projectType: "external" | "configured";
readonly languageServiceEnabled: boolean;
readonly version: string;
}
interface ProjectInfoTypeAcquisitionData {
readonly enable: boolean;
readonly include: boolean;
readonly exclude: boolean;
}
interface FileStats {
readonly js: number;
readonly jsx: number;
readonly ts: number;
readonly tsx: number;
readonly dts: number;
}
type ProjectServiceEvent = ContextEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent;
interface ProjectServiceEventHandler {
(event: ProjectServiceEvent): void;
}
Expand Down Expand Up @@ -5081,6 +5117,7 @@ declare namespace ts.server {
readonly globalPlugins: ReadonlyArray<string>;
readonly pluginProbeLocations: ReadonlyArray<string>;
readonly allowLocalPluginLoads: boolean;
private readonly seenProjects;
constructor(opts: ProjectServiceOptions);
ensureInferredProjectsUpToDate_TestOnly(): void;
getCompilerOptionsForInferredProjects(): CompilerOptions;
Expand Down Expand Up @@ -5113,6 +5150,7 @@ declare namespace ts.server {
private convertConfigFileContentToProjectOptions(configFilename);
private exceededTotalSizeLimitForNonTsFiles<T>(name, options, fileNames, propertyReader);
private createAndAddExternalProject(projectFileName, files, options, typeAcquisition);
private sendProjectTelemetry(projectKey, project, projectOptions?);
private reportConfigFileDiagnostics(configFileName, diagnostics, triggerFile);
private createAndAddConfiguredProject(configFileName, projectOptions, configFileErrors, clientFileName?);
private watchConfigDirectoryForProject(project, options);
Expand Down

0 comments on commit 1a579d9

Please sign in to comment.