@@ -4,6 +4,7 @@ import * as url from "url";
4
4
import { AtelierAPI } from "../../api" ;
5
5
import { Directory } from "./Directory" ;
6
6
import { File } from "./File" ;
7
+ import { fireOtherStudioAction , OtherStudioAction } from "../../commands/studio" ;
7
8
import { StudioOpenDialog } from "../../queries" ;
8
9
9
10
export type Entry = File | Directory ;
@@ -152,11 +153,15 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
152
153
throw new Error ( "Not implemented" ) ;
153
154
}
154
155
} )
155
- . then ( ( ) =>
156
+ . then ( ( response ) => {
157
+ if ( response && response . result . ext && response . result . ext [ 0 ] && response . result . ext [ 1 ] ) {
158
+ fireOtherStudioAction ( OtherStudioAction . CreatedNewDocument , uri , response . result . ext [ 0 ] ) ;
159
+ fireOtherStudioAction ( OtherStudioAction . FirstTimeDocumentSave , uri , response . result . ext [ 1 ] ) ;
160
+ }
156
161
this . _lookupAsFile ( uri ) . then ( ( entry ) => {
157
162
this . _fireSoon ( { type : vscode . FileChangeType . Changed , uri } ) ;
158
- } )
159
- ) ;
163
+ } ) ;
164
+ } ) ;
160
165
}
161
166
162
167
public delete ( uri : vscode . Uri , options : { recursive : boolean } ) : void | Thenable < void > {
@@ -167,7 +172,12 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
167
172
return ;
168
173
}
169
174
const api = new AtelierAPI ( uri ) ;
170
- return api . deleteDoc ( fileName ) . then ( ( ) => this . _fireSoon ( { type : vscode . FileChangeType . Deleted , uri } ) ) ;
175
+ return api . deleteDoc ( fileName ) . then ( ( response ) => {
176
+ if ( response . result . ext ) {
177
+ fireOtherStudioAction ( OtherStudioAction . DeletedDocument , uri , response . result . ext ) ;
178
+ }
179
+ this . _fireSoon ( { type : vscode . FileChangeType . Deleted , uri } ) ;
180
+ } ) ;
171
181
}
172
182
173
183
public rename ( oldUri : vscode . Uri , newUri : vscode . Uri , options : { overwrite : boolean } ) : void | Thenable < void > {
0 commit comments