Skip to content

Commit

Permalink
Update LKG.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Feb 7, 2019
1 parent 670c480 commit 2312c09
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 37 deletions.
2 changes: 1 addition & 1 deletion lib/protocol.d.ts
Expand Up @@ -2265,7 +2265,7 @@ declare namespace ts.server.protocol {
}
interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
readonly quotePreference?: "auto" | "double" | "single";
/**
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
* This affects lone identifier completions but not completions on the right hand side of `obj.`.
Expand Down
17 changes: 15 additions & 2 deletions lib/tsc.js
Expand Up @@ -61,7 +61,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
var ts;
(function (ts) {
ts.versionMajorMinor = "3.3";
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
ts.emptyArray = [];
Expand Down Expand Up @@ -48476,7 +48476,7 @@ var ts;
return;
}
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
fileToDirective.set(file.path, key);
addReferencedFilesToTypeDirective(file, key);
});
}
return {
Expand Down Expand Up @@ -48615,6 +48615,19 @@ var ts;
}
return false;
}
function addReferencedFilesToTypeDirective(file, key) {
if (fileToDirective.has(file.path))
return;
fileToDirective.set(file.path, key);
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
var fileName = _a[_i].fileName;
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
var referencedFile = host.getSourceFile(resolvedFile);
if (referencedFile) {
addReferencedFilesToTypeDirective(referencedFile, key);
}
}
}
}
function getExternalModuleFileFromDeclaration(declaration) {
var specifier = declaration.kind === 244 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
Expand Down
34 changes: 27 additions & 7 deletions lib/tsserver.js
Expand Up @@ -88,7 +88,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.3";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -57874,7 +57874,9 @@ var ts;
return;
}
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
fileToDirective.set(file.path, key);
// Add the transitive closure of path references loaded by this file (as long as they are not)
// part of an existing type reference.
addReferencedFilesToTypeDirective(file, key);
});
}
return {
Expand Down Expand Up @@ -58029,6 +58031,19 @@ var ts;
}
return false;
}
function addReferencedFilesToTypeDirective(file, key) {
if (fileToDirective.has(file.path))
return;
fileToDirective.set(file.path, key);
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
var fileName = _a[_i].fileName;
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
var referencedFile = host.getSourceFile(resolvedFile);
if (referencedFile) {
addReferencedFilesToTypeDirective(referencedFile, key);
}
}
}
}
function getExternalModuleFileFromDeclaration(declaration) {
var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
Expand Down Expand Up @@ -94462,7 +94477,7 @@ var ts;
}
ts.quotePreferenceFromString = quotePreferenceFromString;
function getQuotePreference(sourceFile, preferences) {
if (preferences.quotePreference) {
if (preferences.quotePreference && preferences.quotePreference !== "auto") {
return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */;
}
else {
Expand Down Expand Up @@ -95033,15 +95048,18 @@ var ts;
if (/^\d+$/.test(text)) {
return text;
}
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = preferences.quotePreference || "auto";
var quoted = JSON.stringify(text);
switch (preferences.quotePreference) {
case undefined:
switch (quotePreference) {
// TODO use getQuotePreference to infer the actual quote style.
case "auto":
case "double":
return quoted;
case "single":
return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'";
default:
return ts.Debug.assertNever(preferences.quotePreference);
return ts.Debug.assertNever(quotePreference);
}
}
ts.quote = quote;
Expand Down Expand Up @@ -113925,7 +113943,9 @@ var ts;
}
function createStubbedMethodBody(preferences) {
return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"),
/*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
/*typeArguments*/ undefined,
// TODO Handle auto quote preference.
[ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
/*multiline*/ true);
}
function createVisibilityModifier(flags) {
Expand Down
4 changes: 2 additions & 2 deletions lib/tsserverlibrary.d.ts
Expand Up @@ -3009,7 +3009,7 @@ declare namespace ts {
}
interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
readonly quotePreference?: "auto" | "double" | "single";
readonly includeCompletionsForModuleExports?: boolean;
readonly includeCompletionsWithInsertText?: boolean;
readonly importModuleSpecifierPreference?: "relative" | "non-relative";
Expand Down Expand Up @@ -7925,7 +7925,7 @@ declare namespace ts.server.protocol {
}
interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
readonly quotePreference?: "auto" | "double" | "single";
/**
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
* This affects lone identifier completions but not completions on the right hand side of `obj.`.
Expand Down
34 changes: 27 additions & 7 deletions lib/tsserverlibrary.js
Expand Up @@ -84,7 +84,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.3";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -57870,7 +57870,9 @@ var ts;
return;
}
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
fileToDirective.set(file.path, key);
// Add the transitive closure of path references loaded by this file (as long as they are not)
// part of an existing type reference.
addReferencedFilesToTypeDirective(file, key);
});
}
return {
Expand Down Expand Up @@ -58025,6 +58027,19 @@ var ts;
}
return false;
}
function addReferencedFilesToTypeDirective(file, key) {
if (fileToDirective.has(file.path))
return;
fileToDirective.set(file.path, key);
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
var fileName = _a[_i].fileName;
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
var referencedFile = host.getSourceFile(resolvedFile);
if (referencedFile) {
addReferencedFilesToTypeDirective(referencedFile, key);
}
}
}
}
function getExternalModuleFileFromDeclaration(declaration) {
var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
Expand Down Expand Up @@ -94772,7 +94787,7 @@ var ts;
}
ts.quotePreferenceFromString = quotePreferenceFromString;
function getQuotePreference(sourceFile, preferences) {
if (preferences.quotePreference) {
if (preferences.quotePreference && preferences.quotePreference !== "auto") {
return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */;
}
else {
Expand Down Expand Up @@ -95343,15 +95358,18 @@ var ts;
if (/^\d+$/.test(text)) {
return text;
}
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = preferences.quotePreference || "auto";
var quoted = JSON.stringify(text);
switch (preferences.quotePreference) {
case undefined:
switch (quotePreference) {
// TODO use getQuotePreference to infer the actual quote style.
case "auto":
case "double":
return quoted;
case "single":
return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'";
default:
return ts.Debug.assertNever(preferences.quotePreference);
return ts.Debug.assertNever(quotePreference);
}
}
ts.quote = quote;
Expand Down Expand Up @@ -114235,7 +114253,9 @@ var ts;
}
function createStubbedMethodBody(preferences) {
return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"),
/*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
/*typeArguments*/ undefined,
// TODO Handle auto quote preference.
[ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
/*multiline*/ true);
}
function createVisibilityModifier(flags) {
Expand Down
2 changes: 1 addition & 1 deletion lib/typescript.d.ts
Expand Up @@ -3009,7 +3009,7 @@ declare namespace ts {
}
interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
readonly quotePreference?: "auto" | "double" | "single";
readonly includeCompletionsForModuleExports?: boolean;
readonly includeCompletionsWithInsertText?: boolean;
readonly importModuleSpecifierPreference?: "relative" | "non-relative";
Expand Down
34 changes: 27 additions & 7 deletions lib/typescript.js
Expand Up @@ -75,7 +75,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.3";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -57861,7 +57861,9 @@ var ts;
return;
}
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
fileToDirective.set(file.path, key);
// Add the transitive closure of path references loaded by this file (as long as they are not)
// part of an existing type reference.
addReferencedFilesToTypeDirective(file, key);
});
}
return {
Expand Down Expand Up @@ -58016,6 +58018,19 @@ var ts;
}
return false;
}
function addReferencedFilesToTypeDirective(file, key) {
if (fileToDirective.has(file.path))
return;
fileToDirective.set(file.path, key);
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
var fileName = _a[_i].fileName;
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
var referencedFile = host.getSourceFile(resolvedFile);
if (referencedFile) {
addReferencedFilesToTypeDirective(referencedFile, key);
}
}
}
}
function getExternalModuleFileFromDeclaration(declaration) {
var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
Expand Down Expand Up @@ -94763,7 +94778,7 @@ var ts;
}
ts.quotePreferenceFromString = quotePreferenceFromString;
function getQuotePreference(sourceFile, preferences) {
if (preferences.quotePreference) {
if (preferences.quotePreference && preferences.quotePreference !== "auto") {
return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */;
}
else {
Expand Down Expand Up @@ -95334,15 +95349,18 @@ var ts;
if (/^\d+$/.test(text)) {
return text;
}
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = preferences.quotePreference || "auto";
var quoted = JSON.stringify(text);
switch (preferences.quotePreference) {
case undefined:
switch (quotePreference) {
// TODO use getQuotePreference to infer the actual quote style.
case "auto":
case "double":
return quoted;
case "single":
return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'";
default:
return ts.Debug.assertNever(preferences.quotePreference);
return ts.Debug.assertNever(quotePreference);
}
}
ts.quote = quote;
Expand Down Expand Up @@ -114226,7 +114244,9 @@ var ts;
}
function createStubbedMethodBody(preferences) {
return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"),
/*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
/*typeArguments*/ undefined,
// TODO Handle auto quote preference.
[ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
/*multiline*/ true);
}
function createVisibilityModifier(flags) {
Expand Down
2 changes: 1 addition & 1 deletion lib/typescriptServices.d.ts
Expand Up @@ -3009,7 +3009,7 @@ declare namespace ts {
}
interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
readonly quotePreference?: "auto" | "double" | "single";
readonly includeCompletionsForModuleExports?: boolean;
readonly includeCompletionsWithInsertText?: boolean;
readonly importModuleSpecifierPreference?: "relative" | "non-relative";
Expand Down

0 comments on commit 2312c09

Please sign in to comment.