@@ -26,11 +26,11 @@ export function activate(context: vscode.ExtensionContext) {
2626"enabled" : false
2727, "debug" : true
2828, "onSave" : < vscode . Disposable > { }
29- , "enable" : function ( ) {
29+ , "enable" : function ( auto : boolean = false ) {
3030if ( ! this . enabled ) {
3131this . log ( "Enabling save listener..." ) ;
3232
33- //Check if workspace.
33+ //Check if workspace/folder .
3434let root = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath : "" ;
3535if ( root !== "" ) {
3636//Look for mapping.
@@ -41,9 +41,10 @@ export function activate(context: vscode.ExtensionContext) {
4141this . onSave = vscode . workspace . onDidSaveTextDocument ( this . syncSave , map ) ;
4242context . subscriptions . push ( this . onSave ) ;
4343this . enabled = true ;
44+ vscode . window . showInformationMessage ( "File Sync is Active." ) ;
4445this . log ( "Save listener enabled." ) ;
4546} else {
46- vscode . window . showErrorMessage ( "No mapping available! File Sync disabled. " ) ;
47+ if ( ! auto ) { vscode . window . showErrorMessage ( "No mapping available!" ) ; }
4748this . log ( "Failed! Not mapped." ) ;
4849}
4950
@@ -83,7 +84,7 @@ export function activate(context: vscode.ExtensionContext) {
8384*/
8485filesync . log ( `Synced: ${ file . fileName } -> ${ dest . fsPath } ` ) ;
8586vscode . window . setStatusBarMessage ( `$(file-symlink-file) ${ file . fileName } synced to ${ dest . fsPath } ` , 5 * 1000 ) ;
86- } , err => { console . log ( err ) ; vscode . window . showErrorMessage ( "Error Syncing" , err ) ; } ) ;
87+ } , err => { console . log ( err ) ; vscode . window . showErrorMessage ( "Error Syncing:\n" + err . message ) ; } ) ;
8788//}, (...args) => { console.log(args); });
8889
8990} else if ( Array . isArray ( this . destination ) ) {
@@ -115,7 +116,7 @@ export function activate(context: vscode.ExtensionContext) {
115116context . subscriptions . push ( vscode . commands . registerCommand ( 'filesync.disable' , filesync . disable , filesync ) ) ;
116117
117118//Vroom
118- filesync . enable ( ) ;
119+ filesync . enable ( true ) ;
119120}
120121
121122// this method is called when your extension is deactivated
0 commit comments