@@ -4,6 +4,7 @@ import * as url from "url";
44import { AtelierAPI } from "../../api" ;
55import { Directory } from "./Directory" ;
66import { File } from "./File" ;
7+ import { fireOtherStudioAction , OtherStudioAction } from "../../commands/studio" ;
78import { StudioOpenDialog } from "../../queries" ;
89
910export type Entry = File | Directory ;
@@ -152,11 +153,15 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
152153 throw new Error ( "Not implemented" ) ;
153154 }
154155 } )
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+ }
156161 this . _lookupAsFile ( uri ) . then ( ( entry ) => {
157162 this . _fireSoon ( { type : vscode . FileChangeType . Changed , uri } ) ;
158- } )
159- ) ;
163+ } ) ;
164+ } ) ;
160165 }
161166
162167 public delete ( uri : vscode . Uri , options : { recursive : boolean } ) : void | Thenable < void > {
@@ -167,7 +172,12 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
167172 return ;
168173 }
169174 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+ } ) ;
171181 }
172182
173183 public rename ( oldUri : vscode . Uri , newUri : vscode . Uri , options : { overwrite : boolean } ) : void | Thenable < void > {
0 commit comments