@@ -1399,6 +1399,7 @@ function stringToTristate(s: string): string {
13991399}
14001400
14011401function parseUserPreferences ( arg : ts . ObjectLiteralExpression ) : string | undefined {
1402+ const inlayHintPreferences : string [ ] = [ ] ;
14021403 const preferences : string [ ] = [ ] ;
14031404 for ( const prop of arg . properties ) {
14041405 if ( ts . isPropertyAssignment ( prop ) ) {
@@ -1441,28 +1442,28 @@ function parseUserPreferences(arg: ts.ObjectLiteralExpression): string | undefin
14411442 paramHint = "lsutil.IncludeInlayParameterNameHintsAll" ;
14421443 break ;
14431444 }
1444- preferences . push ( `IncludeInlayParameterNameHints: ${ paramHint } ` ) ;
1445+ inlayHintPreferences . push ( `IncludeInlayParameterNameHints: ${ paramHint } ` ) ;
14451446 break ;
14461447 case "includeInlayParameterNameHintsWhenArgumentMatchesName" :
1447- preferences . push ( `IncludeInlayParameterNameHintsWhenArgumentMatchesName: ${ prop . initializer . getText ( ) } ` ) ;
1448+ inlayHintPreferences . push ( `IncludeInlayParameterNameHintsWhenArgumentMatchesName: ${ prop . initializer . getText ( ) } ` ) ;
14481449 break ;
14491450 case "includeInlayFunctionParameterTypeHints" :
1450- preferences . push ( `IncludeInlayFunctionParameterTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
1451+ inlayHintPreferences . push ( `IncludeInlayFunctionParameterTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
14511452 break ;
14521453 case "includeInlayVariableTypeHints" :
1453- preferences . push ( `IncludeInlayVariableTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
1454+ inlayHintPreferences . push ( `IncludeInlayVariableTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
14541455 break ;
14551456 case "includeInlayVariableTypeHintsWhenTypeMatchesName" :
1456- preferences . push ( `IncludeInlayVariableTypeHintsWhenTypeMatchesName: ${ prop . initializer . getText ( ) } ` ) ;
1457+ inlayHintPreferences . push ( `IncludeInlayVariableTypeHintsWhenTypeMatchesName: ${ prop . initializer . getText ( ) } ` ) ;
14571458 break ;
14581459 case "includeInlayPropertyDeclarationTypeHints" :
1459- preferences . push ( `IncludeInlayPropertyDeclarationTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
1460+ inlayHintPreferences . push ( `IncludeInlayPropertyDeclarationTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
14601461 break ;
14611462 case "includeInlayFunctionLikeReturnTypeHints" :
1462- preferences . push ( `IncludeInlayFunctionLikeReturnTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
1463+ inlayHintPreferences . push ( `IncludeInlayFunctionLikeReturnTypeHints: ${ prop . initializer . getText ( ) } ` ) ;
14631464 break ;
14641465 case "includeInlayEnumMemberValueHints" :
1465- preferences . push ( `IncludeInlayEnumMemberValueHints: ${ prop . initializer . getText ( ) } ` ) ;
1466+ inlayHintPreferences . push ( `IncludeInlayEnumMemberValueHints: ${ prop . initializer . getText ( ) } ` ) ;
14661467 break ;
14671468 case "interactiveInlayHints" :
14681469 // Ignore, deprecated
@@ -1473,6 +1474,10 @@ function parseUserPreferences(arg: ts.ObjectLiteralExpression): string | undefin
14731474 return undefined ;
14741475 }
14751476 }
1477+
1478+ if ( inlayHintPreferences . length > 0 ) {
1479+ preferences . push ( `InlayHints: lsutil.InlayHintsPreferences{${ inlayHintPreferences . join ( "," ) } }` ) ;
1480+ }
14761481 if ( preferences . length === 0 ) {
14771482 return "nil /*preferences*/" ;
14781483 }
@@ -2936,7 +2941,8 @@ func Test${testName}(t *testing.T) {
29362941 ${ failingTests . has ( testName ) ? "t.Skip()" : "" }
29372942 defer testutil.RecoverAndFail(t, "Panic on fourslash test")
29382943 const content = ${ content }
2939- f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
2944+ f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
2945+ defer done()
29402946 ${ isServer ? `f.MarkTestAsStradaServer()\n` : "" } ${ commands }
29412947}` ;
29422948 return template ;
0 commit comments