@@ -84,33 +84,34 @@ private Task<SymbolReference> GetDefinition(ScriptRegion scriptRegion)
84
84
{
85
85
ScriptFile scriptFile = GetScriptFile ( scriptRegion ) ;
86
86
87
- SymbolReference symbolReference = SymbolsService . FindSymbolAtLocation (
87
+ // TODO: We should just use the name to find it.
88
+ SymbolReference symbol = SymbolsService . FindSymbolAtLocation (
88
89
scriptFile ,
89
90
scriptRegion . StartLineNumber ,
90
91
scriptRegion . StartColumnNumber ) ;
91
92
92
- Assert . NotNull ( symbolReference ) ;
93
+ Assert . NotNull ( symbol ) ;
93
94
94
- return symbolsService . GetDefinitionOfSymbolAsync ( scriptFile , symbolReference ) ;
95
+ return symbolsService . GetDefinitionOfSymbolAsync ( scriptFile , symbol ) ;
95
96
}
96
97
97
98
private async Task < List < SymbolReference > > GetReferences ( ScriptRegion scriptRegion )
98
99
{
99
100
ScriptFile scriptFile = GetScriptFile ( scriptRegion ) ;
100
101
101
- SymbolReference symbolReference = SymbolsService . FindSymbolAtLocation (
102
+ SymbolReference symbol = SymbolsService . FindSymbolAtLocation (
102
103
scriptFile ,
103
104
scriptRegion . StartLineNumber ,
104
105
scriptRegion . StartColumnNumber ) ;
105
106
106
- Assert . NotNull ( symbolReference ) ;
107
+ Assert . NotNull ( symbol ) ;
107
108
108
109
IEnumerable < SymbolReference > symbols =
109
110
await symbolsService . ScanForReferencesOfSymbol (
110
- symbolReference ,
111
+ symbol ,
111
112
workspace . ExpandScriptReferences ( scriptFile ) ) . ConfigureAwait ( true ) ;
112
113
113
- return symbols . OrderBy ( symbol => symbol . ScriptRegion . ToRange ( ) . Start ) . ToList ( ) ;
114
+ return symbols . OrderBy ( i => i . ScriptRegion . ToRange ( ) . Start ) . ToList ( ) ;
114
115
}
115
116
116
117
private IReadOnlyList < SymbolReference > GetOccurrences ( ScriptRegion scriptRegion )
@@ -423,10 +424,10 @@ public async Task FindsConstructorDefinition()
423
424
[ Fact ]
424
425
public async Task FindsReferencesOnConstructor ( )
425
426
{
426
- List < SymbolReference > referencesResult = await GetReferences ( FindsReferencesOnTypeSymbolsData . ConstructorSourceDetails ) . ConfigureAwait ( true ) ;
427
- Assert . Single ( referencesResult ) ;
428
- Assert . Equal ( 9 , referencesResult [ 0 ] . ScriptRegion . StartLineNumber ) ;
429
- Assert . Equal ( 5 , referencesResult [ 0 ] . ScriptRegion . StartColumnNumber ) ;
427
+ List < SymbolReference > symbols = await GetReferences ( FindsReferencesOnTypeSymbolsData . ConstructorSourceDetails ) . ConfigureAwait ( true ) ;
428
+ Assert . Single ( symbols ) ;
429
+ Assert . Equal ( 9 , symbols [ 0 ] . ScriptRegion . StartLineNumber ) ;
430
+ Assert . Equal ( 5 , symbols [ 0 ] . ScriptRegion . StartColumnNumber ) ;
430
431
}
431
432
432
433
[ Fact ]
@@ -736,10 +737,10 @@ public void FindsSymbolsInPesterFile()
736
737
Assert . Equal ( 9 , lastItSymbol . ScriptRegion . StartColumnNumber ) ;
737
738
738
739
Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . BeforeDiscovery ) ) ;
739
- SymbolReference firstBeforeDisocverySymbol = symbolsResult . First ( r => r . Command == PesterCommandType . BeforeDiscovery ) ;
740
- Assert . Equal ( "BeforeDiscovery" , firstBeforeDisocverySymbol . SymbolName ) ;
741
- Assert . Equal ( 1 , firstBeforeDisocverySymbol . ScriptRegion . StartLineNumber ) ;
742
- Assert . Equal ( 1 , firstBeforeDisocverySymbol . ScriptRegion . StartColumnNumber ) ;
740
+ SymbolReference firstBeforeDiscoverySymbol = symbolsResult . First ( r => r . Command == PesterCommandType . BeforeDiscovery ) ;
741
+ Assert . Equal ( "BeforeDiscovery" , firstBeforeDiscoverySymbol . SymbolName ) ;
742
+ Assert . Equal ( 1 , firstBeforeDiscoverySymbol . ScriptRegion . StartLineNumber ) ;
743
+ Assert . Equal ( 1 , firstBeforeDiscoverySymbol . ScriptRegion . StartColumnNumber ) ;
743
744
744
745
Assert . Equal ( 2 , symbolsResult . Count ( r => r . Command == PesterCommandType . BeforeAll ) ) ;
745
746
SymbolReference lastBeforeAllSymbol = symbolsResult . Last ( r => r . Command == PesterCommandType . BeforeAll ) ;
0 commit comments