@@ -9,7 +9,7 @@ import { beforeAll, afterAll, test, expect, beforeEach } from '@jest/globals';
9
9
import testAssetWorkspace from './testAssets/testAssetWorkspace' ;
10
10
import * as integrationHelpers from '../../lsptoolshost/integrationTests/integrationHelpers' ;
11
11
12
- integrationHelpers . describeIfWindows ( `Razor Definition ${ testAssetWorkspace . description } ` , function ( ) {
12
+ integrationHelpers . describeIfWindows ( `Razor References ${ testAssetWorkspace . description } ` , function ( ) {
13
13
beforeAll ( async function ( ) {
14
14
if ( ! integrationHelpers . isRazorWorkspace ( vscode . workspace ) ) {
15
15
return ;
@@ -111,4 +111,31 @@ integrationHelpers.describeIfWindows(`Razor Definition ${testAssetWorkspace.desc
111
111
expect ( definitionLocation . range . end . line ) . toBe ( 23 ) ;
112
112
expect ( definitionLocation . range . end . character ) . toBe ( 19 ) ;
113
113
} ) ;
114
+
115
+ test ( 'Find All References - CSharp' , async ( ) => {
116
+ if ( ! integrationHelpers . isRazorWorkspace ( vscode . workspace ) ) {
117
+ return ;
118
+ }
119
+
120
+ await integrationHelpers . openFileInWorkspaceAsync ( path . join ( 'Pages' , 'References.razor.cs' ) ) ;
121
+
122
+ const position = new vscode . Position ( 4 , 20 ) ;
123
+
124
+ await integrationHelpers . waitForExpectedResult < vscode . Location [ ] > (
125
+ async ( ) =>
126
+ await vscode . commands . executeCommand (
127
+ 'vscode.executeReferenceProvider' ,
128
+ vscode . window . activeTextEditor ! . document . uri ,
129
+ position
130
+ ) ,
131
+ 10000 ,
132
+ 100 ,
133
+ ( locations ) => {
134
+ expect ( locations . length ) . toBe ( 3 ) ;
135
+ expect ( locations [ 0 ] . uri . path ) . toBe ( vscode . window . activeTextEditor ! . document . uri . path ) ;
136
+ expect ( locations [ 1 ] . uri . path ) . toBe ( vscode . window . activeTextEditor ! . document . uri . path ) ;
137
+ expect ( locations [ 2 ] . uri . path ) . toBe ( vscode . window . activeTextEditor ! . document . uri . path ) ;
138
+ }
139
+ ) ;
140
+ } ) ;
114
141
} ) ;
0 commit comments