diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903c8cfda1c20..3d7be4723a46e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2673,7 +2673,7 @@ namespace ts { } Debug.assert(bindingElement.kind === SyntaxKind.BindingElement); if (bindingElement.propertyName) { - writer.writeSymbol(getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, SyntaxKind.ColonToken); writeSpace(writer); } diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 38e0db0ba6b74..cd98622e080a1 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -194,6 +194,7 @@ namespace ts { writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0ad84d11c35f4..c1592d30eaeac 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2407,6 +2407,7 @@ namespace ts { writeSpace(text: string): void; writeStringLiteral(text: string): void; writeParameter(text: string): void; + writeProperty(text: string): void; writeSymbol(text: string, symbol: Symbol): void; writeLine(): void; increaseIndent(): void; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4fa0c60dce7c5..ddfa85bc31170 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -43,6 +43,7 @@ namespace ts { writeSpace: writeText, writeStringLiteral: writeText, writeParameter: writeText, + writeProperty: writeText, writeSymbol: writeText, // Completely ignore indentation for string writers. And map newlines to diff --git a/src/services/utilities.ts b/src/services/utilities.ts index e19fdc0a84a49..2f52d747e239d 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1137,6 +1137,7 @@ namespace ts { writeSpace: text => writeKind(text, SymbolDisplayPartKind.space), writeStringLiteral: text => writeKind(text, SymbolDisplayPartKind.stringLiteral), writeParameter: text => writeKind(text, SymbolDisplayPartKind.parameterName), + writeProperty: text => writeKind(text, SymbolDisplayPartKind.propertyName), writeSymbol, writeLine, increaseIndent: () => { indent++; }, diff --git a/tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts b/tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts new file mode 100644 index 0000000000000..39453ba8cdcf0 --- /dev/null +++ b/tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts @@ -0,0 +1,15 @@ +/// + +// @filename: a.tsx +////import * as React from 'react'; +////interface SomeInterface { +//// someBoolean: boolean, +//// someString: string; +////} +////interface SomeProps { +//// someProp: SomeInterface; +////} +////export const /*1*/SomeStatelessComponent = ({someProp: { someBoolean, someString}}: SomeProps) => (
{`${someBoolean}${someString}`}); + +goTo.marker("1"); +verify.quickInfoExists();