@@ -663,29 +663,43 @@ public void FindsOccurrencesOnProperty()
663663 public async Task FindsEnumMemberDefinition ( )
664664 {
665665 SymbolReference symbol = await GetDefinition ( FindsTypeSymbolsDefinitionData . EnumMemberSourceDetails ) . ConfigureAwait ( true ) ;
666- Assert . Equal ( "Second" , symbol . SymbolName ) ;
666+ Assert . Equal ( "$Second" , symbol . SymbolName ) ;
667+ // Doesn't include [MyEnum]:: because that'd be redundant in the outline.
667668 Assert . Equal ( "Second" , symbol . DisplayString ) ;
669+ Assert . Equal ( SymbolType . EnumMember , symbol . SymbolType ) ;
668670 Assert . True ( symbol . IsDeclaration ) ;
669671 AssertIsRegion ( symbol . NameRegion , 41 , 5 , 41 , 11 ) ;
670- Assert . Equal ( 41 , symbol . ScriptRegion . StartLineNumber ) ;
672+
673+ symbol = await GetDefinition ( FindsReferencesOnTypeSymbolsData . EnumMemberSourceDetails ) . ConfigureAwait ( true ) ;
674+ Assert . Equal ( "$First" , symbol . SymbolName ) ;
675+ Assert . Equal ( "First" , symbol . DisplayString ) ;
676+ Assert . Equal ( SymbolType . EnumMember , symbol . SymbolType ) ;
677+ Assert . True ( symbol . IsDeclaration ) ;
678+ AssertIsRegion ( symbol . NameRegion , 40 , 5 , 40 , 10 ) ;
671679 }
672680
673681 [ Fact ]
674682 public async Task FindsReferencesOnEnumMember ( )
675683 {
676- List < SymbolReference > referencesResult = await GetReferences ( FindsReferencesOnTypeSymbolsData . EnumMemberSourceDetails ) . ConfigureAwait ( true ) ;
677- Assert . Single ( referencesResult ) ;
678- Assert . Equal ( 41 , referencesResult [ 0 ] . ScriptRegion . StartLineNumber ) ;
679- Assert . Equal ( 5 , referencesResult [ 0 ] . ScriptRegion . StartColumnNumber ) ;
680- }
684+ IEnumerable < SymbolReference > symbols = await GetReferences ( FindsReferencesOnTypeSymbolsData . EnumMemberSourceDetails ) . ConfigureAwait ( true ) ;
685+ Assert . Collection ( symbols ,
686+ ( i ) =>
687+ {
688+ Assert . Equal ( "$First" , i . SymbolName ) ;
689+ Assert . Equal ( "First" , i . DisplayString ) ;
690+ Assert . Equal ( SymbolType . EnumMember , i . SymbolType ) ;
691+ Assert . True ( i . IsDeclaration ) ;
692+ } ,
693+ ( i ) =>
694+ {
695+ Assert . Equal ( "$First" , i . SymbolName ) ;
696+ // The reference is just a member invocation, and so indistinguishable from a property.
697+ Assert . Equal ( "(property) First" , i . DisplayString ) ;
698+ Assert . Equal ( SymbolType . Property , i . SymbolType ) ;
699+ Assert . False ( i . IsDeclaration ) ;
700+ } ) ;
681701
682- [ Fact ]
683- public void FindsOccurrencesOnEnumMember ( )
684- {
685- IReadOnlyList < SymbolReference > occurrencesResult = GetOccurrences ( FindsOccurrencesOnTypeSymbolsData . EnumMemberSourceDetails ) ;
686- Assert . Single ( occurrencesResult ) ;
687- Assert . Equal ( "MyEnum.First" , occurrencesResult [ occurrencesResult . Count - 1 ] . SymbolName ) ;
688- Assert . Equal ( 40 , occurrencesResult [ occurrencesResult . Count - 1 ] . ScriptRegion . StartLineNumber ) ;
702+ Assert . Equal ( symbols , GetOccurrences ( FindsOccurrencesOnTypeSymbolsData . EnumMemberSourceDetails ) ) ;
689703 }
690704
691705 [ Fact ]
0 commit comments