diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 0d687d599aa..8e86ef2ca25 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -981,6 +981,7 @@ namespace ts { return node === (parent).expression; case SyntaxKind.Decorator: case SyntaxKind.JsxExpression: + case SyntaxKind.JsxSpreadAttribute: return true; case SyntaxKind.ExpressionWithTypeArguments: return (parent).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); diff --git a/tests/cases/fourslash/jsxSpreadReference.ts b/tests/cases/fourslash/jsxSpreadReference.ts new file mode 100644 index 00000000000..1b57e880ccf --- /dev/null +++ b/tests/cases/fourslash/jsxSpreadReference.ts @@ -0,0 +1,26 @@ +/// + +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// } +//// interface ElementAttributesProperty { props } +//// } +//// class MyClass { +//// props: { +//// name?: string; +//// size?: number; +//// } +//// } +//// +//// var [|/*dst*/nn|]: {name?: string; size?: number}; +//// var x = ; + +goTo.marker('src'); +debugger; +goTo.definition(); +verify.caretAtMarker('dst'); + +goTo.marker('src'); +verify.renameLocations(false, false);