Skip to content

Commit

Permalink
Update ts 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingwl committed Aug 30, 2021
1 parent 5632f5f commit 10e20ba
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/
/out/
/release/
.DS_Store
10 changes: 10 additions & 0 deletions monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ declare namespace monaco.languages.typescript {
/** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
customWorkerPath?: string;
}
interface InlayHintsOptions {
readonly includeInlayParameterNameHints?: 'none' | 'literals' | 'all';
readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
readonly includeInlayFunctionParameterTypeHints?: boolean;
readonly includeInlayVariableTypeHints?: boolean;
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
readonly includeInlayEnumMemberValueHints?: boolean;
}
interface IExtraLib {
content: string;
version: number;
Expand Down Expand Up @@ -212,6 +221,7 @@ declare namespace monaco.languages.typescript {
*/
readonly onDidExtraLibsChange: IEvent<void>;
readonly workerOptions: WorkerOptions;
readonly inlayHintsOptions: InlayHintsOptions;
/**
* Get the current extra libs registered with the language service.
*/
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"pretty-quick": "^3.1.0",
"requirejs": "^2.3.6",
"terser": "^5.6.0",
"typescript": "^4.4.1-rc"
"typescript": "^4.4.2"
},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/lib.ts

Large diffs are not rendered by default.

41 changes: 23 additions & 18 deletions src/lib/typescriptServices-amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
ts.version = "4.4.1-rc";
ts.version = "4.4.2";
/* @internal */
var Comparison;
(function (Comparison) {
Expand Down Expand Up @@ -20289,6 +20289,11 @@ var ts;
return false;
}
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
/* @internal */
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
ts.isInfinityOrNaNString = isInfinityOrNaNString;
})(ts || (ts = {}));
/* @internal */
var ts;
Expand Down Expand Up @@ -69486,9 +69491,6 @@ var ts;
// but this behavior is consistent with checkIndexedAccess
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
function isNumericLiteralName(name) {
// The intent of numeric names is that
// - they are names with text in a numeric form, and that
Expand Down Expand Up @@ -80161,7 +80163,7 @@ var ts;
}
else {
var text = ts.getTextOfPropertyName(member.name);
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
}
}
Expand Down Expand Up @@ -80261,7 +80263,7 @@ var ts;
return evaluate(expr.expression);
case 79 /* Identifier */:
var identifier = expr;
if (isInfinityOrNaNString(identifier.escapedText)) {
if (ts.isInfinityOrNaNString(identifier.escapedText)) {
return +(identifier.escapedText);
}
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
Expand Down Expand Up @@ -124913,7 +124915,7 @@ var ts;
if (ts.isJsxExpression(node)) {
inJSXElement = false;
}
if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !isInfinityOrNaNString(node.escapedText)) {
if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !ts.isInfinityOrNaNString(node.escapedText)) {
var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
if (symbol.flags & 2097152 /* Alias */) {
Expand Down Expand Up @@ -125045,9 +125047,6 @@ var ts;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "NaN";
}
var tokenFromDeclarationMapping = new ts.Map([
[252 /* VariableDeclaration */, 7 /* variable */],
[162 /* Parameter */, 6 /* parameter */],
Expand Down Expand Up @@ -137110,7 +137109,7 @@ var ts;
for (var i = 0; i < args.length; ++i) {
var originalArg = args[i];
var arg = ts.skipParentheses(originalArg);
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableExpression(arg)) {
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
continue;
}
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
Expand Down Expand Up @@ -137148,17 +137147,20 @@ var ts;
var regex = leadingParameterNameCommentRegexFactory(name);
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
}
function isHintableExpression(node) {
function isHintableLiteral(node) {
switch (node.kind) {
case 217 /* PrefixUnaryExpression */:
return ts.isLiteralExpression(node.operand);
case 217 /* PrefixUnaryExpression */: {
var operand = node.operand;
return ts.isLiteralExpression(operand) || ts.isIdentifier(operand) && ts.isInfinityOrNaNString(operand.escapedText);
}
case 110 /* TrueKeyword */:
case 95 /* FalseKeyword */:
case 212 /* ArrowFunction */:
case 211 /* FunctionExpression */:
case 203 /* ObjectLiteralExpression */:
case 202 /* ArrayLiteralExpression */:
case 104 /* NullKeyword */:
return true;
case 79 /* Identifier */: {
var name = node.escapedText;
return isUndefined(name) || ts.isInfinityOrNaNString(name);
}
}
return ts.isLiteralExpression(node);
}
Expand Down Expand Up @@ -137238,6 +137240,9 @@ var ts;
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
});
}
function isUndefined(name) {
return name === "undefined";
}
}
InlayHints.provideInlayHints = provideInlayHints;
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/typescriptServices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5889,7 +5889,7 @@ declare namespace ts {
interface InlayHint {
text: string;
position: number;
kind?: InlayHintKind;
kind: InlayHintKind;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;
}
Expand Down
41 changes: 23 additions & 18 deletions src/lib/typescriptServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
ts.version = "4.4.1-rc";
ts.version = "4.4.2";
/* @internal */
var Comparison;
(function (Comparison) {
Expand Down Expand Up @@ -20289,6 +20289,11 @@ var ts;
return false;
}
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
/* @internal */
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
ts.isInfinityOrNaNString = isInfinityOrNaNString;
})(ts || (ts = {}));
/* @internal */
var ts;
Expand Down Expand Up @@ -69486,9 +69491,6 @@ var ts;
// but this behavior is consistent with checkIndexedAccess
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
function isNumericLiteralName(name) {
// The intent of numeric names is that
// - they are names with text in a numeric form, and that
Expand Down Expand Up @@ -80161,7 +80163,7 @@ var ts;
}
else {
var text = ts.getTextOfPropertyName(member.name);
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
}
}
Expand Down Expand Up @@ -80261,7 +80263,7 @@ var ts;
return evaluate(expr.expression);
case 79 /* Identifier */:
var identifier = expr;
if (isInfinityOrNaNString(identifier.escapedText)) {
if (ts.isInfinityOrNaNString(identifier.escapedText)) {
return +(identifier.escapedText);
}
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
Expand Down Expand Up @@ -124913,7 +124915,7 @@ var ts;
if (ts.isJsxExpression(node)) {
inJSXElement = false;
}
if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !isInfinityOrNaNString(node.escapedText)) {
if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !ts.isInfinityOrNaNString(node.escapedText)) {
var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
if (symbol.flags & 2097152 /* Alias */) {
Expand Down Expand Up @@ -125045,9 +125047,6 @@ var ts;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "NaN";
}
var tokenFromDeclarationMapping = new ts.Map([
[252 /* VariableDeclaration */, 7 /* variable */],
[162 /* Parameter */, 6 /* parameter */],
Expand Down Expand Up @@ -137110,7 +137109,7 @@ var ts;
for (var i = 0; i < args.length; ++i) {
var originalArg = args[i];
var arg = ts.skipParentheses(originalArg);
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableExpression(arg)) {
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
continue;
}
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
Expand Down Expand Up @@ -137148,17 +137147,20 @@ var ts;
var regex = leadingParameterNameCommentRegexFactory(name);
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
}
function isHintableExpression(node) {
function isHintableLiteral(node) {
switch (node.kind) {
case 217 /* PrefixUnaryExpression */:
return ts.isLiteralExpression(node.operand);
case 217 /* PrefixUnaryExpression */: {
var operand = node.operand;
return ts.isLiteralExpression(operand) || ts.isIdentifier(operand) && ts.isInfinityOrNaNString(operand.escapedText);
}
case 110 /* TrueKeyword */:
case 95 /* FalseKeyword */:
case 212 /* ArrowFunction */:
case 211 /* FunctionExpression */:
case 203 /* ObjectLiteralExpression */:
case 202 /* ArrayLiteralExpression */:
case 104 /* NullKeyword */:
return true;
case 79 /* Identifier */: {
var name = node.escapedText;
return isUndefined(name) || ts.isInfinityOrNaNString(name);
}
}
return ts.isLiteralExpression(node);
}
Expand Down Expand Up @@ -137238,6 +137240,9 @@ var ts;
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
});
}
function isUndefined(name) {
return name === "undefined";
}
}
InlayHints.provideInlayHints = provideInlayHints;
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/typescriptServicesMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
//

export const typescriptVersion = "4.4.1-rc";
export const typescriptVersion = "4.4.2";

0 comments on commit 10e20ba

Please sign in to comment.