From ff771af042703259b36438ce60c2b31f6101515e Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 9 Jul 2022 19:49:27 +0300 Subject: [PATCH 1/6] feat(7411): add JSXNamespacedName --- src/compiler/checker.ts | 37 ++-- src/compiler/diagnosticMessages.json | 4 + src/compiler/emitter.ts | 8 + src/compiler/factory/nodeFactory.ts | 23 +++ src/compiler/factory/nodeTests.ts | 4 + src/compiler/parser.ts | 41 ++++- src/compiler/scanner.ts | 13 -- src/compiler/transformers/jsx.ts | 23 +-- src/compiler/types.ts | 22 ++- src/compiler/utilities.ts | 10 + src/compiler/utilitiesPublic.ts | 4 +- src/services/codefixes/fixAddMissingMember.ts | 2 +- src/services/completions.ts | 2 +- src/services/stringCompletions.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 171 ++++++++++-------- tests/baselines/reference/api/typescript.d.ts | 171 ++++++++++-------- ...NamespaceNamesQuestionableForms.errors.txt | 8 +- ...JsxNamespaceNamesQuestionableForms.symbols | 6 - ...ckJsxNamespaceNamesQuestionableForms.types | 18 +- .../reference/jsxEsprimaFbTestSuite.types | 7 +- .../jsxInvalidEsprimaTestSuite.errors.txt | 12 +- .../reference/jsxInvalidEsprimaTestSuite.js | 2 +- .../jsxInvalidEsprimaTestSuite.types | 10 +- .../jsxNamespacePrefixInName.errors.txt | 27 +-- .../reference/jsxNamespacePrefixInName.js | 6 +- .../jsxNamespacePrefixInName.symbols | 4 +- .../reference/jsxNamespacePrefixInName.types | 95 +++++++--- .../jsxNamespacePrefixInNameReact.errors.txt | 27 +-- .../jsxNamespacePrefixInNameReact.js | 6 +- .../jsxNamespacePrefixInNameReact.symbols | 4 +- .../jsxNamespacePrefixInNameReact.types | 95 +++++++--- .../jsxNamespacePrefixIntrinsics.errors.txt | 12 +- .../jsxNamespacePrefixIntrinsics.symbols | 5 - .../jsxNamespacePrefixIntrinsics.types | 19 +- .../reference/tsxNamespacedAttributeName1.js | 8 + .../tsxNamespacedAttributeName1.symbols | 9 + .../tsxNamespacedAttributeName1.types | 25 +++ .../reference/tsxNamespacedAttributeName2.js | 10 + .../tsxNamespacedAttributeName2.symbols | 12 ++ .../tsxNamespacedAttributeName2.types | 28 +++ .../reference/tsxNamespacedTagName1.js | 12 ++ .../reference/tsxNamespacedTagName1.symbols | 13 ++ .../reference/tsxNamespacedTagName1.types | 33 ++++ .../tsxNamespacedTagName2.errors.txt | 13 ++ .../reference/tsxNamespacedTagName2.js | 14 ++ .../reference/tsxNamespacedTagName2.symbols | 16 ++ .../reference/tsxNamespacedTagName2.types | 36 ++++ .../jsx/tsxNamespacedAttributeName1.tsx | 5 + .../jsx/tsxNamespacedAttributeName2.tsx | 6 + .../conformance/jsx/tsxNamespacedTagName1.tsx | 7 + .../conformance/jsx/tsxNamespacedTagName2.tsx | 8 + 51 files changed, 785 insertions(+), 370 deletions(-) create mode 100644 tests/baselines/reference/tsxNamespacedAttributeName1.js create mode 100644 tests/baselines/reference/tsxNamespacedAttributeName1.symbols create mode 100644 tests/baselines/reference/tsxNamespacedAttributeName1.types create mode 100644 tests/baselines/reference/tsxNamespacedAttributeName2.js create mode 100644 tests/baselines/reference/tsxNamespacedAttributeName2.symbols create mode 100644 tests/baselines/reference/tsxNamespacedAttributeName2.types create mode 100644 tests/baselines/reference/tsxNamespacedTagName1.js create mode 100644 tests/baselines/reference/tsxNamespacedTagName1.symbols create mode 100644 tests/baselines/reference/tsxNamespacedTagName1.types create mode 100644 tests/baselines/reference/tsxNamespacedTagName2.errors.txt create mode 100644 tests/baselines/reference/tsxNamespacedTagName2.js create mode 100644 tests/baselines/reference/tsxNamespacedTagName2.symbols create mode 100644 tests/baselines/reference/tsxNamespacedTagName2.types create mode 100644 tests/cases/conformance/jsx/tsxNamespacedAttributeName1.tsx create mode 100644 tests/cases/conformance/jsx/tsxNamespacedAttributeName2.tsx create mode 100644 tests/cases/conformance/jsx/tsxNamespacedTagName1.tsx create mode 100644 tests/cases/conformance/jsx/tsxNamespacedTagName2.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7b6d49cf8f9c4..df3ce0cfd16b4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11995,7 +11995,7 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n") function isTypeInvalidDueToUnionDiscriminant(contextualType: Type, obj: ObjectLiteralExpression | JsxAttributes): boolean { const list = obj.properties as NodeArray; return list.some(property => { - const nameType = property.name && getLiteralTypeFromPropertyName(property.name); + const nameType = property.name && (isJsxNamespacedName(property.name) ? getStringLiteralType(getTextOfJsxAttributeName(property.name)) : getLiteralTypeFromPropertyName(property.name)); const name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; const expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name); return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property), expected); @@ -17790,8 +17790,8 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n") function *generateJsxAttributes(node: JsxAttributes): ElaborationIterator { if (!length(node.properties)) return; for (const prop of node.properties) { - if (isJsxSpreadAttribute(prop) || isHyphenatedJsxName(idText(prop.name))) continue; - yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: getStringLiteralType(idText(prop.name)) }; + if (isJsxSpreadAttribute(prop) || isHyphenatedJsxName(getTextOfJsxAttributeName(prop.name))) continue; + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: getStringLiteralType(getTextOfJsxAttributeName(prop.name)) }; } } @@ -27195,7 +27195,7 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n") if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, getEscapedTextOfJsxAttributeName(attribute.name)); } else { return getContextualType(attribute.parent, contextFlags); @@ -28247,7 +28247,7 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n") attributeSymbol.target = member; attributesTable.set(attributeSymbol.escapedName, attributeSymbol); allAttributesTable?.set(attributeSymbol.escapedName, attributeSymbol); - if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { + if (getEscapedTextOfJsxAttributeName(attributeDecl.name) === jsxChildrenPropertyName) { explicitlySpecifyChildrenAttribute = true; } } @@ -44622,8 +44622,9 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n") } const { name, initializer } = attr; - if (!seen.get(name.escapedText)) { - seen.set(name.escapedText, true); + const escapedText = getEscapedTextOfJsxAttributeName(name); + if (!seen.get(escapedText)) { + seen.set(escapedText, true); } else { return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); @@ -44636,25 +44637,11 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n") } function checkGrammarJsxName(node: JsxTagNameExpression) { - if (isPropertyAccessExpression(node)) { - let propName: JsxTagNameExpression = node; - do { - const check = checkGrammarJsxNestedIdentifier(propName.name); - if (check) { - return check; - } - propName = propName.expression; - } while (isPropertyAccessExpression(propName)); - const check = checkGrammarJsxNestedIdentifier(propName); - if (check) { - return check; - } + if (isPropertyAccessExpression(node) && isJsxNamespacedName(node.expression)) { + return grammarErrorOnNode(node.expression, Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names); } - - function checkGrammarJsxNestedIdentifier(name: MemberName | ThisExpression) { - if (isIdentifier(name) && idText(name).indexOf(":") !== -1) { - return grammarErrorOnNode(name, Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names); - } + if (isJsxNamespacedName(node) && getJSXTransformEnabled(compilerOptions) && !isIntrinsicJsxName(node.namespace.escapedText)) { + return grammarErrorOnNode(node, Diagnostics.React_components_cannot_include_JSX_namespace_names); } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index ac14f37653136..f4196c24cde84 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2789,6 +2789,10 @@ "category": "Error", "code": 2637 }, + "React components cannot include JSX namespace names": { + "category": "Error", + "code": 2638 + }, "Cannot augment module '{0}' with value exports because it resolves to a non-module entity.": { "category": "Error", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8c7f218ca1012..dfca29b000f7a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1776,6 +1776,8 @@ namespace ts { return emitJsxSelfClosingElement(node as JsxSelfClosingElement); case SyntaxKind.JsxFragment: return emitJsxFragment(node as JsxFragment); + case SyntaxKind.JsxNamespacedName: + return emitJsxNamespacedName(node as JsxNamespacedName); // Synthesized list case SyntaxKind.SyntaxList: @@ -3679,6 +3681,12 @@ namespace ts { } } + function emitJsxNamespacedName(node: JsxNamespacedName) { + emitIdentifierName(node.namespace); + writePunctuation(":"); + emitIdentifierName(node.name); + } + function emitJsxTagName(node: JsxTagNameExpression) { if (node.kind === SyntaxKind.Identifier) { emitExpression(node); diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 76a8c405d722b..510ea10a3f11b 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -418,6 +418,9 @@ namespace ts { updateJsxSpreadAttribute, createJsxExpression, updateJsxExpression, + createJsxNamespacedName, + updateJsxNamespacedName, + createCaseClause, updateCaseClause, createDefaultClause, @@ -5050,6 +5053,26 @@ namespace ts { : node; } + // @api + function createJsxNamespacedName(namespace: Identifier, name: Identifier) { + const node = createBaseNode(SyntaxKind.JsxNamespacedName); + node.namespace = namespace; + node.name = name; + node.transformFlags |= + propagateChildFlags(node.namespace) | + propagateChildFlags(node.name) | + TransformFlags.ContainsJsx; + return node; + } + + // @api + function updateJsxNamespacedName(node: JsxNamespacedName, namespace: Identifier, name: Identifier) { + return node.namespace !== namespace + || node.name !== name + ? update(createJsxNamespacedName(namespace, name), node) + : node; + } + // // Clauses // diff --git a/src/compiler/factory/nodeTests.ts b/src/compiler/factory/nodeTests.ts index 903dea149a191..ad7c57d8bfe45 100644 --- a/src/compiler/factory/nodeTests.ts +++ b/src/compiler/factory/nodeTests.ts @@ -721,6 +721,10 @@ namespace ts { return node.kind === SyntaxKind.JsxExpression; } + export function isJsxNamespacedName(node: Node): node is JsxNamespacedName { + return node.kind === SyntaxKind.JsxNamespacedName; + } + // Clauses export function isCaseClause(node: Node): node is CaseClause { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f9aa3e57498ed..970f4f90f932b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -573,7 +573,9 @@ namespace ts { visitNode(cbNode, (node as JsxExpression).expression); case SyntaxKind.JsxClosingElement: return visitNode(cbNode, (node as JsxClosingElement).tagName); - + case SyntaxKind.JsxNamespacedName: + return visitNode(cbNode, (node as JsxNamespacedName).namespace) || + visitNode(cbNode, (node as JsxNamespacedName).name); case SyntaxKind.OptionalType: case SyntaxKind.RestType: case SyntaxKind.JSDocTypeExpression: @@ -5484,20 +5486,31 @@ namespace ts { function parseJsxElementName(): JsxTagNameExpression { const pos = getNodePos(); - scanJsxIdentifier(); // JsxElement can have name in the form of // propertyAccessExpression // primaryExpression in the form of an identifier and "this" keyword // We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword // We only want to consider "this" as a primaryExpression - let expression: JsxTagNameExpression = token() === SyntaxKind.ThisKeyword ? - parseTokenNode() : parseIdentifierName(); + let expression: JsxTagNameExpression = parseJsxTagName(); while (parseOptional(SyntaxKind.DotToken)) { expression = finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false)), pos) as JsxTagNamePropertyAccess; } return expression; } + function parseJsxTagName(): Identifier | JsxNamespacedName | ThisExpression { + const pos = getNodePos(); + scanJsxIdentifier(); + + const isThis = token() === SyntaxKind.ThisKeyword; + const tagName = parseIdentifierName(); + if (parseOptional(SyntaxKind.ColonToken)) { + scanJsxIdentifier(); + return finishNode(factory.createJsxNamespacedName(tagName, parseIdentifierName()), pos); + } + return isThis ? finishNode(factory.createToken(SyntaxKind.ThisKeyword), pos) : tagName; + } + function parseJsxExpression(inExpressionContext: boolean): JsxExpression | undefined { const pos = getNodePos(); if (!parseExpected(SyntaxKind.OpenBraceToken)) { @@ -5530,9 +5543,8 @@ namespace ts { return parseJsxSpreadAttribute(); } - scanJsxIdentifier(); const pos = getNodePos(); - return finishNode(factory.createJsxAttribute(parseIdentifierName(), parseJsxAttributeValue()), pos); + return finishNode(factory.createJsxAttribute(parseJsxAttributeName(), parseJsxAttributeValue()), pos); } function parseJsxAttributeValue(): JsxAttributeValue | undefined { @@ -5551,6 +5563,18 @@ namespace ts { return undefined; } + function parseJsxAttributeName() { + const pos = getNodePos(); + scanJsxIdentifier(); + + const attrName = parseIdentifierName(); + if (parseOptional(SyntaxKind.ColonToken)) { + scanJsxIdentifier(); + return finishNode(factory.createJsxNamespacedName(attrName, parseIdentifierName()), pos); + } + return attrName; + } + function parseJsxSpreadAttribute(): JsxSpreadAttribute { const pos = getNodePos(); parseExpected(SyntaxKind.OpenBraceToken); @@ -9760,6 +9784,11 @@ namespace ts { return true; } + if (lhs.kind === SyntaxKind.JsxNamespacedName) { + return lhs.namespace.escapedText === (rhs as JsxNamespacedName).namespace.escapedText && + lhs.name.escapedText === (rhs as JsxNamespacedName).name.escapedText; + } + // If we are at this statement then we must have PropertyAccessExpression and because tag name in Jsx element can only // take forms of JsxTagNameExpression which includes an identifier, "this" expression, or another propertyAccessExpression // it is safe to case the expression property as such. See parseJsxElementName for how we parse tag name in Jsx element diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 107ff3a143efa..70acc8b5a90be 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -2349,7 +2349,6 @@ namespace ts { // everything after it to the token // Do note that this means that `scanJsxIdentifier` effectively _mutates_ the visible token without advancing to a new token // Any caller should be expecting this behavior and should only read the pos or token value after calling it. - let namespaceSeparator = false; while (pos < end) { const ch = text.charCodeAt(pos); if (ch === CharacterCodes.minus) { @@ -2357,24 +2356,12 @@ namespace ts { pos++; continue; } - else if (ch === CharacterCodes.colon && !namespaceSeparator) { - tokenValue += ":"; - pos++; - namespaceSeparator = true; - token = SyntaxKind.Identifier; // swap from keyword kind to identifier kind - continue; - } const oldPos = pos; tokenValue += scanIdentifierParts(); // reuse `scanIdentifierParts` so unicode escapes are handled if (pos === oldPos) { break; } } - // Do not include a trailing namespace separator in the token, since this is against the spec. - if (tokenValue.slice(-1) === ":") { - tokenValue = tokenValue.slice(0, -1); - pos--; - } return getIdentifierToken(); } return token; diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index 83a7f70d156a0..9ac579aba4040 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -173,7 +173,7 @@ namespace ts { if (isJsxSpreadAttribute(elem)) { spread = true; } - else if (spread && isJsxAttribute(elem) && elem.name.escapedText === "key") { + else if (spread && isJsxAttribute(elem) && isIdentifier(elem.name) && elem.name.escapedText === "key") { return true; } } @@ -525,12 +525,15 @@ namespace ts { return getTagName(node.openingElement); } else { - const name = node.tagName; - if (isIdentifier(name) && isIntrinsicJsxName(name.escapedText)) { - return factory.createStringLiteral(idText(name)); + const tagName = node.tagName; + if (isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText)) { + return factory.createStringLiteral(idText(tagName)); + } + else if (isJsxNamespacedName(tagName)) { + return factory.createStringLiteral(idText(tagName.namespace) + ":" + idText(tagName.name)); } else { - return createExpressionFromEntityName(factory, name); + return createExpressionFromEntityName(factory, tagName); } } } @@ -542,13 +545,11 @@ namespace ts { */ function getAttributeName(node: JsxAttribute): StringLiteral | Identifier { const name = node.name; - const text = idText(name); - if (/^[A-Za-z_]\w*$/.test(text)) { - return name; - } - else { - return factory.createStringLiteral(text); + if (isIdentifier(name)) { + const text = idText(name); + return (/^[A-Za-z_]\w*$/.test(text)) ? name : factory.createStringLiteral(text); } + return factory.createStringLiteral(idText(name.namespace) + ":" + idText(name.name)); } function visitJsxExpression(node: JsxExpression) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f93f36c369157..b75d6e207c0e5 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -337,6 +337,7 @@ namespace ts { JsxAttributes, JsxSpreadAttribute, JsxExpression, + JsxNamespacedName, // Clauses CaseClause, @@ -2678,17 +2679,25 @@ namespace ts { | Identifier | ThisExpression | JsxTagNamePropertyAccess + | JsxNamespacedName ; export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; } - export interface JsxAttributes extends ObjectLiteralExpressionBase { + export interface JsxAttributes extends PrimaryExpression, Declaration { + readonly properties: NodeArray; readonly kind: SyntaxKind.JsxAttributes; readonly parent: JsxOpeningLikeElement; } + export interface JsxNamespacedName extends PrimaryExpression { + readonly kind: SyntaxKind.JsxNamespacedName; + readonly name: Identifier; + readonly namespace: Identifier; + } + /// The opening element of a ... JsxElement export interface JsxOpeningElement extends Expression { readonly kind: SyntaxKind.JsxOpeningElement; @@ -2726,10 +2735,10 @@ namespace ts { readonly parent: JsxFragment; } - export interface JsxAttribute extends ObjectLiteralElement { + export interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier; + readonly name: Identifier | JsxNamespacedName; /// JSX attribute initializers are optional; is sugar for readonly initializer?: JsxAttributeValue; } @@ -2743,6 +2752,7 @@ namespace ts { export interface JsxSpreadAttribute extends ObjectLiteralElement { readonly kind: SyntaxKind.JsxSpreadAttribute; + readonly name: PropertyName; readonly parent: JsxAttributes; readonly expression: Expression; } @@ -7866,14 +7876,16 @@ namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + createJsxNamespacedName(namespace: Identifier, name: Identifier): JsxNamespacedName; + updateJsxNamespacedName(node: JsxNamespacedName, namespace: Identifier, name: Identifier): JsxNamespacedName; // // Clauses diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4ec193839e680..c292905a00dfe 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1031,6 +1031,8 @@ namespace ts { } case SyntaxKind.JSDocMemberName: return entityNameToString(name.left) + entityNameToString(name.right); + case SyntaxKind.JsxNamespacedName: + return entityNameToString(name.namespace) + ":" + entityNameToString(name.name); default: return Debug.assertNever(name); } @@ -7745,4 +7747,12 @@ namespace ts { export function getParameterTypeNode(parameter: ParameterDeclaration | JSDocParameterTag) { return parameter.kind === SyntaxKind.JSDocParameterTag ? parameter.typeExpression?.type : parameter.type; } + + export function getEscapedTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): __String { + return isIdentifier(node) ? node.escapedText : (getEscapedTextOfJsxAttributeName(node.namespace) + ":" + getEscapedTextOfJsxAttributeName(node.name)) as __String; + } + + export function getTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): string { + return isIdentifier(node) ? idText(node) : getTextOfJsxAttributeName(node.namespace) + ":" + getTextOfJsxAttributeName(node.name); + } } diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index f2f0c030840f8..e4013a62c4673 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -1554,6 +1554,7 @@ namespace ts { case SyntaxKind.JsxElement: case SyntaxKind.JsxSelfClosingElement: case SyntaxKind.JsxFragment: + case SyntaxKind.JsxNamespacedName: case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.ArrayLiteralExpression: case SyntaxKind.ParenthesizedExpression: @@ -1897,7 +1898,8 @@ namespace ts { const kind = node.kind; return kind === SyntaxKind.ThisKeyword || kind === SyntaxKind.Identifier - || kind === SyntaxKind.PropertyAccessExpression; + || kind === SyntaxKind.PropertyAccessExpression + || kind === SyntaxKind.JsxNamespacedName; } /* @internal */ diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index 3c09c850ce502..3017f61187d18 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -588,7 +588,7 @@ namespace ts.codefix { const seenNames = new Set<__String>(); for (const sourceProp of source.attributes.properties) { if (isJsxAttribute(sourceProp)) { - seenNames.add(sourceProp.name.escapedText); + seenNames.add(getEscapedTextOfJsxAttributeName(sourceProp.name)); } if (isJsxSpreadAttribute(sourceProp)) { const type = checker.getTypeAtLocation(sourceProp.expression); diff --git a/src/services/completions.ts b/src/services/completions.ts index c24bc8dcaf165..b87b5bd316215 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -3730,7 +3730,7 @@ namespace ts.Completions { } if (attr.kind === SyntaxKind.JsxAttribute) { - seenNames.add(attr.name.escapedText); + seenNames.add(getEscapedTextOfJsxAttributeName(attr.name)); } else if (isJsxSpreadAttribute(attr)) { setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index a32022f9aee92..1485f9311c0fc 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -293,7 +293,7 @@ namespace ts.Completions.StringCompletions { if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length) return; let type = candidate.getTypeParameterAtPosition(argumentInfo.argumentIndex); if (isJsxOpeningLikeElement(call)) { - const propType = checker.getTypeOfPropertyOfType(type, (editingArgument as JsxAttribute).name.text); + const propType = checker.getTypeOfPropertyOfType(type, getTextOfJsxAttributeName((editingArgument as JsxAttribute).name)); if (propType) { type = propType; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 23bfc30ee197c..21b3d79d0d116 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -394,75 +394,76 @@ declare namespace ts { JsxAttributes = 286, JsxSpreadAttribute = 287, JsxExpression = 288, - CaseClause = 289, - DefaultClause = 290, - HeritageClause = 291, - CatchClause = 292, - AssertClause = 293, - AssertEntry = 294, - ImportTypeAssertionContainer = 295, - PropertyAssignment = 296, - ShorthandPropertyAssignment = 297, - SpreadAssignment = 298, - EnumMember = 299, - UnparsedPrologue = 300, - UnparsedPrepend = 301, - UnparsedText = 302, - UnparsedInternalText = 303, - UnparsedSyntheticReference = 304, - SourceFile = 305, - Bundle = 306, - UnparsedSource = 307, - InputFiles = 308, - JSDocTypeExpression = 309, - JSDocNameReference = 310, - JSDocMemberName = 311, - JSDocAllType = 312, - JSDocUnknownType = 313, - JSDocNullableType = 314, - JSDocNonNullableType = 315, - JSDocOptionalType = 316, - JSDocFunctionType = 317, - JSDocVariadicType = 318, - JSDocNamepathType = 319, - JSDoc = 320, + JsxNamespacedName = 289, + CaseClause = 290, + DefaultClause = 291, + HeritageClause = 292, + CatchClause = 293, + AssertClause = 294, + AssertEntry = 295, + ImportTypeAssertionContainer = 296, + PropertyAssignment = 297, + ShorthandPropertyAssignment = 298, + SpreadAssignment = 299, + EnumMember = 300, + UnparsedPrologue = 301, + UnparsedPrepend = 302, + UnparsedText = 303, + UnparsedInternalText = 304, + UnparsedSyntheticReference = 305, + SourceFile = 306, + Bundle = 307, + UnparsedSource = 308, + InputFiles = 309, + JSDocTypeExpression = 310, + JSDocNameReference = 311, + JSDocMemberName = 312, + JSDocAllType = 313, + JSDocUnknownType = 314, + JSDocNullableType = 315, + JSDocNonNullableType = 316, + JSDocOptionalType = 317, + JSDocFunctionType = 318, + JSDocVariadicType = 319, + JSDocNamepathType = 320, + JSDoc = 321, /** @deprecated Use SyntaxKind.JSDoc */ - JSDocComment = 320, - JSDocText = 321, - JSDocTypeLiteral = 322, - JSDocSignature = 323, - JSDocLink = 324, - JSDocLinkCode = 325, - JSDocLinkPlain = 326, - JSDocTag = 327, - JSDocAugmentsTag = 328, - JSDocImplementsTag = 329, - JSDocAuthorTag = 330, - JSDocDeprecatedTag = 331, - JSDocClassTag = 332, - JSDocPublicTag = 333, - JSDocPrivateTag = 334, - JSDocProtectedTag = 335, - JSDocReadonlyTag = 336, - JSDocOverrideTag = 337, - JSDocCallbackTag = 338, - JSDocEnumTag = 339, - JSDocParameterTag = 340, - JSDocReturnTag = 341, - JSDocThisTag = 342, - JSDocTypeTag = 343, - JSDocTemplateTag = 344, - JSDocTypedefTag = 345, - JSDocSeeTag = 346, - JSDocPropertyTag = 347, - SyntaxList = 348, - NotEmittedStatement = 349, - PartiallyEmittedExpression = 350, - CommaListExpression = 351, - MergeDeclarationMarker = 352, - EndOfDeclarationMarker = 353, - SyntheticReferenceExpression = 354, - Count = 355, + JSDocComment = 321, + JSDocText = 322, + JSDocTypeLiteral = 323, + JSDocSignature = 324, + JSDocLink = 325, + JSDocLinkCode = 326, + JSDocLinkPlain = 327, + JSDocTag = 328, + JSDocAugmentsTag = 329, + JSDocImplementsTag = 330, + JSDocAuthorTag = 331, + JSDocDeprecatedTag = 332, + JSDocClassTag = 333, + JSDocPublicTag = 334, + JSDocPrivateTag = 335, + JSDocProtectedTag = 336, + JSDocReadonlyTag = 337, + JSDocOverrideTag = 338, + JSDocCallbackTag = 339, + JSDocEnumTag = 340, + JSDocParameterTag = 341, + JSDocReturnTag = 342, + JSDocThisTag = 343, + JSDocTypeTag = 344, + JSDocTemplateTag = 345, + JSDocTypedefTag = 346, + JSDocSeeTag = 347, + JSDocPropertyTag = 348, + SyntaxList = 349, + NotEmittedStatement = 350, + PartiallyEmittedExpression = 351, + CommaListExpression = 352, + MergeDeclarationMarker = 353, + EndOfDeclarationMarker = 354, + SyntheticReferenceExpression = 355, + Count = 356, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, @@ -490,10 +491,10 @@ declare namespace ts { FirstStatement = 237, LastStatement = 253, FirstNode = 161, - FirstJSDocNode = 309, - LastJSDocNode = 347, - FirstJSDocTagNode = 327, - LastJSDocTagNode = 347, + FirstJSDocNode = 310, + LastJSDocNode = 348, + FirstJSDocTagNode = 328, + LastJSDocTagNode = 348, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; @@ -1361,14 +1362,20 @@ declare namespace ts { } export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess; + export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; } - export interface JsxAttributes extends ObjectLiteralExpressionBase { + export interface JsxAttributes extends PrimaryExpression, Declaration { + readonly properties: NodeArray; readonly kind: SyntaxKind.JsxAttributes; readonly parent: JsxOpeningLikeElement; } + export interface JsxNamespacedName extends PrimaryExpression { + readonly kind: SyntaxKind.JsxNamespacedName; + readonly name: Identifier; + readonly namespace: Identifier; + } export interface JsxOpeningElement extends Expression { readonly kind: SyntaxKind.JsxOpeningElement; readonly parent: JsxElement; @@ -1396,15 +1403,16 @@ declare namespace ts { readonly kind: SyntaxKind.JsxClosingFragment; readonly parent: JsxFragment; } - export interface JsxAttribute extends ObjectLiteralElement { + export interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier; + readonly name: Identifier | JsxNamespacedName; readonly initializer?: JsxAttributeValue; } export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; export interface JsxSpreadAttribute extends ObjectLiteralElement { readonly kind: SyntaxKind.JsxSpreadAttribute; + readonly name: PropertyName; readonly parent: JsxAttributes; readonly expression: Expression; } @@ -3768,14 +3776,16 @@ declare namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + createJsxNamespacedName(namespace: Identifier, name: Identifier): JsxNamespacedName; + updateJsxNamespacedName(node: JsxNamespacedName, namespace: Identifier, name: Identifier): JsxNamespacedName; createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause; updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause; createDefaultClause(statements: readonly Statement[]): DefaultClause; @@ -4775,6 +4785,7 @@ declare namespace ts { function isJsxAttributes(node: Node): node is JsxAttributes; function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute; function isJsxExpression(node: Node): node is JsxExpression; + function isJsxNamespacedName(node: Node): node is JsxNamespacedName; function isCaseClause(node: Node): node is CaseClause; function isDefaultClause(node: Node): node is DefaultClause; function isHeritageClause(node: Node): node is HeritageClause; @@ -11504,9 +11515,9 @@ declare namespace ts { /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment; /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ - const createJsxAttribute: (name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const createJsxAttribute: (name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const updateJsxAttribute: (node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes; /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 18ef4ee23f826..f8031673d9009 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -394,75 +394,76 @@ declare namespace ts { JsxAttributes = 286, JsxSpreadAttribute = 287, JsxExpression = 288, - CaseClause = 289, - DefaultClause = 290, - HeritageClause = 291, - CatchClause = 292, - AssertClause = 293, - AssertEntry = 294, - ImportTypeAssertionContainer = 295, - PropertyAssignment = 296, - ShorthandPropertyAssignment = 297, - SpreadAssignment = 298, - EnumMember = 299, - UnparsedPrologue = 300, - UnparsedPrepend = 301, - UnparsedText = 302, - UnparsedInternalText = 303, - UnparsedSyntheticReference = 304, - SourceFile = 305, - Bundle = 306, - UnparsedSource = 307, - InputFiles = 308, - JSDocTypeExpression = 309, - JSDocNameReference = 310, - JSDocMemberName = 311, - JSDocAllType = 312, - JSDocUnknownType = 313, - JSDocNullableType = 314, - JSDocNonNullableType = 315, - JSDocOptionalType = 316, - JSDocFunctionType = 317, - JSDocVariadicType = 318, - JSDocNamepathType = 319, - JSDoc = 320, + JsxNamespacedName = 289, + CaseClause = 290, + DefaultClause = 291, + HeritageClause = 292, + CatchClause = 293, + AssertClause = 294, + AssertEntry = 295, + ImportTypeAssertionContainer = 296, + PropertyAssignment = 297, + ShorthandPropertyAssignment = 298, + SpreadAssignment = 299, + EnumMember = 300, + UnparsedPrologue = 301, + UnparsedPrepend = 302, + UnparsedText = 303, + UnparsedInternalText = 304, + UnparsedSyntheticReference = 305, + SourceFile = 306, + Bundle = 307, + UnparsedSource = 308, + InputFiles = 309, + JSDocTypeExpression = 310, + JSDocNameReference = 311, + JSDocMemberName = 312, + JSDocAllType = 313, + JSDocUnknownType = 314, + JSDocNullableType = 315, + JSDocNonNullableType = 316, + JSDocOptionalType = 317, + JSDocFunctionType = 318, + JSDocVariadicType = 319, + JSDocNamepathType = 320, + JSDoc = 321, /** @deprecated Use SyntaxKind.JSDoc */ - JSDocComment = 320, - JSDocText = 321, - JSDocTypeLiteral = 322, - JSDocSignature = 323, - JSDocLink = 324, - JSDocLinkCode = 325, - JSDocLinkPlain = 326, - JSDocTag = 327, - JSDocAugmentsTag = 328, - JSDocImplementsTag = 329, - JSDocAuthorTag = 330, - JSDocDeprecatedTag = 331, - JSDocClassTag = 332, - JSDocPublicTag = 333, - JSDocPrivateTag = 334, - JSDocProtectedTag = 335, - JSDocReadonlyTag = 336, - JSDocOverrideTag = 337, - JSDocCallbackTag = 338, - JSDocEnumTag = 339, - JSDocParameterTag = 340, - JSDocReturnTag = 341, - JSDocThisTag = 342, - JSDocTypeTag = 343, - JSDocTemplateTag = 344, - JSDocTypedefTag = 345, - JSDocSeeTag = 346, - JSDocPropertyTag = 347, - SyntaxList = 348, - NotEmittedStatement = 349, - PartiallyEmittedExpression = 350, - CommaListExpression = 351, - MergeDeclarationMarker = 352, - EndOfDeclarationMarker = 353, - SyntheticReferenceExpression = 354, - Count = 355, + JSDocComment = 321, + JSDocText = 322, + JSDocTypeLiteral = 323, + JSDocSignature = 324, + JSDocLink = 325, + JSDocLinkCode = 326, + JSDocLinkPlain = 327, + JSDocTag = 328, + JSDocAugmentsTag = 329, + JSDocImplementsTag = 330, + JSDocAuthorTag = 331, + JSDocDeprecatedTag = 332, + JSDocClassTag = 333, + JSDocPublicTag = 334, + JSDocPrivateTag = 335, + JSDocProtectedTag = 336, + JSDocReadonlyTag = 337, + JSDocOverrideTag = 338, + JSDocCallbackTag = 339, + JSDocEnumTag = 340, + JSDocParameterTag = 341, + JSDocReturnTag = 342, + JSDocThisTag = 343, + JSDocTypeTag = 344, + JSDocTemplateTag = 345, + JSDocTypedefTag = 346, + JSDocSeeTag = 347, + JSDocPropertyTag = 348, + SyntaxList = 349, + NotEmittedStatement = 350, + PartiallyEmittedExpression = 351, + CommaListExpression = 352, + MergeDeclarationMarker = 353, + EndOfDeclarationMarker = 354, + SyntheticReferenceExpression = 355, + Count = 356, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, @@ -490,10 +491,10 @@ declare namespace ts { FirstStatement = 237, LastStatement = 253, FirstNode = 161, - FirstJSDocNode = 309, - LastJSDocNode = 347, - FirstJSDocTagNode = 327, - LastJSDocTagNode = 347, + FirstJSDocNode = 310, + LastJSDocNode = 348, + FirstJSDocTagNode = 328, + LastJSDocTagNode = 348, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; @@ -1361,14 +1362,20 @@ declare namespace ts { } export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess; + export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; } - export interface JsxAttributes extends ObjectLiteralExpressionBase { + export interface JsxAttributes extends PrimaryExpression, Declaration { + readonly properties: NodeArray; readonly kind: SyntaxKind.JsxAttributes; readonly parent: JsxOpeningLikeElement; } + export interface JsxNamespacedName extends PrimaryExpression { + readonly kind: SyntaxKind.JsxNamespacedName; + readonly name: Identifier; + readonly namespace: Identifier; + } export interface JsxOpeningElement extends Expression { readonly kind: SyntaxKind.JsxOpeningElement; readonly parent: JsxElement; @@ -1396,15 +1403,16 @@ declare namespace ts { readonly kind: SyntaxKind.JsxClosingFragment; readonly parent: JsxFragment; } - export interface JsxAttribute extends ObjectLiteralElement { + export interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier; + readonly name: Identifier | JsxNamespacedName; readonly initializer?: JsxAttributeValue; } export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; export interface JsxSpreadAttribute extends ObjectLiteralElement { readonly kind: SyntaxKind.JsxSpreadAttribute; + readonly name: PropertyName; readonly parent: JsxAttributes; readonly expression: Expression; } @@ -3768,14 +3776,16 @@ declare namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + createJsxNamespacedName(namespace: Identifier, name: Identifier): JsxNamespacedName; + updateJsxNamespacedName(node: JsxNamespacedName, namespace: Identifier, name: Identifier): JsxNamespacedName; createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause; updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause; createDefaultClause(statements: readonly Statement[]): DefaultClause; @@ -4775,6 +4785,7 @@ declare namespace ts { function isJsxAttributes(node: Node): node is JsxAttributes; function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute; function isJsxExpression(node: Node): node is JsxExpression; + function isJsxNamespacedName(node: Node): node is JsxNamespacedName; function isCaseClause(node: Node): node is CaseClause; function isDefaultClause(node: Node): node is DefaultClause; function isHeritageClause(node: Node): node is HeritageClause; @@ -7636,9 +7647,9 @@ declare namespace ts { /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment; /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ - const createJsxAttribute: (name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const createJsxAttribute: (name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const updateJsxAttribute: (node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes; /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ diff --git a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.errors.txt b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.errors.txt index d758a3ed0c9b5..55a28e9330031 100644 --- a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.errors.txt +++ b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.errors.txt @@ -1,9 +1,7 @@ -tests/cases/conformance/jsx/checkJsxNamespaceNamesQuestionableForms.tsx(12,2): error TS2304: Cannot find name 'b:c'. tests/cases/conformance/jsx/checkJsxNamespaceNamesQuestionableForms.tsx(12,2): error TS2633: JSX property access expressions cannot include JSX namespace names -tests/cases/conformance/jsx/checkJsxNamespaceNamesQuestionableForms.tsx(12,10): error TS2304: Cannot find name 'b:c'. -==== tests/cases/conformance/jsx/checkJsxNamespaceNamesQuestionableForms.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/checkJsxNamespaceNamesQuestionableForms.tsx (1 errors) ==== declare namespace JSX { interface IntrinsicElements { 'this:b': any; @@ -17,9 +15,5 @@ tests/cases/conformance/jsx/checkJsxNamespaceNamesQuestionableForms.tsx(12,10): ; ; ~~~ -!!! error TS2304: Cannot find name 'b:c'. - ~~~ !!! error TS2633: JSX property access expressions cannot include JSX namespace names - ~~~ -!!! error TS2304: Cannot find name 'b:c'. ; \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.symbols b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.symbols index 405838180ce31..9f2a5cb77ceef 100644 --- a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.symbols +++ b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.symbols @@ -21,11 +21,5 @@ declare namespace JSX { } ; ->a:b : Symbol(JSX.IntrinsicElements['a:b'], Decl(checkJsxNamespaceNamesQuestionableForms.tsx, 5, 10)) ->a:b : Symbol(JSX.IntrinsicElements['a:b'], Decl(checkJsxNamespaceNamesQuestionableForms.tsx, 5, 10)) - ; ; ->this:b : Symbol(JSX.IntrinsicElements['this:b'], Decl(checkJsxNamespaceNamesQuestionableForms.tsx, 1, 33)) ->this:b : Symbol(JSX.IntrinsicElements['this:b'], Decl(checkJsxNamespaceNamesQuestionableForms.tsx, 1, 33)) - diff --git a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.types b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.types index 9f99922032253..ea6728210b671 100644 --- a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.types +++ b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.types @@ -18,20 +18,26 @@ declare namespace JSX { ; > : any ->a:b : any ->a:b : any +>a : any +>b : any +>a : any +>b : any ; > : any >b:c.x : any ->b:c : any +>b : any +>c : any >x : any >b:c.x : any ->b:c : any +>b : any +>c : any >x : any ; > : any ->this:b : any ->this:b : any +>this : any +>b : any +>this : any +>b : any diff --git a/tests/baselines/reference/jsxEsprimaFbTestSuite.types b/tests/baselines/reference/jsxEsprimaFbTestSuite.types index 4b48d7c378d53..3731eac7a2374 100644 --- a/tests/baselines/reference/jsxEsprimaFbTestSuite.types +++ b/tests/baselines/reference/jsxEsprimaFbTestSuite.types @@ -29,13 +29,18 @@ declare var value; ; > : any ->n:a : any +>n : any +>a : any >n:v : true +>n : any +>v : any {value} ; > {value} : any >a : any >n:foo : string +>n : any +>foo : any >value : any > : any >b : any diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt index cbe83ef6ece5a..f332ade0a3d52 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt @@ -35,7 +35,7 @@ tests/cases/conformance/jsx/17.tsx(1,2): error TS17008: JSX element 'a' has no c tests/cases/conformance/jsx/17.tsx(1,10): error TS1005: '; - ~ + ~ !!! error TS1003: Identifier expected. ==== tests/cases/conformance/jsx/3.tsx (5 errors) ==== <:a />; @@ -127,14 +125,10 @@ tests/cases/conformance/jsx/9.tsx(1,10): error TS2304: Cannot find name 'a:b'. ; ~ !!! error TS17002: Expected corresponding JSX closing tag for 'a:b'. -==== tests/cases/conformance/jsx/9.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/9.tsx (1 errors) ==== ; ~~~ -!!! error TS2304: Cannot find name 'a:b'. - ~~~ !!! error TS2633: JSX property access expressions cannot include JSX namespace names - ~~~ -!!! error TS2304: Cannot find name 'a:b'. ==== tests/cases/conformance/jsx/10.tsx (6 errors) ==== ; ~ diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.js b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.js index e0d10043838a8..8c1d7dea1c27c 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.js +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.js @@ -77,7 +77,7 @@ var x =
one
/* intervening comment */
two
;; //// [1.jsx] > ; //// [2.jsx] -; +; //// [3.jsx] < ; a / > ; diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types index 277d3da9da61b..e3bb4ff69559f 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types @@ -11,6 +11,7 @@ declare var React: any; ; > : any >a : any +> : any === tests/cases/conformance/jsx/3.tsx === <:a />; @@ -51,17 +52,20 @@ declare var React: any; === tests/cases/conformance/jsx/8.tsx === ; > : any ->a:b : any +>a : any +>b : any >b : any === tests/cases/conformance/jsx/9.tsx === ; > : any >a:b.c : any ->a:b : any +>a : any +>b : any >c : any >a:b.c : any ->a:b : any +>a : any +>b : any >c : any === tests/cases/conformance/jsx/10.tsx === diff --git a/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt b/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt index a983e8736b03c..b600af4c155a7 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt +++ b/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt @@ -15,11 +15,10 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(11,32): error TS1003: Identifi tests/cases/compiler/jsxNamespacePrefixInName.tsx(11,68): error TS1005: '>' expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(11,73): error TS1005: ',' expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(11,74): error TS1109: Expression expected. -tests/cases/compiler/jsxNamespacePrefixInName.tsx(21,21): error TS1003: Identifier expected. -tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,26): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(21,27): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(21,29): error TS1005: '...' expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(21,29): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,27): error TS1003: Identifier expected. -tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,29): error TS1005: '...' expected. -tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,29): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,21): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,22): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,25): error TS1005: ',' expected. @@ -27,10 +26,12 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,30): error TS2362: The left tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,38): error TS1005: ':' expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,41): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,42): error TS1109: Expression expected. -tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,24): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,29): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,31): error TS1005: '...' expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,31): error TS2698: Spread types may only be created from object types. -==== tests/cases/compiler/jsxNamespacePrefixInName.tsx (30 errors) ==== +==== tests/cases/compiler/jsxNamespacePrefixInName.tsx (31 errors) ==== var justElement1 = ; var justElement2 = ; var justElement3 = ; @@ -86,17 +87,15 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,24): error TS1003: Identifi var both3 = {"text"}; var endOfIdent1 = ; - ~ -!!! error TS1003: Identifier expected. - var endOfIdent2 = ; - ~ -!!! error TS1003: Identifier expected. ~ !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS1005: '...' expected. ~~~~~~~ !!! error TS2698: Spread types may only be created from object types. + var endOfIdent2 = ; + ~ +!!! error TS1003: Identifier expected. var beginOfIdent1 = <:a attr={"value"} />; ~ @@ -114,8 +113,12 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,24): error TS1003: Identifi ~ !!! error TS1109: Expression expected. var beginOfIdent2 = ; - ~ + ~ !!! error TS1003: Identifier expected. + ~~~~~~~ +!!! error TS1005: '...' expected. + ~~~~~~~ +!!! error TS2698: Spread types may only be created from object types. var upcaseComponent1 = ; // Parsed as intrinsic var upcaseComponent2 = ; // Parsed as instrinsic diff --git a/tests/baselines/reference/jsxNamespacePrefixInName.js b/tests/baselines/reference/jsxNamespacePrefixInName.js index eca335921a34a..8952eea50106b 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInName.js +++ b/tests/baselines/reference/jsxNamespacePrefixInName.js @@ -50,9 +50,9 @@ var justAttribute3 = {"text"}; var both1 = ; var both2 = ; var both3 = {"text"}; -var endOfIdent1 = ; -var endOfIdent2 = ; +var endOfIdent1 = ; +var endOfIdent2 = ; var beginOfIdent1 = < , a, attr = { "value": } / > ; -var beginOfIdent2 = ; +var beginOfIdent2 = ; var upcaseComponent1 = ; // Parsed as intrinsic var upcaseComponent2 = ; // Parsed as instrinsic diff --git a/tests/baselines/reference/jsxNamespacePrefixInName.symbols b/tests/baselines/reference/jsxNamespacePrefixInName.symbols index 876ffa59e06b2..aaa19da28e0ce 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInName.symbols +++ b/tests/baselines/reference/jsxNamespacePrefixInName.symbols @@ -68,11 +68,10 @@ var both3 = {"text"}; var endOfIdent1 = ; >endOfIdent1 : Symbol(endOfIdent1, Decl(jsxNamespacePrefixInName.tsx, 20, 3)) ->attr : Symbol(attr, Decl(jsxNamespacePrefixInName.tsx, 20, 21)) var endOfIdent2 = ; >endOfIdent2 : Symbol(endOfIdent2, Decl(jsxNamespacePrefixInName.tsx, 21, 3)) ->attr : Symbol(attr, Decl(jsxNamespacePrefixInName.tsx, 21, 20)) +>attr: : Symbol(attr:, Decl(jsxNamespacePrefixInName.tsx, 21, 20)) var beginOfIdent1 = <:a attr={"value"} />; >beginOfIdent1 : Symbol(beginOfIdent1, Decl(jsxNamespacePrefixInName.tsx, 23, 3)) @@ -82,7 +81,6 @@ var beginOfIdent1 = <:a attr={"value"} />; var beginOfIdent2 = ; >beginOfIdent2 : Symbol(beginOfIdent2, Decl(jsxNamespacePrefixInName.tsx, 24, 3)) ->attr : Symbol(attr, Decl(jsxNamespacePrefixInName.tsx, 24, 24)) var upcaseComponent1 = ; // Parsed as intrinsic >upcaseComponent1 : Symbol(upcaseComponent1, Decl(jsxNamespacePrefixInName.tsx, 26, 3)) diff --git a/tests/baselines/reference/jsxNamespacePrefixInName.types b/tests/baselines/reference/jsxNamespacePrefixInName.types index 616ac016b7935..c86c34874c2d9 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInName.types +++ b/tests/baselines/reference/jsxNamespacePrefixInName.types @@ -2,50 +2,62 @@ var justElement1 = ; >justElement1 : any > : any ->a:element : any +>a : any +>element : any var justElement2 = ; >justElement2 : any > : any ->a:element : any ->a:element : any +>a : any +>element : any +>a : any +>element : any var justElement3 = ; >justElement3 : any > : any ->a:element : any +>a : any +>element : any >attr : string >"value" : "value" ->a:element : any +>a : any +>element : any var justElement4 = {"text"}; >justElement4 : any >{"text"} : any ->a:element : any +>a : any +>element : any >"text" : "text" ->a:element : any +>a : any +>element : any var justElement5 = {"text"}; >justElement5 : any >{"text"} : any ->a:element : any +>a : any +>element : any >attr : string >"value" : "value" >"text" : "text" ->a:element : any +>a : any +>element : any var tooManySeparators1 = ; >tooManySeparators1 : any > : any ->a:ele : any +>a : any +>ele : any >ment : true var tooManySeparators2 = ; >tooManySeparators2 : any >a:ele : any +>a : any +>ele : any >ment : true ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -54,11 +66,13 @@ var tooManySeparators2 = ; var tooManySeparators3 = ; >tooManySeparators3 : any >a:ele : any +>a : any +>ele : any >ment : true >attr : string >"value" : "value" ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -67,10 +81,12 @@ var tooManySeparators3 = ; var tooManySeparators4 = {"text"}; >tooManySeparators4 : any >{"text"}a:ele : any +>a : any +>ele : any >ment : true >"text" : "text" ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -79,12 +95,14 @@ var tooManySeparators4 = {"text"}; var tooManySeparators5 = {"text"}; >tooManySeparators5 : any >{"text"}a:ele : any +>a : any +>ele : any >ment : true >attr : string >"value" : "value" >"text" : "text" ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -95,6 +113,8 @@ var justAttribute1 = ; > : any >element : any >a:attr : string +>a : any +>attr : any >"value" : "value" var justAttribute2 = ; @@ -102,6 +122,8 @@ var justAttribute2 = ; > : any >element : any >a:attr : string +>a : any +>attr : any >"value" : "value" >element : any @@ -110,6 +132,8 @@ var justAttribute3 = {"text"}; >{"text"} : any >element : any >a:attr : string +>a : any +>attr : any >"value" : "value" >"text" : "text" >element : any @@ -117,39 +141,52 @@ var justAttribute3 = {"text"}; var both1 = ; >both1 : any > : any ->a:element : any +>a : any +>element : any >a:attr : string +>a : any +>attr : any >"value" : "value" var both2 = ; >both2 : any > : any ->a:element : any +>a : any +>element : any >k:attr : string +>k : any +>attr : any >"value" : "value" ->a:element : any +>a : any +>element : any var both3 = {"text"}; >both3 : any >{"text"} : any ->a:element : any +>a : any +>element : any >a:attr : string +>a : any +>attr : any >"value" : "value" >"text" : "text" ->a:element : any +>a : any +>element : any var endOfIdent1 = ; >endOfIdent1 : any > : any >a : any ->attr : string +>attr : any >"value" : "value" var endOfIdent2 = ; >endOfIdent2 : any > : any >a : any ->attr : true +>attr: : string +>attr : any +> : any >"value" : "value" var beginOfIdent1 = <:a attr={"value"} />; @@ -171,16 +208,18 @@ var beginOfIdent2 = ; >beginOfIdent2 : any > : any >a : any ->attr : string +>attr : any >"value" : "value" var upcaseComponent1 = ; // Parsed as intrinsic >upcaseComponent1 : any > : any ->ns:Upcase : any +>ns : any +>Upcase : any var upcaseComponent2 = ; // Parsed as instrinsic >upcaseComponent2 : any > : any ->Upcase:element : any +>Upcase : any +>element : any diff --git a/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt b/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt index bae65da057a4b..9aa5eea9df2a8 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt +++ b/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt @@ -15,11 +15,10 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(13,32): error TS1003: Ide tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(13,68): error TS1005: '>' expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(13,73): error TS1005: ',' expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(13,74): error TS1109: Expression expected. -tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(23,21): error TS1003: Identifier expected. -tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,26): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(23,27): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(23,29): error TS1005: '...' expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(23,29): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,27): error TS1003: Identifier expected. -tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,29): error TS1005: '...' expected. -tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,29): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,21): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,22): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,25): error TS1005: ',' expected. @@ -27,10 +26,12 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,30): error TS2362: The tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,38): error TS1005: ':' expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,41): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,42): error TS1109: Expression expected. -tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,24): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,29): error TS1003: Identifier expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,31): error TS1005: '...' expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,31): error TS2698: Spread types may only be created from object types. -==== tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx (30 errors) ==== +==== tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx (31 errors) ==== declare var React: any; var justElement1 = ; @@ -88,17 +89,15 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,24): error TS1003: Ide var both3 = {"text"}; var endOfIdent1 = ; - ~ -!!! error TS1003: Identifier expected. - var endOfIdent2 = ; - ~ -!!! error TS1003: Identifier expected. ~ !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS1005: '...' expected. ~~~~~~~ !!! error TS2698: Spread types may only be created from object types. + var endOfIdent2 = ; + ~ +!!! error TS1003: Identifier expected. var beginOfIdent1 = <:a attr={"value"} />; ~ @@ -116,8 +115,12 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,24): error TS1003: Ide ~ !!! error TS1109: Expression expected. var beginOfIdent2 = ; - ~ + ~ !!! error TS1003: Identifier expected. + ~~~~~~~ +!!! error TS1005: '...' expected. + ~~~~~~~ +!!! error TS2698: Spread types may only be created from object types. var upcaseComponent1 = ; // Parsed as intrinsic var upcaseComponent2 = ; // Parsed as instrinsic diff --git a/tests/baselines/reference/jsxNamespacePrefixInNameReact.js b/tests/baselines/reference/jsxNamespacePrefixInNameReact.js index c0cee80308aac..84158b12986f5 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInNameReact.js +++ b/tests/baselines/reference/jsxNamespacePrefixInNameReact.js @@ -63,9 +63,9 @@ var justAttribute3 = React.createElement("element", { "a:attr": "value" }, "text var both1 = React.createElement("a:element", { "a:attr": "value" }); var both2 = React.createElement("a:element", { "k:attr": "value" }); var both3 = React.createElement("a:element", { "a:attr": "value" }, "text"); -var endOfIdent1 = React.createElement("a", { attr: "value" }); -var endOfIdent2 = React.createElement("a", __assign({ attr: true }, "value")); +var endOfIdent1 = React.createElement("a:attr", __assign({}, "value")); +var endOfIdent2 = React.createElement("a", { "attr:": "value" }); var beginOfIdent1 = < , a, attr = { "value": } / > ; -var beginOfIdent2 = React.createElement("a", { attr: "value" }); +var beginOfIdent2 = React.createElement("a:attr", __assign({}, "value")); var upcaseComponent1 = React.createElement("ns:Upcase", null); // Parsed as intrinsic var upcaseComponent2 = React.createElement("Upcase:element", null); // Parsed as instrinsic diff --git a/tests/baselines/reference/jsxNamespacePrefixInNameReact.symbols b/tests/baselines/reference/jsxNamespacePrefixInNameReact.symbols index 34136573521b5..e5b56ad08f5e8 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInNameReact.symbols +++ b/tests/baselines/reference/jsxNamespacePrefixInNameReact.symbols @@ -71,11 +71,10 @@ var both3 = {"text"}; var endOfIdent1 = ; >endOfIdent1 : Symbol(endOfIdent1, Decl(jsxNamespacePrefixInNameReact.tsx, 22, 3)) ->attr : Symbol(attr, Decl(jsxNamespacePrefixInNameReact.tsx, 22, 21)) var endOfIdent2 = ; >endOfIdent2 : Symbol(endOfIdent2, Decl(jsxNamespacePrefixInNameReact.tsx, 23, 3)) ->attr : Symbol(attr, Decl(jsxNamespacePrefixInNameReact.tsx, 23, 20)) +>attr: : Symbol(attr:, Decl(jsxNamespacePrefixInNameReact.tsx, 23, 20)) var beginOfIdent1 = <:a attr={"value"} />; >beginOfIdent1 : Symbol(beginOfIdent1, Decl(jsxNamespacePrefixInNameReact.tsx, 25, 3)) @@ -85,7 +84,6 @@ var beginOfIdent1 = <:a attr={"value"} />; var beginOfIdent2 = ; >beginOfIdent2 : Symbol(beginOfIdent2, Decl(jsxNamespacePrefixInNameReact.tsx, 26, 3)) ->attr : Symbol(attr, Decl(jsxNamespacePrefixInNameReact.tsx, 26, 24)) var upcaseComponent1 = ; // Parsed as intrinsic >upcaseComponent1 : Symbol(upcaseComponent1, Decl(jsxNamespacePrefixInNameReact.tsx, 28, 3)) diff --git a/tests/baselines/reference/jsxNamespacePrefixInNameReact.types b/tests/baselines/reference/jsxNamespacePrefixInNameReact.types index e67a617796670..c177fc2e587fb 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInNameReact.types +++ b/tests/baselines/reference/jsxNamespacePrefixInNameReact.types @@ -5,50 +5,62 @@ declare var React: any; var justElement1 = ; >justElement1 : any > : any ->a:element : any +>a : any +>element : any var justElement2 = ; >justElement2 : any > : any ->a:element : any ->a:element : any +>a : any +>element : any +>a : any +>element : any var justElement3 = ; >justElement3 : any > : any ->a:element : any +>a : any +>element : any >attr : string >"value" : "value" ->a:element : any +>a : any +>element : any var justElement4 = {"text"}; >justElement4 : any >{"text"} : any ->a:element : any +>a : any +>element : any >"text" : "text" ->a:element : any +>a : any +>element : any var justElement5 = {"text"}; >justElement5 : any >{"text"} : any ->a:element : any +>a : any +>element : any >attr : string >"value" : "value" >"text" : "text" ->a:element : any +>a : any +>element : any var tooManySeparators1 = ; >tooManySeparators1 : any > : any ->a:ele : any +>a : any +>ele : any >ment : true var tooManySeparators2 = ; >tooManySeparators2 : any >a:ele : any +>a : any +>ele : any >ment : true ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -57,11 +69,13 @@ var tooManySeparators2 = ; var tooManySeparators3 = ; >tooManySeparators3 : any >a:ele : any +>a : any +>ele : any >ment : true >attr : string >"value" : "value" ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -70,10 +84,12 @@ var tooManySeparators3 = ; var tooManySeparators4 = {"text"}; >tooManySeparators4 : any >{"text"}a:ele : any +>a : any +>ele : any >ment : true >"text" : "text" ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -82,12 +98,14 @@ var tooManySeparators4 = {"text"}; var tooManySeparators5 = {"text"}; >tooManySeparators5 : any >{"text"}a:ele : any +>a : any +>ele : any >ment : true >attr : string >"value" : "value" >"text" : "text" ->a:ele : any +>a : any +>ele : any >ment : any >> : boolean > : any @@ -98,6 +116,8 @@ var justAttribute1 = ; > : any >element : any >a:attr : string +>a : any +>attr : any >"value" : "value" var justAttribute2 = ; @@ -105,6 +125,8 @@ var justAttribute2 = ; > : any >element : any >a:attr : string +>a : any +>attr : any >"value" : "value" >element : any @@ -113,6 +135,8 @@ var justAttribute3 = {"text"}; >{"text"} : any >element : any >a:attr : string +>a : any +>attr : any >"value" : "value" >"text" : "text" >element : any @@ -120,39 +144,52 @@ var justAttribute3 = {"text"}; var both1 = ; >both1 : any > : any ->a:element : any +>a : any +>element : any >a:attr : string +>a : any +>attr : any >"value" : "value" var both2 = ; >both2 : any > : any ->a:element : any +>a : any +>element : any >k:attr : string +>k : any +>attr : any >"value" : "value" ->a:element : any +>a : any +>element : any var both3 = {"text"}; >both3 : any >{"text"} : any ->a:element : any +>a : any +>element : any >a:attr : string +>a : any +>attr : any >"value" : "value" >"text" : "text" ->a:element : any +>a : any +>element : any var endOfIdent1 = ; >endOfIdent1 : any > : any >a : any ->attr : string +>attr : any >"value" : "value" var endOfIdent2 = ; >endOfIdent2 : any > : any >a : any ->attr : true +>attr: : string +>attr : any +> : any >"value" : "value" var beginOfIdent1 = <:a attr={"value"} />; @@ -174,16 +211,18 @@ var beginOfIdent2 = ; >beginOfIdent2 : any > : any >a : any ->attr : string +>attr : any >"value" : "value" var upcaseComponent1 = ; // Parsed as intrinsic >upcaseComponent1 : any > : any ->ns:Upcase : any +>ns : any +>Upcase : any var upcaseComponent2 = ; // Parsed as instrinsic >upcaseComponent2 : any > : any ->Upcase:element : any +>Upcase : any +>element : any diff --git a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt index 22bacb161c5dd..c9a4a81eeeec1 100644 --- a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt +++ b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt @@ -1,11 +1,7 @@ tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(15,18): error TS2339: Property 'element' does not exist on type 'JSX.IntrinsicElements'. -tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(16,30): error TS2322: Type '{ attribute: string; }' is not assignable to type '{ "ns:attribute": string; }'. - Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'? -tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(17,30): error TS2322: Type '{ "ns:invalid": string; }' is not assignable to type '{ "ns:attribute": string; }'. - Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'. -==== tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx (3 errors) ==== +==== tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx (1 errors) ==== declare namespace JSX { interface IntrinsicElements { "ns:element": { @@ -24,11 +20,5 @@ tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx(17,30): error TS2322: Type ~~~~~~~~~~~ !!! error TS2339: Property 'element' does not exist on type 'JSX.IntrinsicElements'. const invalid2 = ; - ~~~~~~~~~ -!!! error TS2322: Type '{ attribute: string; }' is not assignable to type '{ "ns:attribute": string; }'. -!!! error TS2322: Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'? const invalid3 = ; - ~~~~~~~~~~ -!!! error TS2322: Type '{ "ns:invalid": string; }' is not assignable to type '{ "ns:attribute": string; }'. -!!! error TS2322: Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.symbols b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.symbols index b12b339ca223a..31ef8f7b2db0b 100644 --- a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.symbols +++ b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.symbols @@ -22,27 +22,22 @@ declare namespace JSX { const valid = ; >valid : Symbol(valid, Decl(jsxNamespacePrefixIntrinsics.tsx, 10, 5)) ->ns:element : Symbol(JSX.IntrinsicElements["ns:element"], Decl(jsxNamespacePrefixIntrinsics.tsx, 1, 31)) >ns:attribute : Symbol(ns:attribute, Decl(jsxNamespacePrefixIntrinsics.tsx, 10, 25)) const validUpcase1 = ; >validUpcase1 : Symbol(validUpcase1, Decl(jsxNamespacePrefixIntrinsics.tsx, 11, 5)) ->ns:NamespacedUpcaseAlsoIntrinsic : Symbol(JSX.IntrinsicElements["ns:NamespacedUpcaseAlsoIntrinsic"], Decl(jsxNamespacePrefixIntrinsics.tsx, 4, 6)) const validUpcase2 = ; >validUpcase2 : Symbol(validUpcase2, Decl(jsxNamespacePrefixIntrinsics.tsx, 12, 5)) ->NS:NamespacedUpcaseAlsoIntrinsic : Symbol(JSX.IntrinsicElements["NS:NamespacedUpcaseAlsoIntrinsic"], Decl(jsxNamespacePrefixIntrinsics.tsx, 5, 44)) const invalid1 = ; >invalid1 : Symbol(invalid1, Decl(jsxNamespacePrefixIntrinsics.tsx, 14, 5)) const invalid2 = ; >invalid2 : Symbol(invalid2, Decl(jsxNamespacePrefixIntrinsics.tsx, 15, 5)) ->ns:element : Symbol(JSX.IntrinsicElements["ns:element"], Decl(jsxNamespacePrefixIntrinsics.tsx, 1, 31)) >attribute : Symbol(attribute, Decl(jsxNamespacePrefixIntrinsics.tsx, 15, 28)) const invalid3 = ; >invalid3 : Symbol(invalid3, Decl(jsxNamespacePrefixIntrinsics.tsx, 16, 5)) ->ns:element : Symbol(JSX.IntrinsicElements["ns:element"], Decl(jsxNamespacePrefixIntrinsics.tsx, 1, 31)) >ns:invalid : Symbol(ns:invalid, Decl(jsxNamespacePrefixIntrinsics.tsx, 16, 28)) diff --git a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.types b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.types index 962128ca2f41a..1b4f542baee5d 100644 --- a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.types +++ b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.types @@ -19,18 +19,23 @@ declare namespace JSX { const valid = ; >valid : any > : any ->ns:element : any +>ns : any +>element : any >ns:attribute : string +>ns : any +>attribute : any const validUpcase1 = ; >validUpcase1 : any > : any ->ns:NamespacedUpcaseAlsoIntrinsic : any +>ns : any +>NamespacedUpcaseAlsoIntrinsic : any const validUpcase2 = ; >validUpcase2 : any > : any ->NS:NamespacedUpcaseAlsoIntrinsic : any +>NS : any +>NamespacedUpcaseAlsoIntrinsic : any const invalid1 = ; >invalid1 : any @@ -40,12 +45,16 @@ const invalid1 = ; const invalid2 = ; >invalid2 : any > : any ->ns:element : any +>ns : any +>element : any >attribute : string const invalid3 = ; >invalid3 : any > : any ->ns:element : any +>ns : any +>element : any >ns:invalid : string +>ns : any +>invalid : any diff --git a/tests/baselines/reference/tsxNamespacedAttributeName1.js b/tests/baselines/reference/tsxNamespacedAttributeName1.js new file mode 100644 index 0000000000000..736243791ff48 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedAttributeName1.js @@ -0,0 +1,8 @@ +//// [a.tsx] +const a = ; +const b = ; + + +//// [a.jsx] +var a = ; +var b = ; diff --git a/tests/baselines/reference/tsxNamespacedAttributeName1.symbols b/tests/baselines/reference/tsxNamespacedAttributeName1.symbols new file mode 100644 index 0000000000000..3256bddfb67d2 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedAttributeName1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/jsx/a.tsx === +const a = ; +>a : Symbol(a, Decl(a.tsx, 0, 5)) +>a:b : Symbol(a:b, Decl(a.tsx, 0, 19)) + +const b = ; +>b : Symbol(b, Decl(a.tsx, 1, 5)) +>a:b : Symbol(a:b, Decl(a.tsx, 1, 21)) + diff --git a/tests/baselines/reference/tsxNamespacedAttributeName1.types b/tests/baselines/reference/tsxNamespacedAttributeName1.types new file mode 100644 index 0000000000000..4ab13055b7613 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedAttributeName1.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/jsx/a.tsx === +const a = ; +>a : error +> : error +>svg : error +>path : error +>a:b : number +>a : error +>b : error +>1 : 1 +>svg : error +>path : error + +const b = ; +>b : error +> : error +>svg : error +>path : error +>a:b : number +>a : error +>b : error +>1 : 1 +>svg : error +>path : error + diff --git a/tests/baselines/reference/tsxNamespacedAttributeName2.js b/tests/baselines/reference/tsxNamespacedAttributeName2.js new file mode 100644 index 0000000000000..a99853e5e96dc --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedAttributeName2.js @@ -0,0 +1,10 @@ +//// [a.tsx] +declare var React: any; + +const a = ; +const b = ; + + +//// [a.js] +var a = React.createElement("svg:path", { "a:b": 1 }); +var b = React.createElement("svg:path", { "a:b": 1 }); diff --git a/tests/baselines/reference/tsxNamespacedAttributeName2.symbols b/tests/baselines/reference/tsxNamespacedAttributeName2.symbols new file mode 100644 index 0000000000000..ba9168814e5db --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedAttributeName2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/jsx/a.tsx === +declare var React: any; +>React : Symbol(React, Decl(a.tsx, 0, 11)) + +const a = ; +>a : Symbol(a, Decl(a.tsx, 2, 5)) +>a:b : Symbol(a:b, Decl(a.tsx, 2, 19)) + +const b = ; +>b : Symbol(b, Decl(a.tsx, 3, 5)) +>a:b : Symbol(a:b, Decl(a.tsx, 3, 21)) + diff --git a/tests/baselines/reference/tsxNamespacedAttributeName2.types b/tests/baselines/reference/tsxNamespacedAttributeName2.types new file mode 100644 index 0000000000000..9415a504a8f68 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedAttributeName2.types @@ -0,0 +1,28 @@ +=== tests/cases/conformance/jsx/a.tsx === +declare var React: any; +>React : any + +const a = ; +>a : error +> : error +>svg : error +>path : error +>a:b : number +>a : error +>b : error +>1 : 1 +>svg : error +>path : error + +const b = ; +>b : error +> : error +>svg : error +>path : error +>a:b : number +>a : error +>b : error +>1 : 1 +>svg : error +>path : error + diff --git a/tests/baselines/reference/tsxNamespacedTagName1.js b/tests/baselines/reference/tsxNamespacedTagName1.js new file mode 100644 index 0000000000000..8fe1db6f88a26 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName1.js @@ -0,0 +1,12 @@ +//// [a.tsx] +const a = ; +const b = ; +const c = ; +const d = ; + + +//// [a.jsx] +var a = ; +var b = ; +var c = ; +var d = ; diff --git a/tests/baselines/reference/tsxNamespacedTagName1.symbols b/tests/baselines/reference/tsxNamespacedTagName1.symbols new file mode 100644 index 0000000000000..da528e4be8af6 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/jsx/a.tsx === +const a = ; +>a : Symbol(a, Decl(a.tsx, 0, 5)) + +const b = ; +>b : Symbol(b, Decl(a.tsx, 1, 5)) + +const c = ; +>c : Symbol(c, Decl(a.tsx, 2, 5)) + +const d = ; +>d : Symbol(d, Decl(a.tsx, 3, 5)) + diff --git a/tests/baselines/reference/tsxNamespacedTagName1.types b/tests/baselines/reference/tsxNamespacedTagName1.types new file mode 100644 index 0000000000000..c1ae229108065 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName1.types @@ -0,0 +1,33 @@ +=== tests/cases/conformance/jsx/a.tsx === +const a = ; +>a : error +> : error +>svg : error +>path : error +>svg : error +>path : error + +const b = ; +>b : error +> : error +>svg : error +>path : error +>svg : error +>path : error + +const c = ; +>c : error +> : error +>A : error +>foo : error +>A : error +>foo : error + +const d = ; +>d : error +> : error +>a : error +>foo : error +>a : error +>foo : error + diff --git a/tests/baselines/reference/tsxNamespacedTagName2.errors.txt b/tests/baselines/reference/tsxNamespacedTagName2.errors.txt new file mode 100644 index 0000000000000..c64ff58b717e8 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName2.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/jsx/a.tsx(5,12): error TS2638: React components cannot include JSX namespace names + + +==== tests/cases/conformance/jsx/a.tsx (1 errors) ==== + declare var React: any; + + const a = ; + const b = ; + const c = ; + ~~~~~ +!!! error TS2638: React components cannot include JSX namespace names + const d = ; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxNamespacedTagName2.js b/tests/baselines/reference/tsxNamespacedTagName2.js new file mode 100644 index 0000000000000..415b4bf70cebb --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName2.js @@ -0,0 +1,14 @@ +//// [a.tsx] +declare var React: any; + +const a = ; +const b = ; +const c = ; +const d = ; + + +//// [a.js] +var a = React.createElement("svg:path", null); +var b = React.createElement("svg:path", null); +var c = React.createElement("A:foo", null); +var d = React.createElement("a:foo", null); diff --git a/tests/baselines/reference/tsxNamespacedTagName2.symbols b/tests/baselines/reference/tsxNamespacedTagName2.symbols new file mode 100644 index 0000000000000..46adee08a03f4 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName2.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/jsx/a.tsx === +declare var React: any; +>React : Symbol(React, Decl(a.tsx, 0, 11)) + +const a = ; +>a : Symbol(a, Decl(a.tsx, 2, 5)) + +const b = ; +>b : Symbol(b, Decl(a.tsx, 3, 5)) + +const c = ; +>c : Symbol(c, Decl(a.tsx, 4, 5)) + +const d = ; +>d : Symbol(d, Decl(a.tsx, 5, 5)) + diff --git a/tests/baselines/reference/tsxNamespacedTagName2.types b/tests/baselines/reference/tsxNamespacedTagName2.types new file mode 100644 index 0000000000000..c90a5aaedc127 --- /dev/null +++ b/tests/baselines/reference/tsxNamespacedTagName2.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/jsx/a.tsx === +declare var React: any; +>React : any + +const a = ; +>a : any +> : any +>svg : any +>path : any +>svg : any +>path : any + +const b = ; +>b : any +> : any +>svg : any +>path : any +>svg : any +>path : any + +const c = ; +>c : any +> : any +>A : any +>foo : any +>A : any +>foo : any + +const d = ; +>d : any +> : any +>a : any +>foo : any +>a : any +>foo : any + diff --git a/tests/cases/conformance/jsx/tsxNamespacedAttributeName1.tsx b/tests/cases/conformance/jsx/tsxNamespacedAttributeName1.tsx new file mode 100644 index 0000000000000..076556145f4ac --- /dev/null +++ b/tests/cases/conformance/jsx/tsxNamespacedAttributeName1.tsx @@ -0,0 +1,5 @@ +// @jsx: preserve +// @filename: a.tsx + +const a = ; +const b = ; diff --git a/tests/cases/conformance/jsx/tsxNamespacedAttributeName2.tsx b/tests/cases/conformance/jsx/tsxNamespacedAttributeName2.tsx new file mode 100644 index 0000000000000..e9b92585d119b --- /dev/null +++ b/tests/cases/conformance/jsx/tsxNamespacedAttributeName2.tsx @@ -0,0 +1,6 @@ +// @jsx: react +// @filename: a.tsx +declare var React: any; + +const a = ; +const b = ; diff --git a/tests/cases/conformance/jsx/tsxNamespacedTagName1.tsx b/tests/cases/conformance/jsx/tsxNamespacedTagName1.tsx new file mode 100644 index 0000000000000..ad03e0faab01c --- /dev/null +++ b/tests/cases/conformance/jsx/tsxNamespacedTagName1.tsx @@ -0,0 +1,7 @@ +// @jsx: preserve +// @filename: a.tsx + +const a = ; +const b = ; +const c = ; +const d = ; diff --git a/tests/cases/conformance/jsx/tsxNamespacedTagName2.tsx b/tests/cases/conformance/jsx/tsxNamespacedTagName2.tsx new file mode 100644 index 0000000000000..b5b06d748a9e3 --- /dev/null +++ b/tests/cases/conformance/jsx/tsxNamespacedTagName2.tsx @@ -0,0 +1,8 @@ +// @jsx: react +// @filename: a.tsx +declare var React: any; + +const a = ; +const b = ; +const c = ; +const d = ; From 5989a3e9143b9f94326d665c6b359fe21feb4bbc Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 6 Sep 2022 23:49:24 +0300 Subject: [PATCH 2/6] fix tests --- src/compiler/factory/nodeFactory.ts | 4 ++-- src/compiler/types.ts | 11 ++++++++--- src/compiler/utilitiesPublic.ts | 7 +++++++ src/compiler/visitorPublic.ts | 6 +++--- tests/baselines/reference/api/tsserverlibrary.d.ts | 11 ++++++----- tests/baselines/reference/api/typescript.d.ts | 11 ++++++----- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 7ca5ed15dc44b..9a6fad9688bd7 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -5006,7 +5006,7 @@ namespace ts { } // @api - function createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined) { + function createJsxAttribute(name: JsxAttributeName, initializer: JsxAttributeValue | undefined) { const node = createBaseNode(SyntaxKind.JsxAttribute); node.name = name; node.initializer = initializer; @@ -5018,7 +5018,7 @@ namespace ts { } // @api - function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined) { + function updateJsxAttribute(node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined) { return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index de7a70f5bdd51..078aa21d82179 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2874,6 +2874,11 @@ namespace ts { | JsxSpreadAttribute ; + export type JsxAttributeName = + | Identifier + | JsxNamespacedName + ; + export type JsxTagNameExpression = | Identifier | ThisExpression @@ -2937,7 +2942,7 @@ namespace ts { export interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier | JsxNamespacedName; + readonly name: JsxAttributeName; /// JSX attribute initializers are optional; is sugar for readonly initializer?: JsxAttributeValue; } @@ -8087,8 +8092,8 @@ namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index a2f464170f411..c2a8939f25ae3 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -1926,6 +1926,13 @@ namespace ts { || kind === SyntaxKind.JsxSpreadAttribute; } + /* @internal */ + export function isJsxAttributeName(node: Node): node is JsxAttributeName { + const kind = node.kind; + return kind === SyntaxKind.Identifier + || kind === SyntaxKind.JsxNamespacedName; + } + /* @internal */ export function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression { const kind = node.kind; diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts index d09accddc001f..d3e6a87ec738c 100644 --- a/src/compiler/visitorPublic.ts +++ b/src/compiler/visitorPublic.ts @@ -1216,8 +1216,8 @@ namespace ts { [SyntaxKind.JsxNamespacedName]: function forEachChildInJsxNamespacedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxNamespacedName(node, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.namespace, visitor, isIdentifier)); + nodeVisitor(node.namespace, visitor, isIdentifier), + nodeVisitor(node.name, visitor, isIdentifier)); }, [SyntaxKind.JsxFragment]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { @@ -1229,7 +1229,7 @@ namespace ts { [SyntaxKind.JsxAttribute]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute(node, - nodeVisitor(node.name, visitor, isIdentifier), + nodeVisitor(node.name, visitor, isJsxAttributeName), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression)); }, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 11509204de46a..64cf53c3a2c3a 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1369,6 +1369,7 @@ declare namespace ts { } export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; + export type JsxAttributeName = Identifier | JsxNamespacedName; export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; @@ -1413,7 +1414,7 @@ declare namespace ts { export interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier | JsxNamespacedName; + readonly name: JsxAttributeName; readonly initializer?: JsxAttributeValue; } export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; @@ -3786,8 +3787,8 @@ declare namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; @@ -11539,9 +11540,9 @@ declare namespace ts { /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment; /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ - const createJsxAttribute: (name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const createJsxAttribute: (name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: (node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const updateJsxAttribute: (node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes; /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 2c23b4d40e39d..ad89a1d3bf106 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1369,6 +1369,7 @@ declare namespace ts { } export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; + export type JsxAttributeName = Identifier | JsxNamespacedName; export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; @@ -1413,7 +1414,7 @@ declare namespace ts { export interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier | JsxNamespacedName; + readonly name: JsxAttributeName; readonly initializer?: JsxAttributeValue; } export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; @@ -3786,8 +3787,8 @@ declare namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; @@ -7672,9 +7673,9 @@ declare namespace ts { /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment; /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ - const createJsxAttribute: (name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const createJsxAttribute: (name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: (node: JsxAttribute, name: Identifier | JsxNamespacedName, initializer: JsxAttributeValue | undefined) => JsxAttribute; + const updateJsxAttribute: (node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes; /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ From d1418e2bb34edb25d9d14ad585b2616697dc74b5 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 8 Nov 2022 14:48:23 +0200 Subject: [PATCH 3/6] update baseline --- .../reference/api/tsserverlibrary.d.ts | 63 ++++--------------- tests/baselines/reference/api/typescript.d.ts | 63 ++++--------------- 2 files changed, 22 insertions(+), 104 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index ea3c0eff5683e..005e131ffbf64 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4446,28 +4446,10 @@ declare namespace ts { FirstStatement = 240, LastStatement = 256, FirstNode = 163, -<<<<<<< HEAD FirstJSDocNode = 313, LastJSDocNode = 351, FirstJSDocTagNode = 331, - LastJSDocTagNode = 351, - } - export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; - export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; - export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; - export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; - export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; - export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; - export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; - export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export enum NodeFlags { -======= - FirstJSDocNode = 312, - LastJSDocNode = 350, - FirstJSDocTagNode = 330, - LastJSDocTagNode = 350 + LastJSDocTagNode = 351 } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; @@ -4480,7 +4462,6 @@ declare namespace ts { type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind; enum NodeFlags { ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 None = 0, Let = 1, Const = 2, @@ -5413,38 +5394,24 @@ declare namespace ts { readonly children: NodeArray; readonly closingElement: JsxClosingElement; } -<<<<<<< HEAD - export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - export type JsxAttributeName = Identifier | JsxNamespacedName; - export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; - export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { + type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; + type JsxAttributeName = Identifier | JsxNamespacedName; + type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; + interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; } - export interface JsxAttributes extends PrimaryExpression, Declaration { + interface JsxAttributes extends PrimaryExpression, Declaration { readonly properties: NodeArray; readonly kind: SyntaxKind.JsxAttributes; readonly parent: JsxOpeningLikeElement; } - export interface JsxNamespacedName extends PrimaryExpression { + interface JsxNamespacedName extends PrimaryExpression { readonly kind: SyntaxKind.JsxNamespacedName; readonly name: Identifier; readonly namespace: Identifier; } - export interface JsxOpeningElement extends Expression { -======= - type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess; - interface JsxTagNamePropertyAccess extends PropertyAccessExpression { - readonly expression: JsxTagNameExpression; - } - interface JsxAttributes extends ObjectLiteralExpressionBase { - readonly kind: SyntaxKind.JsxAttributes; - readonly parent: JsxOpeningLikeElement; - } interface JsxOpeningElement extends Expression { ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 readonly kind: SyntaxKind.JsxOpeningElement; readonly parent: JsxElement; readonly tagName: JsxTagNameExpression; @@ -5471,11 +5438,7 @@ declare namespace ts { readonly kind: SyntaxKind.JsxClosingFragment; readonly parent: JsxFragment; } -<<<<<<< HEAD - export interface JsxAttribute extends Declaration { -======= - interface JsxAttribute extends ObjectLiteralElement { ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 + interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; readonly name: JsxAttributeName; @@ -8868,6 +8831,8 @@ declare namespace ts { parent: ConstructorDeclaration; name: Identifier; }; + function getEscapedTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): __String; + function getTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): string; function createUnparsedSourceFile(text: string): UnparsedSource; function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; @@ -11659,15 +11624,9 @@ declare namespace ts { /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ const updateJsxFragment: typeof factory.updateJsxFragment; /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ -<<<<<<< HEAD - const createJsxAttribute: (name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; - /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: (node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; -======= const createJsxAttribute: typeof factory.createJsxAttribute; /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ const updateJsxAttribute: typeof factory.updateJsxAttribute; ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ const createJsxAttributes: typeof factory.createJsxAttributes; /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index e5c0ce7828bcb..f310eb19fb46d 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -508,28 +508,10 @@ declare namespace ts { FirstStatement = 240, LastStatement = 256, FirstNode = 163, -<<<<<<< HEAD FirstJSDocNode = 313, LastJSDocNode = 351, FirstJSDocTagNode = 331, - LastJSDocTagNode = 351, - } - export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; - export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; - export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; - export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; - export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; - export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; - export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; - export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export enum NodeFlags { -======= - FirstJSDocNode = 312, - LastJSDocNode = 350, - FirstJSDocTagNode = 330, - LastJSDocTagNode = 350 + LastJSDocTagNode = 351 } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; @@ -542,7 +524,6 @@ declare namespace ts { type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind; enum NodeFlags { ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 None = 0, Let = 1, Const = 2, @@ -1475,38 +1456,24 @@ declare namespace ts { readonly children: NodeArray; readonly closingElement: JsxClosingElement; } -<<<<<<< HEAD - export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - export type JsxAttributeName = Identifier | JsxNamespacedName; - export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; - export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { + type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; + type JsxAttributeName = Identifier | JsxNamespacedName; + type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; + interface JsxTagNamePropertyAccess extends PropertyAccessExpression { readonly expression: JsxTagNameExpression; } - export interface JsxAttributes extends PrimaryExpression, Declaration { + interface JsxAttributes extends PrimaryExpression, Declaration { readonly properties: NodeArray; readonly kind: SyntaxKind.JsxAttributes; readonly parent: JsxOpeningLikeElement; } - export interface JsxNamespacedName extends PrimaryExpression { + interface JsxNamespacedName extends PrimaryExpression { readonly kind: SyntaxKind.JsxNamespacedName; readonly name: Identifier; readonly namespace: Identifier; } - export interface JsxOpeningElement extends Expression { -======= - type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; - type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess; - interface JsxTagNamePropertyAccess extends PropertyAccessExpression { - readonly expression: JsxTagNameExpression; - } - interface JsxAttributes extends ObjectLiteralExpressionBase { - readonly kind: SyntaxKind.JsxAttributes; - readonly parent: JsxOpeningLikeElement; - } interface JsxOpeningElement extends Expression { ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 readonly kind: SyntaxKind.JsxOpeningElement; readonly parent: JsxElement; readonly tagName: JsxTagNameExpression; @@ -1533,11 +1500,7 @@ declare namespace ts { readonly kind: SyntaxKind.JsxClosingFragment; readonly parent: JsxFragment; } -<<<<<<< HEAD - export interface JsxAttribute extends Declaration { -======= - interface JsxAttribute extends ObjectLiteralElement { ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 + interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; readonly name: JsxAttributeName; @@ -4930,6 +4893,8 @@ declare namespace ts { parent: ConstructorDeclaration; name: Identifier; }; + function getEscapedTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): __String; + function getTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): string; function createUnparsedSourceFile(text: string): UnparsedSource; function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; @@ -7794,15 +7759,9 @@ declare namespace ts { /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ const updateJsxFragment: typeof factory.updateJsxFragment; /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ -<<<<<<< HEAD - const createJsxAttribute: (name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; - /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ - const updateJsxAttribute: (node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined) => JsxAttribute; -======= const createJsxAttribute: typeof factory.createJsxAttribute; /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ const updateJsxAttribute: typeof factory.updateJsxAttribute; ->>>>>>> 437b2690ed87b277520919ddc76375de13278100 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ const createJsxAttributes: typeof factory.createJsxAttributes; /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ From b6361f3f81759370422fea7084f7d9634410d19c Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 13 Dec 2022 10:13:26 +0200 Subject: [PATCH 4/6] update baseline --- .../tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js index 12b3d134c26e8..4c1c9f4e6fd43 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -988,6 +988,7 @@ Info 32 [00:01:13.000] response: "2636", "2637", "2638", + "2639", "2649", "2651", "2652", @@ -2308,6 +2309,7 @@ Info 38 [00:01:19.000] response: "2636", "2637", "2638", + "2639", "2649", "2651", "2652", @@ -3540,6 +3542,7 @@ Info 40 [00:01:21.000] response: "2636", "2637", "2638", + "2639", "2649", "2651", "2652", From dfa62fb0e5dd5f10aa89cea3be735130fb58a015 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Wed, 8 Feb 2023 18:22:17 +0200 Subject: [PATCH 5/6] update baseline --- .../getSupportedCodeFixes-can-be-proxied.js | 2492 +---------------- 1 file changed, 44 insertions(+), 2448 deletions(-) diff --git a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js index 27b556a055a3f..1c78575b60dcf 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -1619,2455 +1619,51 @@ FsWatchesRecursive:: Info 38 [00:01:19.000] response: { "response": [ -<<<<<<< HEAD - "2352", - "1375", - "1431", - "2345", - "2322", - "2678", - "2356", - "2362", - "2363", - "2736", - "2365", - "2367", - "2801", - "2461", - "2495", - "2802", - "2549", - "2548", - "2488", - "2504", - "2339", - "2349", - "2351", - "2304", - "18004", - "2612", - "1329", - "7051", - "2412", - "2375", - "2379", - "80004", - "80002", - "80006", - "80001", - "2713", - "1205", - "1371", - "2690", - "2420", - "2720", - "2552", - "2663", - "2662", - "2503", - "2686", - "2693", - "1361", - "2719", - "2530", - "2603", - "2344", - "4113", - "4112", - "4116", - "4114", - "4115", - "4119", - "4121", - "4120", - "4122", - "4111", - "2683", - "2459", - "5086", - "5087", - "2551", - "2568", - "2570", - "2833", - "2724", - "4117", - "4123", - "2769", - "2355", - "2741", - "2739", - "2740", - "2348", - "2307", - "7016", - "2515", - "2653", - "17009", - "2377", - "1219", - "17004", - "2845", - "1378", - "1432", - "1312", - "2689", - "1451", - "1382", - "1381", - "8024", - "1272", - "6133", - "6196", - "6138", - "6192", - "6198", - "6199", - "6205", - "7027", - "7028", - "8020", - "2774", - "1308", - "1103", - "2311", - "2610", - "2611", - "7034", - "7005", - "7006", - "7019", - "7033", - "7010", - "7032", - "7008", - "7046", - "7043", - "7044", - "7047", - "7048", - "7050", - "7049", - "7045", - "1064", - "1002", - "1003", - "1005", - "1006", - "1007", - "1009", - "1010", - "1011", - "1012", - "1013", - "1014", - "1015", - "1016", - "1017", - "1018", - "1019", - "1020", - "1021", - "1022", - "1024", - "1025", - "1028", - "1029", - "1030", - "1031", - "1034", - "1035", - "1036", - "1038", - "1039", - "1040", - "1042", - "1044", - "1046", - "1047", - "1048", - "1049", - "1051", - "1052", - "1053", - "1054", - "1055", - "1056", - "1058", - "1059", - "1060", - "1061", - "1062", - "1063", - "1066", - "1068", - "1069", - "1070", - "1071", - "1079", - "1084", - "1085", - "1089", - "1090", - "1091", - "1092", - "1093", - "1094", - "1095", - "1096", - "1097", - "1098", - "1099", - "1100", - "1101", - "1102", - "1104", - "1105", - "1106", - "1107", - "1108", - "1109", - "1110", - "1113", - "1114", - "1115", - "1116", - "1117", - "1118", - "1119", - "1120", - "1121", - "1123", - "1124", - "1125", - "1126", - "1127", - "1128", - "1129", - "1130", - "1131", - "1132", - "1134", - "1135", - "1136", - "1137", - "1138", - "1139", - "1140", - "1141", - "1142", - "1144", - "1145", - "1146", - "1147", - "1148", - "1149", - "1155", - "1156", - "1157", - "1160", - "1161", - "1162", - "1163", - "1164", - "1165", - "1166", - "1168", - "1169", - "1170", - "1171", - "1172", - "1173", - "1174", - "1175", - "1176", - "1177", - "1178", - "1179", - "1180", - "1181", - "1182", - "1183", - "1184", - "1185", - "1186", - "1187", - "1188", - "1189", - "1190", - "1191", - "1192", - "1193", - "1194", - "1195", - "1196", - "1197", - "1198", - "1199", - "1200", - "1202", - "1203", - "1206", - "1207", - "1208", - "1209", - "1210", - "1211", - "1212", - "1213", - "1214", - "1215", - "1216", - "1218", - "1221", - "1222", - "1223", - "1224", - "1225", - "1226", - "1227", - "1228", - "1229", - "1230", - "1231", - "1232", - "1233", - "1234", - "1235", - "1236", - "1237", - "1238", - "1239", - "1240", - "1241", - "1242", - "1243", - "1244", - "1245", - "1246", - "1247", - "1248", - "1249", - "1250", - "1251", - "1252", - "1254", - "1255", - "1257", - "1258", - "1259", - "1260", - "1261", - "1262", - "1263", - "1264", - "1265", - "1266", - "1267", - "1268", - "1269", - "1270", - "1271", - "1273", - "1274", - "1275", - "1276", - "1300", - "1309", - "1313", - "1314", - "1315", - "1316", - "1317", - "1318", - "1319", - "1320", - "1321", - "1322", - "1323", - "1324", - "1325", - "1326", - "1327", - "1328", - "1330", - "1331", - "1332", - "1333", - "1334", - "1335", - "1337", - "1338", - "1339", - "1340", - "1341", - "1342", - "1343", - "1344", - "1345", - "1346", - "1347", - "1348", - "1349", - "1351", - "1352", - "1353", - "1354", - "1355", - "1356", - "1357", - "1358", - "1359", - "1360", - "1362", - "1363", - "1368", - "1379", - "1380", - "1383", - "1385", - "1386", - "1387", - "1388", - "1389", - "1390", - "1392", - "1433", - "1434", - "1435", - "1436", - "1437", - "1438", - "1439", - "1440", - "1441", - "1442", - "1443", - "1444", - "1446", - "1448", - "1452", - "1453", - "1454", - "1455", - "1456", - "1470", - "1471", - "1472", - "1473", - "1474", - "1477", - "1478", - "1479", - "2200", - "2201", - "2202", - "2203", - "2204", - "2205", - "2206", - "2207", - "2208", - "2209", - "2210", - "2300", - "2301", - "2302", - "2303", - "2305", - "2306", - "2308", - "2309", - "2310", - "2312", - "2313", - "2314", - "2315", - "2316", - "2317", - "2318", - "2319", - "2320", - "2321", - "2323", - "2324", - "2325", - "2326", - "2327", - "2328", - "2329", - "2330", - "2331", - "2332", - "2333", - "2334", - "2335", - "2336", - "2337", - "2338", - "2340", - "2341", - "2343", - "2346", - "2347", - "2350", - "2353", - "2354", - "2357", - "2358", - "2359", - "2364", - "2366", - "2368", - "2369", - "2370", - "2371", - "2372", - "2373", - "2374", - "2376", - "2378", - "2380", - "2383", - "2384", - "2385", - "2386", - "2387", - "2388", - "2389", - "2390", - "2391", - "2392", - "2393", - "2394", - "2395", - "2396", - "2397", - "2398", - "2399", - "2400", - "2401", - "2402", - "2403", - "2404", - "2405", - "2406", - "2407", - "2408", - "2409", - "2410", - "2411", - "2413", - "2414", - "2415", - "2416", - "2417", - "2418", - "2419", - "2422", - "2423", - "2425", - "2426", - "2427", - "2428", - "2430", - "2431", - "2432", - "2433", - "2434", - "2435", - "2436", - "2437", - "2438", - "2439", - "2440", - "2441", - "2442", - "2443", - "2444", - "2445", - "2446", - "2447", - "2448", - "2449", - "2450", - "2451", - "2452", - "2454", - "2456", - "2457", - "2458", - "2460", - "2462", - "2463", - "2464", - "2465", - "2466", - "2467", - "2468", - "2469", - "2472", - "2473", - "2474", - "2475", - "2476", - "2477", - "2478", - "2480", - "2481", - "2483", - "2484", - "2487", - "2489", - "2490", - "2491", - "2492", - "2493", - "2494", - "2496", - "2497", - "2498", - "2499", - "2500", - "2501", - "2502", - "2505", - "2506", - "2507", - "2508", - "2509", - "2510", - "2511", - "2512", - "2513", - "2514", - "2516", - "2517", - "2518", - "2519", - "2520", - "2522", - "2523", - "2524", - "2525", - "2526", - "2527", - "2528", - "2529", - "2531", - "2532", - "2533", - "2534", - "2536", - "2537", - "2538", - "2539", - "2540", - "2542", - "2543", - "2544", - "2545", - "2547", - "2550", - "2553", - "2554", - "2555", - "2556", - "2558", - "2559", - "2560", - "2561", - "2562", - "2563", - "2564", - "2565", - "2566", - "2567", - "2571", - "2574", - "2575", - "2576", - "2577", - "2578", - "2580", - "2581", - "2582", - "2583", - "2584", - "2585", - "2588", - "2589", - "2590", - "2591", - "2592", - "2593", - "2594", - "2595", - "2596", - "2597", - "2598", - "2602", - "2604", - "2606", - "2607", - "2608", - "2609", - "2613", - "2614", - "2615", - "2616", - "2617", - "2618", - "2619", - "2620", - "2621", - "2623", - "2624", - "2625", - "2626", - "2627", - "2628", - "2629", - "2630", - "2631", - "2632", - "2633", - "2634", - "2635", - "2636", - "2637", - "2638", - "2639", - "2649", - "2651", - "2652", - "2657", - "2658", - "2659", - "2660", - "2661", - "2664", - "2665", - "2666", - "2667", - "2668", - "2669", - "2670", - "2671", - "2672", - "2673", - "2674", - "2675", - "2676", - "2677", - "2679", - "2680", - "2681", - "2684", - "2685", - "2687", - "2688", - "2691", - "2692", - "2694", - "2695", - "2696", - "2697", - "2698", - "2699", - "2700", - "2701", - "2702", - "2703", - "2704", - "2705", - "2706", - "2707", - "2708", - "2709", - "2710", - "2711", - "2712", - "2714", - "2715", - "2716", - "2717", - "2718", - "2721", - "2722", - "2723", - "2725", - "2726", - "2727", - "2729", - "2730", - "2731", - "2732", - "2733", - "2734", - "2735", - "2737", - "2742", - "2743", - "2744", - "2745", - "2746", - "2747", - "2748", - "2749", - "2750", - "2751", - "2752", - "2753", - "2754", - "2755", - "2756", - "2757", - "2758", - "2759", - "2760", - "2761", - "2762", - "2763", - "2764", - "2765", - "2766", - "2767", - "2768", - "2770", - "2771", - "2772", - "2773", - "2775", - "2776", - "2777", - "2778", - "2779", - "2780", - "2781", - "2783", - "2784", - "2785", - "2786", - "2787", - "2788", - "2789", - "2790", - "2791", - "2792", - "2793", - "2794", - "2795", - "2796", - "2797", - "2798", - "2799", - "2800", - "2803", - "2804", - "2806", - "2807", - "2808", - "2809", - "2810", - "2811", - "2812", - "2813", - "2814", - "2815", - "2816", - "2817", - "2818", - "2819", - "2820", - "2821", - "2822", - "2834", - "2835", - "2836", - "2837", - "2838", - "2839", - "2840", - "2841", - "2842", - "2843", - "2844", - "2846", - "4000", - "4002", - "4004", - "4006", - "4008", - "4010", - "4012", - "4014", - "4016", - "4019", - "4020", - "4021", - "4022", - "4023", - "4024", - "4025", - "4026", - "4027", - "4028", - "4029", - "4030", - "4031", - "4032", - "4033", - "4034", - "4035", - "4036", - "4037", - "4038", - "4039", - "4040", - "4041", - "4042", - "4043", - "4044", - "4045", - "4046", - "4047", - "4048", - "4049", - "4050", - "4051", - "4052", - "4053", - "4054", - "4055", - "4056", - "4057", - "4058", - "4059", - "4060", - "4061", - "4062", - "4063", - "4064", - "4065", - "4066", - "4067", - "4068", - "4069", - "4070", - "4071", - "4072", - "4073", - "4074", - "4075", - "4076", - "4077", - "4078", - "4081", - "4082", - "4083", - "4084", - "4090", - "4091", - "4092", - "4094", - "4095", - "4096", - "4097", - "4098", - "4099", - "4100", - "4101", - "4102", - "4103", - "4104", - "4105", - "4106", - "4107", - "4108", - "4109", - "4110", - "4118", - "4124", - "4125", - "5001", - "5009", - "5010", - "5012", - "5014", - "5023", - "5024", - "5025", - "5033", - "5042", - "5047", - "5048", - "5051", - "5052", - "5053", - "5054", - "5055", - "5056", - "5057", - "5058", - "5059", - "5061", - "5062", - "5063", - "5064", - "5065", - "5066", - "5067", - "5068", - "5069", - "5070", - "5071", - "5072", - "5073", - "5074", - "5075", - "5076", - "5077", - "5078", - "5079", - "5080", - "5081", - "5082", - "5083", - "5084", - "5085", - "5088", - "5089", - "5090", - "5091", - "5092", - "5093", - "5094", - "5095", - "5096", - "5097", - "5098", - "5099", - "5100", - "5101", - "5102", - "5103", - "6044", - "6045", - "6046", - "6048", - "6050", - "6051", - "6053", - "6054", - "6059", - "6064", - "6082", - "6114", - "6131", - "6137", - "6140", - "6142", - "6188", - "6189", - "6200", - "6202", - "6229", - "6230", - "6231", - "6232", - "6233", - "6234", - "6236", - "6238", - "6258", - "6304", - "6305", - "6306", - "6307", - "6308", - "6309", - "6310", - "6369", - "6370", - "6377", - "6379", - "6504", - "6931", - "7009", - "7011", - "7013", - "7014", - "7015", - "7017", - "7018", - "7020", - "7022", - "7023", - "7024", - "7025", - "7026", - "7029", - "7030", - "7031", - "7035", - "7036", - "7039", - "7040", - "7041", - "7042", - "7052", - "7053", - "7054", - "7055", - "7056", - "7057", - "7058", - "7059", - "7060", - "7061", - "8000", - "8001", - "8002", - "8003", - "8004", - "8005", - "8006", - "8008", - "8009", - "8010", - "8011", - "8012", - "8013", - "8016", - "8017", - "8018", - "8021", - "8022", - "8023", - "8025", - "8026", - "8027", - "8028", - "8029", - "8030", - "8031", - "8032", - "8033", - "8034", - "8035", - "8036", - "8037", - "9005", - "9006", - "17000", - "17001", - "17002", - "17005", - "17006", - "17007", - "17008", - "17010", - "17011", - "17012", - "17013", - "17014", - "17015", - "17016", - "17017", - "17018", - "18000", - "18002", - "18003", - "18006", - "18007", - "18009", - "18010", - "18011", - "18012", - "18013", - "18014", - "18015", - "18016", - "18017", - "18018", - "18019", - "18024", - "18026", - "18027", - "18028", - "18029", - "18030", - "18031", - "18032", - "18033", - "18035", - "18036", - "18037", - "18038", - "18039", - "18041", - "18042", - "18043", - "18045", - "18046", - "18047", - "18048", - "18049", - "18050", - "80005", - "80003", - "80008", - "80007" -======= - "2352" ->>>>>>> 963f9130149de997c331b2280480777dbef40b6e - ], - "responseRequired": true - } -Info 39 [00:01:20.000] request: - { - "command": "getSupportedCodeFixes", - "arguments": { - "projectFileName": "/tsconfig.json" - }, - "seq": 8, - "type": "request" - } -Before request - -PolledWatches:: - -FsWatches:: -/tsconfig.json: - {} -/a/lib/lib.d.ts: - {} - -FsWatchesRecursive:: -/: - {} - -After request - -PolledWatches:: - -FsWatches:: -/tsconfig.json: - {} -/a/lib/lib.d.ts: - {} - -FsWatchesRecursive:: -/: - {} - -Info 40 [00:01:21.000] response: - { - "response": [ -<<<<<<< HEAD - "2352", - "1375", - "1431", - "2345", - "2322", - "2678", - "2356", - "2362", - "2363", - "2736", - "2365", - "2367", - "2801", - "2461", - "2495", - "2802", - "2549", - "2548", - "2488", - "2504", - "2339", - "2349", - "2351", - "2304", - "18004", - "2612", - "1329", - "7051", - "2412", - "2375", - "2379", - "80004", - "80002", - "80006", - "80001", - "2713", - "1205", - "1371", - "2690", - "2420", - "2720", - "2552", - "2663", - "2662", - "2503", - "2686", - "2693", - "1361", - "2719", - "2530", - "2603", - "2344", - "4113", - "4112", - "4116", - "4114", - "4115", - "4119", - "4121", - "4120", - "4122", - "4111", - "2683", - "2459", - "5086", - "5087", - "2551", - "2568", - "2570", - "2833", - "2724", - "4117", - "4123", - "2769", - "2355", - "2741", - "2739", - "2740", - "2348", - "2307", - "7016", - "2515", - "2653", - "17009", - "2377", - "1219", - "17004", - "2845", - "1378", - "1432", - "1312", - "2689", - "1451", - "1382", - "1381", - "8024", - "1272", - "6133", - "6196", - "6138", - "6192", - "6198", - "6199", - "6205", - "7027", - "7028", - "8020", - "2774", - "1308", - "1103", - "2311", - "2610", - "2611", - "7034", - "7005", - "7006", - "7019", - "7033", - "7010", - "7032", - "7008", - "7046", - "7043", - "7044", - "7047", - "7048", - "7050", - "7049", - "7045", - "1064", - "1002", - "1003", - "1005", - "1006", - "1007", - "1009", - "1010", - "1011", - "1012", - "1013", - "1014", - "1015", - "1016", - "1017", - "1018", - "1019", - "1020", - "1021", - "1022", - "1024", - "1025", - "1028", - "1029", - "1030", - "1031", - "1034", - "1035", - "1036", - "1038", - "1039", - "1040", - "1042", - "1044", - "1046", - "1047", - "1048", - "1049", - "1051", - "1052", - "1053", - "1054", - "1055", - "1056", - "1058", - "1059", - "1060", - "1061", - "1062", - "1063", - "1066", - "1068", - "1069", - "1070", - "1071", - "1079", - "1084", - "1085", - "1089", - "1090", - "1091", - "1092", - "1093", - "1094", - "1095", - "1096", - "1097", - "1098", - "1099", - "1100", - "1101", - "1102", - "1104", - "1105", - "1106", - "1107", - "1108", - "1109", - "1110", - "1113", - "1114", - "1115", - "1116", - "1117", - "1118", - "1119", - "1120", - "1121", - "1123", - "1124", - "1125", - "1126", - "1127", - "1128", - "1129", - "1130", - "1131", - "1132", - "1134", - "1135", - "1136", - "1137", - "1138", - "1139", - "1140", - "1141", - "1142", - "1144", - "1145", - "1146", - "1147", - "1148", - "1149", - "1155", - "1156", - "1157", - "1160", - "1161", - "1162", - "1163", - "1164", - "1165", - "1166", - "1168", - "1169", - "1170", - "1171", - "1172", - "1173", - "1174", - "1175", - "1176", - "1177", - "1178", - "1179", - "1180", - "1181", - "1182", - "1183", - "1184", - "1185", - "1186", - "1187", - "1188", - "1189", - "1190", - "1191", - "1192", - "1193", - "1194", - "1195", - "1196", - "1197", - "1198", - "1199", - "1200", - "1202", - "1203", - "1206", - "1207", - "1208", - "1209", - "1210", - "1211", - "1212", - "1213", - "1214", - "1215", - "1216", - "1218", - "1221", - "1222", - "1223", - "1224", - "1225", - "1226", - "1227", - "1228", - "1229", - "1230", - "1231", - "1232", - "1233", - "1234", - "1235", - "1236", - "1237", - "1238", - "1239", - "1240", - "1241", - "1242", - "1243", - "1244", - "1245", - "1246", - "1247", - "1248", - "1249", - "1250", - "1251", - "1252", - "1254", - "1255", - "1257", - "1258", - "1259", - "1260", - "1261", - "1262", - "1263", - "1264", - "1265", - "1266", - "1267", - "1268", - "1269", - "1270", - "1271", - "1273", - "1274", - "1275", - "1276", - "1300", - "1309", - "1313", - "1314", - "1315", - "1316", - "1317", - "1318", - "1319", - "1320", - "1321", - "1322", - "1323", - "1324", - "1325", - "1326", - "1327", - "1328", - "1330", - "1331", - "1332", - "1333", - "1334", - "1335", - "1337", - "1338", - "1339", - "1340", - "1341", - "1342", - "1343", - "1344", - "1345", - "1346", - "1347", - "1348", - "1349", - "1351", - "1352", - "1353", - "1354", - "1355", - "1356", - "1357", - "1358", - "1359", - "1360", - "1362", - "1363", - "1368", - "1379", - "1380", - "1383", - "1385", - "1386", - "1387", - "1388", - "1389", - "1390", - "1392", - "1433", - "1434", - "1435", - "1436", - "1437", - "1438", - "1439", - "1440", - "1441", - "1442", - "1443", - "1444", - "1446", - "1448", - "1452", - "1453", - "1454", - "1455", - "1456", - "1470", - "1471", - "1472", - "1473", - "1474", - "1477", - "1478", - "1479", - "2200", - "2201", - "2202", - "2203", - "2204", - "2205", - "2206", - "2207", - "2208", - "2209", - "2210", - "2300", - "2301", - "2302", - "2303", - "2305", - "2306", - "2308", - "2309", - "2310", - "2312", - "2313", - "2314", - "2315", - "2316", - "2317", - "2318", - "2319", - "2320", - "2321", - "2323", - "2324", - "2325", - "2326", - "2327", - "2328", - "2329", - "2330", - "2331", - "2332", - "2333", - "2334", - "2335", - "2336", - "2337", - "2338", - "2340", - "2341", - "2343", - "2346", - "2347", - "2350", - "2353", - "2354", - "2357", - "2358", - "2359", - "2364", - "2366", - "2368", - "2369", - "2370", - "2371", - "2372", - "2373", - "2374", - "2376", - "2378", - "2380", - "2383", - "2384", - "2385", - "2386", - "2387", - "2388", - "2389", - "2390", - "2391", - "2392", - "2393", - "2394", - "2395", - "2396", - "2397", - "2398", - "2399", - "2400", - "2401", - "2402", - "2403", - "2404", - "2405", - "2406", - "2407", - "2408", - "2409", - "2410", - "2411", - "2413", - "2414", - "2415", - "2416", - "2417", - "2418", - "2419", - "2422", - "2423", - "2425", - "2426", - "2427", - "2428", - "2430", - "2431", - "2432", - "2433", - "2434", - "2435", - "2436", - "2437", - "2438", - "2439", - "2440", - "2441", - "2442", - "2443", - "2444", - "2445", - "2446", - "2447", - "2448", - "2449", - "2450", - "2451", - "2452", - "2454", - "2456", - "2457", - "2458", - "2460", - "2462", - "2463", - "2464", - "2465", - "2466", - "2467", - "2468", - "2469", - "2472", - "2473", - "2474", - "2475", - "2476", - "2477", - "2478", - "2480", - "2481", - "2483", - "2484", - "2487", - "2489", - "2490", - "2491", - "2492", - "2493", - "2494", - "2496", - "2497", - "2498", - "2499", - "2500", - "2501", - "2502", - "2505", - "2506", - "2507", - "2508", - "2509", - "2510", - "2511", - "2512", - "2513", - "2514", - "2516", - "2517", - "2518", - "2519", - "2520", - "2522", - "2523", - "2524", - "2525", - "2526", - "2527", - "2528", - "2529", - "2531", - "2532", - "2533", - "2534", - "2536", - "2537", - "2538", - "2539", - "2540", - "2542", - "2543", - "2544", - "2545", - "2547", - "2550", - "2553", - "2554", - "2555", - "2556", - "2558", - "2559", - "2560", - "2561", - "2562", - "2563", - "2564", - "2565", - "2566", - "2567", - "2571", - "2574", - "2575", - "2576", - "2577", - "2578", - "2580", - "2581", - "2582", - "2583", - "2584", - "2585", - "2588", - "2589", - "2590", - "2591", - "2592", - "2593", - "2594", - "2595", - "2596", - "2597", - "2598", - "2602", - "2604", - "2606", - "2607", - "2608", - "2609", - "2613", - "2614", - "2615", - "2616", - "2617", - "2618", - "2619", - "2620", - "2621", - "2623", - "2624", - "2625", - "2626", - "2627", - "2628", - "2629", - "2630", - "2631", - "2632", - "2633", - "2634", - "2635", - "2636", - "2637", - "2638", - "2639", - "2649", - "2651", - "2652", - "2657", - "2658", - "2659", - "2660", - "2661", - "2664", - "2665", - "2666", - "2667", - "2668", - "2669", - "2670", - "2671", - "2672", - "2673", - "2674", - "2675", - "2676", - "2677", - "2679", - "2680", - "2681", - "2684", - "2685", - "2687", - "2688", - "2691", - "2692", - "2694", - "2695", - "2696", - "2697", - "2698", - "2699", - "2700", - "2701", - "2702", - "2703", - "2704", - "2705", - "2706", - "2707", - "2708", - "2709", - "2710", - "2711", - "2712", - "2714", - "2715", - "2716", - "2717", - "2718", - "2721", - "2722", - "2723", - "2725", - "2726", - "2727", - "2729", - "2730", - "2731", - "2732", - "2733", - "2734", - "2735", - "2737", - "2742", - "2743", - "2744", - "2745", - "2746", - "2747", - "2748", - "2749", - "2750", - "2751", - "2752", - "2753", - "2754", - "2755", - "2756", - "2757", - "2758", - "2759", - "2760", - "2761", - "2762", - "2763", - "2764", - "2765", - "2766", - "2767", - "2768", - "2770", - "2771", - "2772", - "2773", - "2775", - "2776", - "2777", - "2778", - "2779", - "2780", - "2781", - "2783", - "2784", - "2785", - "2786", - "2787", - "2788", - "2789", - "2790", - "2791", - "2792", - "2793", - "2794", - "2795", - "2796", - "2797", - "2798", - "2799", - "2800", - "2803", - "2804", - "2806", - "2807", - "2808", - "2809", - "2810", - "2811", - "2812", - "2813", - "2814", - "2815", - "2816", - "2817", - "2818", - "2819", - "2820", - "2821", - "2822", - "2834", - "2835", - "2836", - "2837", - "2838", - "2839", - "2840", - "2841", - "2842", - "2843", - "2844", - "2846", - "4000", - "4002", - "4004", - "4006", - "4008", - "4010", - "4012", - "4014", - "4016", - "4019", - "4020", - "4021", - "4022", - "4023", - "4024", - "4025", - "4026", - "4027", - "4028", - "4029", - "4030", - "4031", - "4032", - "4033", - "4034", - "4035", - "4036", - "4037", - "4038", - "4039", - "4040", - "4041", - "4042", - "4043", - "4044", - "4045", - "4046", - "4047", - "4048", - "4049", - "4050", - "4051", - "4052", - "4053", - "4054", - "4055", - "4056", - "4057", - "4058", - "4059", - "4060", - "4061", - "4062", - "4063", - "4064", - "4065", - "4066", - "4067", - "4068", - "4069", - "4070", - "4071", - "4072", - "4073", - "4074", - "4075", - "4076", - "4077", - "4078", - "4081", - "4082", - "4083", - "4084", - "4090", - "4091", - "4092", - "4094", - "4095", - "4096", - "4097", - "4098", - "4099", - "4100", - "4101", - "4102", - "4103", - "4104", - "4105", - "4106", - "4107", - "4108", - "4109", - "4110", - "4118", - "4124", - "4125", - "5001", - "5009", - "5010", - "5012", - "5014", - "5023", - "5024", - "5025", - "5033", - "5042", - "5047", - "5048", - "5051", - "5052", - "5053", - "5054", - "5055", - "5056", - "5057", - "5058", - "5059", - "5061", - "5062", - "5063", - "5064", - "5065", - "5066", - "5067", - "5068", - "5069", - "5070", - "5071", - "5072", - "5073", - "5074", - "5075", - "5076", - "5077", - "5078", - "5079", - "5080", - "5081", - "5082", - "5083", - "5084", - "5085", - "5088", - "5089", - "5090", - "5091", - "5092", - "5093", - "5094", - "5095", - "5096", - "5097", - "5098", - "5099", - "5100", - "5101", - "5102", - "5103", - "6044", - "6045", - "6046", - "6048", - "6050", - "6051", - "6053", - "6054", - "6059", - "6064", - "6082", - "6114", - "6131", - "6137", - "6140", - "6142", - "6188", - "6189", - "6200", - "6202", - "6229", - "6230", - "6231", - "6232", - "6233", - "6234", - "6236", - "6238", - "6258", - "6304", - "6305", - "6306", - "6307", - "6308", - "6309", - "6310", - "6369", - "6370", - "6377", - "6379", - "6504", - "6931", - "7009", - "7011", - "7013", - "7014", - "7015", - "7017", - "7018", - "7020", - "7022", - "7023", - "7024", - "7025", - "7026", - "7029", - "7030", - "7031", - "7035", - "7036", - "7039", - "7040", - "7041", - "7042", - "7052", - "7053", - "7054", - "7055", - "7056", - "7057", - "7058", - "7059", - "7060", - "7061", - "8000", - "8001", - "8002", - "8003", - "8004", - "8005", - "8006", - "8008", - "8009", - "8010", - "8011", - "8012", - "8013", - "8016", - "8017", - "8018", - "8021", - "8022", - "8023", - "8025", - "8026", - "8027", - "8028", - "8029", - "8030", - "8031", - "8032", - "8033", - "8034", - "8035", - "8036", - "8037", - "9005", - "9006", - "17000", - "17001", - "17002", - "17005", - "17006", - "17007", - "17008", - "17010", - "17011", - "17012", - "17013", - "17014", - "17015", - "17016", - "17017", - "17018", - "18000", - "18002", - "18003", - "18006", - "18007", - "18009", - "18010", - "18011", - "18012", - "18013", - "18014", - "18015", - "18016", - "18017", - "18018", - "18019", - "18024", - "18026", - "18027", - "18028", - "18029", - "18030", - "18031", - "18032", - "18033", - "18035", - "18036", - "18037", - "18038", - "18039", - "18041", - "18042", - "18043", - "18045", - "18046", - "18047", - "18048", - "18049", - "18050", - "80005", - "80003", - "80008", - "80007" -======= "2352" ->>>>>>> 963f9130149de997c331b2280480777dbef40b6e + ], + "responseRequired": true + } +Info 39 [00:01:20.000] request: + { + "command": "getSupportedCodeFixes", + "arguments": { + "projectFileName": "/tsconfig.json" + }, + "seq": 8, + "type": "request" + } +Before request + +PolledWatches:: + +FsWatches:: +/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/: + {} + +After request + +PolledWatches:: + +FsWatches:: +/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/: + {} + +Info 40 [00:01:21.000] response: + { + "response": [ + "2352" ], "responseRequired": true } \ No newline at end of file From 23379ddd4e420606bf7fd54b22957e7907afc0e5 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 17 Mar 2023 18:17:45 +0200 Subject: [PATCH 6/6] escape jsx attribute name --- src/compiler/utilities.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4c91de1159f5c..3d55b21cc605e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -359,7 +359,6 @@ import { JsxElement, JsxEmit, JsxFragment, - JsxNamespacedName, JsxOpeningElement, JsxOpeningLikeElement, JsxSelfClosingElement, @@ -10134,13 +10133,13 @@ export function tryGetJSDocSatisfiesTypeNode(node: Node) { } /** @internal */ -export function getEscapedTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): __String { - return isIdentifier(node) ? node.escapedText : (getEscapedTextOfJsxAttributeName(node.namespace) + ":" + getEscapedTextOfJsxAttributeName(node.name)) as __String; +export function getEscapedTextOfJsxAttributeName(node: JsxAttributeName): __String { + return isIdentifier(node) ? node.escapedText : `${node.namespace.escapedText}:${idText(node.name)}` as __String; } /** @internal */ -export function getTextOfJsxAttributeName(node: Identifier | JsxNamespacedName): string { - return isIdentifier(node) ? idText(node) : getTextOfJsxAttributeName(node.namespace) + ":" + getTextOfJsxAttributeName(node.name); +export function getTextOfJsxAttributeName(node: JsxAttributeName): string { + return isIdentifier(node) ? idText(node) : `${idText(node.namespace)}:${idText(node.name)}`; } /** @internal */