3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { Event } from 'vs/base/common/event' ;
6
+ import { Event , Emitter } from 'vs/base/common/event' ;
7
7
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
8
- import { DisposableStore , dispose } from 'vs/base/common/lifecycle' ;
8
+ import { DisposableStore , IDisposable , dispose } from 'vs/base/common/lifecycle' ;
9
9
import { IFilesConfiguration , ISortOrderConfiguration , SortOrder , LexicographicOptions } from 'vs/workbench/contrib/files/common/files' ;
10
10
import { ExplorerItem , ExplorerModel } from 'vs/workbench/contrib/files/common/explorerModel' ;
11
11
import { URI } from 'vs/base/common/uri' ;
@@ -25,10 +25,8 @@ import { RunOnceScheduler } from 'vs/base/common/async';
25
25
import { IHostService } from 'vs/workbench/services/host/browser/host' ;
26
26
import { IExpression , parse } from 'vs/base/common/glob' ;
27
27
import { mixin , deepClone , equals } from 'vs/base/common/objects' ;
28
- import { IDisposable } from 'vs/base/common/lifecycle' ;
29
28
import { CachedParsedExpression } from 'vs/workbench/contrib/files/browser/views/explorerViewer' ;
30
- import { Emitter } from 'vs/base/common/event' ;
31
- import { relative } from 'path' ;
29
+ import { relative } from 'vs/base/common/path' ;
32
30
33
31
export const UNDO_REDO_SOURCE = new UndoRedoSource ( ) ;
34
32
@@ -138,7 +136,7 @@ export class ExplorerService implements IExplorerService {
138
136
this . revealExcludeMatcher = new RevealFilter (
139
137
contextService , configurationService ) ;
140
138
this . disposables . add ( this . revealExcludeMatcher ) ;
141
- this . disposables . add ( this . revealExcludeMatcher . onDidChange ( ( ) => this . refresh ( ) ) )
139
+ this . disposables . add ( this . revealExcludeMatcher . onDidChange ( ( ) => this . refresh ( ) ) ) ;
142
140
}
143
141
144
142
get roots ( ) : ExplorerItem [ ] {
@@ -443,7 +441,7 @@ class RevealFilter implements IDisposable {
443
441
let shouldFire = false ;
444
442
this . contextService . getWorkspace ( ) . folders . forEach ( folder => {
445
443
const configuration = this . configurationService . getValue < IFilesConfiguration > ( { resource : folder . uri } ) ;
446
- const excludesConfig : IExpression = getRevealExcludes ( configuration , true ) || Object . create ( null )
444
+ const excludesConfig : IExpression = getRevealExcludes ( configuration , true ) || Object . create ( null ) ;
447
445
448
446
if ( ! shouldFire ) {
449
447
const cached = this . revealExpressionPerRoot . get ( folder . uri . toString ( ) ) ;
@@ -469,13 +467,13 @@ class RevealFilter implements IDisposable {
469
467
const root = item . root ;
470
468
let currentItem = item ;
471
469
// If any parent up to the root matches pattern, do not reveal
472
- while ( currentItem != root ) {
470
+ while ( currentItem !== root ) {
473
471
if ( cached . parsed ( relative ( currentItem . root . resource . path , currentItem . resource . path ) , currentItem . name , name => ! ! ( currentItem . parent && currentItem . parent . getChild ( name ) ) ) ) {
474
472
return false ;
475
473
}
476
474
if ( ! currentItem . parent ) {
477
475
return true ;
478
- } ;
476
+ }
479
477
currentItem = currentItem . parent ;
480
478
}
481
479
return true ;
0 commit comments