File tree Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import {
4242 isBindingPattern ,
4343 isCallExpression ,
4444 isCallSignatureDeclaration ,
45+ isComputedPropertyName ,
4546 isConditionalTypeNode ,
4647 isConstructorTypeNode ,
4748 isConstructSignatureDeclaration ,
@@ -886,6 +887,12 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
886887 Debug . assertNode ( node , isThisTypeNode ) ;
887888 parts . push ( { text : "this" } ) ;
888889 break ;
890+ case SyntaxKind . ComputedPropertyName :
891+ Debug . assertNode ( node , isComputedPropertyName ) ;
892+ parts . push ( { text : "[" } ) ;
893+ visitForDisplayParts ( node . expression ) ;
894+ parts . push ( { text : "]" } ) ;
895+ break ;
889896 default :
890897 Debug . failBadSyntaxKind ( node ) ;
891898 }
Original file line number Diff line number Diff line change 1+ // === Inlay Hints ===
2+ test((state) => {});
3+ ^
4+ {
5+ "text": "",
6+ "displayParts": [
7+ {
8+ "text": ": "
9+ },
10+ {
11+ "text": "{"
12+ },
13+ {
14+ "text": " "
15+ },
16+ {
17+ "text": "["
18+ },
19+ {
20+ "text": "STATE_SIGNAL",
21+ "span": {
22+ "start": 14,
23+ "length": 12
24+ },
25+ "file": "/tests/cases/fourslash/inlayHintsFunctionParameterTypes5.ts"
26+ },
27+ {
28+ "text": "]"
29+ },
30+ {
31+ "text": ": "
32+ },
33+ {
34+ "text": "unknown"
35+ },
36+ {
37+ "text": " "
38+ },
39+ {
40+ "text": "}"
41+ }
42+ ],
43+ "position": 143,
44+ "kind": "Type",
45+ "whitespaceBefore": true
46+ }
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // https://github.com/microsoft/TypeScript/issues/61845
4+
5+ //// declare const STATE_SIGNAL: unique symbol;
6+ ////
7+ //// declare function test(
8+ //// cb: (state: { [STATE_SIGNAL]: unknown }) => void,
9+ //// ): unknown;
10+ ////
11+ //// test((state) => {});
12+
13+ verify . baselineInlayHints ( undefined , {
14+ includeInlayFunctionParameterTypeHints : true ,
15+ interactiveInlayHints : true ,
16+ } ) ;
You can’t perform that action at this time.
0 commit comments