@@ -13,7 +13,7 @@ const chai = require('chai');
1313chai . use ( require ( 'chai-arrays' ) ) ;
1414chai . use ( require ( 'chai-fs' ) ) ;
1515
16- suite ( `DocumentSymbolProvider : ${ testAssetWorkspace . description } ` , function ( ) {
16+ suite ( `WorkspaceSymbolProvider : ${ testAssetWorkspace . description } ` , function ( ) {
1717
1818 suiteSetup ( async function ( ) {
1919 should ( ) ;
@@ -32,11 +32,27 @@ suite(`DocumentSymbolProvider: ${testAssetWorkspace.description}`, function () {
3232 } ) ;
3333
3434 test ( "Returns elements" , async function ( ) {
35- let symbols = await GetWorkspaceSymbols ( ) ;
35+ let symbols = await GetWorkspaceSymbols ( "P" ) ;
36+ expect ( symbols . length ) . to . be . greaterThan ( 0 ) ;
37+ } ) ;
38+
39+ test ( "Returns no elements when minimum filter length is configured and search term is shorter" , async function ( ) {
40+ let omnisharpConfig = vscode . workspace . getConfiguration ( 'omnisharp' ) ;
41+ await omnisharpConfig . update ( 'minFindSymbolsFilterLength' , 2 ) ;
42+
43+ let symbols = await GetWorkspaceSymbols ( "P" ) ;
44+ expect ( symbols . length ) . to . be . equal ( 0 ) ;
45+ } ) ;
46+
47+ test ( "Returns elements when minimum filter length is configured and search term is longer or equal" , async function ( ) {
48+ let omnisharpConfig = vscode . workspace . getConfiguration ( 'omnisharp' ) ;
49+ await omnisharpConfig . update ( 'minFindSymbolsFilterLength' , 2 ) ;
50+
51+ let symbols = await GetWorkspaceSymbols ( "P1" ) ;
3652 expect ( symbols . length ) . to . be . greaterThan ( 0 ) ;
3753 } ) ;
3854} ) ;
3955
40- async function GetWorkspaceSymbols ( ) {
41- return < vscode . SymbolInformation [ ] > await vscode . commands . executeCommand ( "vscode.executeWorkspaceSymbolProvider" ) ;
56+ async function GetWorkspaceSymbols ( filter : string ) {
57+ return < vscode . SymbolInformation [ ] > await vscode . commands . executeCommand ( "vscode.executeWorkspaceSymbolProvider" , filter ) ;
4258}
0 commit comments