File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,11 @@ connection.onDidChangeConfiguration((change) => {
115115 documents . all ( ) . forEach ( validate ) ;
116116} ) ;
117117
118- connection . onDidChangeWatchedFiles ( ( change ) => {
118+ connection . onDidChangeWatchedFiles ( ( changes ) => {
119+ console . log ( changes ) ;
120+ fileSystemService . updateFileList ( ) ;
121+ documents . all ( ) . forEach ( validate ) ;
122+
119123 // change.changes.forEach((change) => {
120124 // connection.console.log(change.type.toString() + change.uri);
121125 // });
Original file line number Diff line number Diff line change @@ -5,9 +5,20 @@ import { URI } from 'vscode-uri';
55
66class FileSystemService {
77 public moduleFileList : string [ ] = [ ] ;
8+ private workspaces : WorkspaceFolder [ ] = [ ] ;
89
910 public registerWorkspaces ( workspaces : WorkspaceFolder [ ] ) {
10- workspaces . forEach ( ( folder ) => {
11+ this . workspaces = workspaces ;
12+ this . updateFileList ( ) ;
13+ }
14+
15+ // public init(rootUri: URI): void {
16+ // this.fileList = this.getAllFiles(rootUri);
17+ // }
18+
19+ public updateFileList ( ) : void {
20+ this . moduleFileList = [ ] ;
21+ this . workspaces . forEach ( ( folder ) => {
1122 const workspacePath = URI . parse ( folder . uri ) . fsPath ;
1223 const workspaceFileList = this . getAllFiles ( workspacePath ) ;
1324
@@ -17,10 +28,6 @@ class FileSystemService {
1728 } ) ;
1829 }
1930
20- // public init(rootUri: URI): void {
21- // this.fileList = this.getAllFiles(rootUri);
22- // }
23-
2431 private getAllFiles ( dirPath : string , isRoot = true ) : string [ ] {
2532 const files = readdirSync ( dirPath ) ;
2633
You can’t perform that action at this time.
0 commit comments