@@ -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" ;
78
89export type Entry = File | Directory ;
910
@@ -151,11 +152,15 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
151152 throw new Error ( "Not implemented" ) ;
152153 }
153154 } )
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+ }
155160 this . _lookupAsFile ( uri ) . then ( ( entry ) => {
156161 this . _fireSoon ( { type : vscode . FileChangeType . Changed , uri } ) ;
157- } )
158- ) ;
162+ } ) ;
163+ } ) ;
159164 }
160165
161166 public delete ( uri : vscode . Uri , options : { recursive : boolean } ) : void | Thenable < void > {
@@ -166,7 +171,12 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
166171 return ;
167172 }
168173 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+ } ) ;
170180 }
171181
172182 public rename ( oldUri : vscode . Uri , newUri : vscode . Uri , options : { overwrite : boolean } ) : void | Thenable < void > {
0 commit comments