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) => {
115
115
documents . all ( ) . forEach ( validate ) ;
116
116
} ) ;
117
117
118
- connection . onDidChangeWatchedFiles ( ( change ) => {
118
+ connection . onDidChangeWatchedFiles ( ( changes ) => {
119
+ console . log ( changes ) ;
120
+ fileSystemService . updateFileList ( ) ;
121
+ documents . all ( ) . forEach ( validate ) ;
122
+
119
123
// change.changes.forEach((change) => {
120
124
// connection.console.log(change.type.toString() + change.uri);
121
125
// });
Original file line number Diff line number Diff line change @@ -5,9 +5,20 @@ import { URI } from 'vscode-uri';
5
5
6
6
class FileSystemService {
7
7
public moduleFileList : string [ ] = [ ] ;
8
+ private workspaces : WorkspaceFolder [ ] = [ ] ;
8
9
9
10
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 ) => {
11
22
const workspacePath = URI . parse ( folder . uri ) . fsPath ;
12
23
const workspaceFileList = this . getAllFiles ( workspacePath ) ;
13
24
@@ -17,10 +28,6 @@ class FileSystemService {
17
28
} ) ;
18
29
}
19
30
20
- // public init(rootUri: URI): void {
21
- // this.fileList = this.getAllFiles(rootUri);
22
- // }
23
-
24
31
private getAllFiles ( dirPath : string , isRoot = true ) : string [ ] {
25
32
const files = readdirSync ( dirPath ) ;
26
33
You can’t perform that action at this time.
0 commit comments