@@ -527,6 +527,7 @@ public async Task<string> DoAsync()
527527 expectedLocation ) . ConfigureAwait ( false ) ;
528528 Assert . Equal ( expectedMarkdown , results . Contents . Fourth . Value ) ;
529529 }
530+
530531 [ Theory , CombinatorialData ]
531532 public async Task TestGetHoverAsync_UsesNonBreakingSpaceForSupportedPlatforms ( bool mutatingLspWorkspace )
532533 {
@@ -586,6 +587,47 @@ static void Main(string[] args)
586587 Assert . Equal ( expectedMarkdown , result . Contents . Fourth . Value ) ;
587588 }
588589
590+ [ Theory , CombinatorialData , WorkItem ( "https://github.com/dotnet/vscode-csharp/issues/6577" ) ]
591+ public async Task TestGetHoverAsync_EscapesAngleBracketsInGenerics ( bool mutatingLspWorkspace )
592+ {
593+ var markup =
594+ """
595+ using System.Collections.Generic;
596+ using System.Collections.Immutable;
597+ using System.Threading.Tasks;
598+ class C
599+ {
600+ private async Task<IDictionary<string, ImmutableArray<int>>> GetData()
601+ {
602+ {|caret:var|} d = await GetData();
603+ return null;
604+ }
605+ }
606+ """ ;
607+ var clientCapabilities = new LSP . ClientCapabilities
608+ {
609+ TextDocument = new LSP . TextDocumentClientCapabilities { Hover = new LSP . HoverSetting { ContentFormat = [ LSP . MarkupKind . Markdown ] } }
610+ } ;
611+ await using var testLspServer = await CreateTestLspServerAsync ( markup , mutatingLspWorkspace , clientCapabilities ) ;
612+ var expectedLocation = testLspServer . GetLocations ( "caret" ) . Single ( ) ;
613+
614+ var expectedMarkdown = """
615+ ```csharp
616+ interface System.Collections.Generic.IDictionary<TKey, TValue>
617+ ```
618+
619+
620+ TKey is string
621+ TValue is ImmutableArray\<int\>
622+
623+ """ ;
624+
625+ var results = await RunGetHoverAsync (
626+ testLspServer ,
627+ expectedLocation ) . ConfigureAwait ( false ) ;
628+ Assert . Equal ( expectedMarkdown , results . Contents . Fourth . Value ) ;
629+ }
630+
589631 private static async Task < LSP . Hover > RunGetHoverAsync (
590632 TestLspServer testLspServer ,
591633 LSP . Location caret ,
0 commit comments