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