@@ -9,7 +9,7 @@ import { beforeAll, afterAll, test, expect, beforeEach } from '@jest/globals';
99import testAssetWorkspace from './testAssets/testAssetWorkspace' ;
1010import * as integrationHelpers from '../../lsptoolshost/integrationTests/integrationHelpers' ;
1111
12- integrationHelpers . describeIfWindows ( `Razor Definition ${ testAssetWorkspace . description } ` , function ( ) {
12+ integrationHelpers . describeIfWindows ( `Razor References ${ testAssetWorkspace . description } ` , function ( ) {
1313 beforeAll ( async function ( ) {
1414 if ( ! integrationHelpers . isRazorWorkspace ( vscode . workspace ) ) {
1515 return ;
@@ -111,4 +111,31 @@ integrationHelpers.describeIfWindows(`Razor Definition ${testAssetWorkspace.desc
111111 expect ( definitionLocation . range . end . line ) . toBe ( 23 ) ;
112112 expect ( definitionLocation . range . end . character ) . toBe ( 19 ) ;
113113 } ) ;
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+ } ) ;
114141} ) ;
0 commit comments