mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +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/
|
||||
/out/
|
||||
/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 */
|
||||
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;
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -461,9 +461,9 @@
|
|||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.4.1-rc",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.1-rc.tgz",
|
||||
"integrity": "sha512-SYdeKrJiOajqNTI+sweR70JET43Z567HFNo7DvvBof8J5/bt2cywy7VoWXqZyrsHEmQ9foraLtLr30mcfpfz9w==",
|
||||
"version": "4.4.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz",
|
||||
"integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
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 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) {
|
||||
|
|
@ -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;
|
||||
|
|
@ -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
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
@ -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 */) {
|
||||
|
|
@ -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 */],
|
||||
|
|
@ -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);
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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 = {}));
|
||||
|
|
|
|||
2
src/lib/typescriptServices.d.ts
vendored
2
src/lib/typescriptServices.d.ts
vendored
|
|
@ -5889,7 +5889,7 @@ declare namespace ts {
|
|||
interface InlayHint {
|
||||
text: string;
|
||||
position: number;
|
||||
kind?: InlayHintKind;
|
||||
kind: InlayHintKind;
|
||||
whitespaceBefore?: boolean;
|
||||
whitespaceAfter?: boolean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
@ -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;
|
||||
|
|
@ -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
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
@ -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 */) {
|
||||
|
|
@ -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 */],
|
||||
|
|
@ -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);
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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 = {}));
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue