File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class PackageWatcher {
46
46
async install ( ) {
47
47
this . packageFileWatcher = this . createPackageFileWatcher ( ) ;
48
48
this . resolvedFileWatcher = this . createResolvedFileWatcher ( ) ;
49
- this . workspaceStateFileWatcher = this . createWorkspaceStateFileWatcher ( ) ;
49
+ this . workspaceStateFileWatcher = await this . createWorkspaceStateFileWatcher ( ) ;
50
50
this . snippetWatcher = this . createSnippetFileWatcher ( ) ;
51
51
this . swiftVersionFileWatcher = await this . createSwiftVersionFileWatcher ( ) ;
52
52
}
@@ -83,7 +83,7 @@ export class PackageWatcher {
83
83
return watcher ;
84
84
}
85
85
86
- private createWorkspaceStateFileWatcher ( ) : vscode . FileSystemWatcher {
86
+ private async createWorkspaceStateFileWatcher ( ) : Promise < vscode . FileSystemWatcher > {
87
87
const uri = vscode . Uri . joinPath (
88
88
vscode . Uri . file (
89
89
BuildFlags . buildDirectoryFromWorkspacePath ( this . folderContext . folder . fsPath , true )
@@ -94,6 +94,16 @@ export class PackageWatcher {
94
94
watcher . onDidCreate ( async ( ) => await this . handleWorkspaceStateChange ( ) ) ;
95
95
watcher . onDidChange ( async ( ) => await this . handleWorkspaceStateChange ( ) ) ;
96
96
watcher . onDidDelete ( async ( ) => await this . handleWorkspaceStateChange ( ) ) ;
97
+
98
+ const fileExists = await fs
99
+ . access ( uri . fsPath )
100
+ . then ( ( ) => true )
101
+ . catch ( ( ) => false ) ;
102
+
103
+ if ( fileExists ) {
104
+ await this . handleWorkspaceStateChange ( ) ;
105
+ }
106
+
97
107
return watcher ;
98
108
}
99
109
You can’t perform that action at this time.
0 commit comments