mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Update ts 4.4
This commit is contained in:
parent
5632f5fed3
commit
10e20baade
9 changed files with 64 additions and 43 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/out/
|
/out/
|
||||||
/release/
|
/release/
|
||||||
|
.DS_Store
|
||||||
10
monaco.d.ts
vendored
10
monaco.d.ts
vendored
|
|
@ -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 */
|
/** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
|
||||||
customWorkerPath?: string;
|
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 {
|
interface IExtraLib {
|
||||||
content: string;
|
content: string;
|
||||||
version: number;
|
version: number;
|
||||||
|
|
@ -212,6 +221,7 @@ declare namespace monaco.languages.typescript {
|
||||||
*/
|
*/
|
||||||
readonly onDidExtraLibsChange: IEvent<void>;
|
readonly onDidExtraLibsChange: IEvent<void>;
|
||||||
readonly workerOptions: WorkerOptions;
|
readonly workerOptions: WorkerOptions;
|
||||||
|
readonly inlayHintsOptions: InlayHintsOptions;
|
||||||
/**
|
/**
|
||||||
* Get the current extra libs registered with the language service.
|
* Get the current extra libs registered with the language service.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -461,9 +461,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.4.1-rc",
|
"version": "4.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.1-rc.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz",
|
||||||
"integrity": "sha512-SYdeKrJiOajqNTI+sweR70JET43Z567HFNo7DvvBof8J5/bt2cywy7VoWXqZyrsHEmQ9foraLtLr30mcfpfz9w==",
|
"integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"which": {
|
"which": {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
"pretty-quick": "^3.1.0",
|
"pretty-quick": "^3.1.0",
|
||||||
"requirejs": "^2.3.6",
|
"requirejs": "^2.3.6",
|
||||||
"terser": "^5.6.0",
|
"terser": "^5.6.0",
|
||||||
"typescript": "^4.4.1-rc"
|
"typescript": "^4.4.2"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -297,7 +297,7 @@ var ts;
|
||||||
// The following is baselined as a literal template type without intervention
|
// The following is baselined as a literal template type without intervention
|
||||||
/** The version of the TypeScript compiler release */
|
/** The version of the TypeScript compiler release */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
||||||
ts.version = "4.4.1-rc";
|
ts.version = "4.4.2";
|
||||||
/* @internal */
|
/* @internal */
|
||||||
var Comparison;
|
var Comparison;
|
||||||
(function (Comparison) {
|
(function (Comparison) {
|
||||||
|
|
@ -20289,6 +20289,11 @@ var ts;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
|
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
|
||||||
|
/* @internal */
|
||||||
|
function isInfinityOrNaNString(name) {
|
||||||
|
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
||||||
|
}
|
||||||
|
ts.isInfinityOrNaNString = isInfinityOrNaNString;
|
||||||
})(ts || (ts = {}));
|
})(ts || (ts = {}));
|
||||||
/* @internal */
|
/* @internal */
|
||||||
var ts;
|
var ts;
|
||||||
|
|
@ -69486,9 +69491,6 @@ var ts;
|
||||||
// but this behavior is consistent with checkIndexedAccess
|
// but this behavior is consistent with checkIndexedAccess
|
||||||
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
|
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
|
||||||
}
|
}
|
||||||
function isInfinityOrNaNString(name) {
|
|
||||||
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
||||||
}
|
|
||||||
function isNumericLiteralName(name) {
|
function isNumericLiteralName(name) {
|
||||||
// The intent of numeric names is that
|
// The intent of numeric names is that
|
||||||
// - they are names with text in a numeric form, and that
|
// - they are names with text in a numeric form, and that
|
||||||
|
|
@ -80161,7 +80163,7 @@ var ts;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var text = ts.getTextOfPropertyName(member.name);
|
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);
|
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -80261,7 +80263,7 @@ var ts;
|
||||||
return evaluate(expr.expression);
|
return evaluate(expr.expression);
|
||||||
case 79 /* Identifier */:
|
case 79 /* Identifier */:
|
||||||
var identifier = expr;
|
var identifier = expr;
|
||||||
if (isInfinityOrNaNString(identifier.escapedText)) {
|
if (ts.isInfinityOrNaNString(identifier.escapedText)) {
|
||||||
return +(identifier.escapedText);
|
return +(identifier.escapedText);
|
||||||
}
|
}
|
||||||
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
||||||
|
|
@ -124913,7 +124915,7 @@ var ts;
|
||||||
if (ts.isJsxExpression(node)) {
|
if (ts.isJsxExpression(node)) {
|
||||||
inJSXElement = false;
|
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);
|
var symbol = typeChecker.getSymbolAtLocation(node);
|
||||||
if (symbol) {
|
if (symbol) {
|
||||||
if (symbol.flags & 2097152 /* Alias */) {
|
if (symbol.flags & 2097152 /* Alias */) {
|
||||||
|
|
@ -125045,9 +125047,6 @@ var ts;
|
||||||
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
|
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
|
||||||
return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === 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([
|
var tokenFromDeclarationMapping = new ts.Map([
|
||||||
[252 /* VariableDeclaration */, 7 /* variable */],
|
[252 /* VariableDeclaration */, 7 /* variable */],
|
||||||
[162 /* Parameter */, 6 /* parameter */],
|
[162 /* Parameter */, 6 /* parameter */],
|
||||||
|
|
@ -137110,7 +137109,7 @@ var ts;
|
||||||
for (var i = 0; i < args.length; ++i) {
|
for (var i = 0; i < args.length; ++i) {
|
||||||
var originalArg = args[i];
|
var originalArg = args[i];
|
||||||
var arg = ts.skipParentheses(originalArg);
|
var arg = ts.skipParentheses(originalArg);
|
||||||
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableExpression(arg)) {
|
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
|
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
|
||||||
|
|
@ -137148,17 +137147,20 @@ var ts;
|
||||||
var regex = leadingParameterNameCommentRegexFactory(name);
|
var regex = leadingParameterNameCommentRegexFactory(name);
|
||||||
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
|
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
|
||||||
}
|
}
|
||||||
function isHintableExpression(node) {
|
function isHintableLiteral(node) {
|
||||||
switch (node.kind) {
|
switch (node.kind) {
|
||||||
case 217 /* PrefixUnaryExpression */:
|
case 217 /* PrefixUnaryExpression */: {
|
||||||
return ts.isLiteralExpression(node.operand);
|
var operand = node.operand;
|
||||||
|
return ts.isLiteralExpression(operand) || ts.isIdentifier(operand) && ts.isInfinityOrNaNString(operand.escapedText);
|
||||||
|
}
|
||||||
case 110 /* TrueKeyword */:
|
case 110 /* TrueKeyword */:
|
||||||
case 95 /* FalseKeyword */:
|
case 95 /* FalseKeyword */:
|
||||||
case 212 /* ArrowFunction */:
|
case 104 /* NullKeyword */:
|
||||||
case 211 /* FunctionExpression */:
|
|
||||||
case 203 /* ObjectLiteralExpression */:
|
|
||||||
case 202 /* ArrayLiteralExpression */:
|
|
||||||
return true;
|
return true;
|
||||||
|
case 79 /* Identifier */: {
|
||||||
|
var name = node.escapedText;
|
||||||
|
return isUndefined(name) || ts.isInfinityOrNaNString(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ts.isLiteralExpression(node);
|
return ts.isLiteralExpression(node);
|
||||||
}
|
}
|
||||||
|
|
@ -137238,6 +137240,9 @@ var ts;
|
||||||
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
|
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function isUndefined(name) {
|
||||||
|
return name === "undefined";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
InlayHints.provideInlayHints = provideInlayHints;
|
InlayHints.provideInlayHints = provideInlayHints;
|
||||||
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
|
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
|
||||||
|
|
|
||||||
2
src/lib/typescriptServices.d.ts
vendored
2
src/lib/typescriptServices.d.ts
vendored
|
|
@ -5889,7 +5889,7 @@ declare namespace ts {
|
||||||
interface InlayHint {
|
interface InlayHint {
|
||||||
text: string;
|
text: string;
|
||||||
position: number;
|
position: number;
|
||||||
kind?: InlayHintKind;
|
kind: InlayHintKind;
|
||||||
whitespaceBefore?: boolean;
|
whitespaceBefore?: boolean;
|
||||||
whitespaceAfter?: boolean;
|
whitespaceAfter?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ var ts;
|
||||||
// The following is baselined as a literal template type without intervention
|
// The following is baselined as a literal template type without intervention
|
||||||
/** The version of the TypeScript compiler release */
|
/** The version of the TypeScript compiler release */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
||||||
ts.version = "4.4.1-rc";
|
ts.version = "4.4.2";
|
||||||
/* @internal */
|
/* @internal */
|
||||||
var Comparison;
|
var Comparison;
|
||||||
(function (Comparison) {
|
(function (Comparison) {
|
||||||
|
|
@ -20289,6 +20289,11 @@ var ts;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
|
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
|
||||||
|
/* @internal */
|
||||||
|
function isInfinityOrNaNString(name) {
|
||||||
|
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
||||||
|
}
|
||||||
|
ts.isInfinityOrNaNString = isInfinityOrNaNString;
|
||||||
})(ts || (ts = {}));
|
})(ts || (ts = {}));
|
||||||
/* @internal */
|
/* @internal */
|
||||||
var ts;
|
var ts;
|
||||||
|
|
@ -69486,9 +69491,6 @@ var ts;
|
||||||
// but this behavior is consistent with checkIndexedAccess
|
// but this behavior is consistent with checkIndexedAccess
|
||||||
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
|
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
|
||||||
}
|
}
|
||||||
function isInfinityOrNaNString(name) {
|
|
||||||
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
||||||
}
|
|
||||||
function isNumericLiteralName(name) {
|
function isNumericLiteralName(name) {
|
||||||
// The intent of numeric names is that
|
// The intent of numeric names is that
|
||||||
// - they are names with text in a numeric form, and that
|
// - they are names with text in a numeric form, and that
|
||||||
|
|
@ -80161,7 +80163,7 @@ var ts;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var text = ts.getTextOfPropertyName(member.name);
|
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);
|
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -80261,7 +80263,7 @@ var ts;
|
||||||
return evaluate(expr.expression);
|
return evaluate(expr.expression);
|
||||||
case 79 /* Identifier */:
|
case 79 /* Identifier */:
|
||||||
var identifier = expr;
|
var identifier = expr;
|
||||||
if (isInfinityOrNaNString(identifier.escapedText)) {
|
if (ts.isInfinityOrNaNString(identifier.escapedText)) {
|
||||||
return +(identifier.escapedText);
|
return +(identifier.escapedText);
|
||||||
}
|
}
|
||||||
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
||||||
|
|
@ -124913,7 +124915,7 @@ var ts;
|
||||||
if (ts.isJsxExpression(node)) {
|
if (ts.isJsxExpression(node)) {
|
||||||
inJSXElement = false;
|
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);
|
var symbol = typeChecker.getSymbolAtLocation(node);
|
||||||
if (symbol) {
|
if (symbol) {
|
||||||
if (symbol.flags & 2097152 /* Alias */) {
|
if (symbol.flags & 2097152 /* Alias */) {
|
||||||
|
|
@ -125045,9 +125047,6 @@ var ts;
|
||||||
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
|
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
|
||||||
return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === 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([
|
var tokenFromDeclarationMapping = new ts.Map([
|
||||||
[252 /* VariableDeclaration */, 7 /* variable */],
|
[252 /* VariableDeclaration */, 7 /* variable */],
|
||||||
[162 /* Parameter */, 6 /* parameter */],
|
[162 /* Parameter */, 6 /* parameter */],
|
||||||
|
|
@ -137110,7 +137109,7 @@ var ts;
|
||||||
for (var i = 0; i < args.length; ++i) {
|
for (var i = 0; i < args.length; ++i) {
|
||||||
var originalArg = args[i];
|
var originalArg = args[i];
|
||||||
var arg = ts.skipParentheses(originalArg);
|
var arg = ts.skipParentheses(originalArg);
|
||||||
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableExpression(arg)) {
|
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
|
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
|
||||||
|
|
@ -137148,17 +137147,20 @@ var ts;
|
||||||
var regex = leadingParameterNameCommentRegexFactory(name);
|
var regex = leadingParameterNameCommentRegexFactory(name);
|
||||||
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
|
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
|
||||||
}
|
}
|
||||||
function isHintableExpression(node) {
|
function isHintableLiteral(node) {
|
||||||
switch (node.kind) {
|
switch (node.kind) {
|
||||||
case 217 /* PrefixUnaryExpression */:
|
case 217 /* PrefixUnaryExpression */: {
|
||||||
return ts.isLiteralExpression(node.operand);
|
var operand = node.operand;
|
||||||
|
return ts.isLiteralExpression(operand) || ts.isIdentifier(operand) && ts.isInfinityOrNaNString(operand.escapedText);
|
||||||
|
}
|
||||||
case 110 /* TrueKeyword */:
|
case 110 /* TrueKeyword */:
|
||||||
case 95 /* FalseKeyword */:
|
case 95 /* FalseKeyword */:
|
||||||
case 212 /* ArrowFunction */:
|
case 104 /* NullKeyword */:
|
||||||
case 211 /* FunctionExpression */:
|
|
||||||
case 203 /* ObjectLiteralExpression */:
|
|
||||||
case 202 /* ArrayLiteralExpression */:
|
|
||||||
return true;
|
return true;
|
||||||
|
case 79 /* Identifier */: {
|
||||||
|
var name = node.escapedText;
|
||||||
|
return isUndefined(name) || ts.isInfinityOrNaNString(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ts.isLiteralExpression(node);
|
return ts.isLiteralExpression(node);
|
||||||
}
|
}
|
||||||
|
|
@ -137238,6 +137240,9 @@ var ts;
|
||||||
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
|
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function isUndefined(name) {
|
||||||
|
return name === "undefined";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
InlayHints.provideInlayHints = provideInlayHints;
|
InlayHints.provideInlayHints = provideInlayHints;
|
||||||
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
|
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
// **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";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue