1- // The module 'vscode' contains the VS Code extensibility API
2- // Import the module and reference it with the alias vscode in your code below
31var vscode = require ( 'vscode' ) ;
42const SvnSpawn = require ( 'svn-spawn' ) ;
53const path = require ( 'path' ) ;
@@ -71,28 +69,13 @@ const updateResourceGroup = (data, type) => {
7169 return matches ;
7270}
7371
74- // this method is called when your extension is activated
75- // your extension is activated the very first time the command is executed
7672function activate ( context ) {
77-
78- // Use the console to output diagnostic information (console.log) and errors (console.error)
79- // This line of code will only be executed once when your extension is activated
80- console . log ( 'Congratulations, your extension "svn-scm" is now active!' ) ;
81-
82- // The command has been defined in the package.json file
83- // Now provide the implementation of the command with registerCommand
84- // The commandId parameter must match the command field in package.json
85- var disposable = vscode . commands . registerCommand ( 'extension.sayHello' , function ( ) {
86- // The code you place here will be executed every time your command is executed
87-
88- // Display a message box to the user
89- vscode . window . showInformationMessage ( 'Hello World!' ) ;
90- } ) ;
73+ console . log ( 'svn-scm is now active!' ) ;
9174
9275 const rootPath = vscode . workspace . rootPath ;
9376 const outputChannel = createChannel ( ) ;
9477 vscode . commands . registerCommand ( 'vscode-svn.showOutputChannel' , ( ) => outputChannel . show ( ) ) ;
95-
78+
9679 const statusBar = createStatusBar ( ) ;
9780 const client = createClient ( rootPath ) ;
9881 const watcher = vscode . workspace . createFileSystemWatcher ( `${ rootPath } /**/*` ) ;
@@ -116,24 +99,24 @@ function activate(context) {
11699 notTracked . hideWhenEmpty = true ;
117100
118101 const main = ( ) => {
119- return checkAllFiles ( client , statusBar )
102+ return checkAllFiles ( client , statusBar )
120103 . then ( ( data ) => {
121104 modified . resourceStates = updateResourceGroup ( data , 'modified' ) ;
122105 removed . resourceStates = updateResourceGroup ( data , 'removed' ) ;
123106 notTracked . resourceStates = updateResourceGroup ( data , 'unversioned' ) ;
124107 } )
125- . catch ( ( err ) => vscode . window . showErrorMessage ( err ) ) ;
108+ . catch ( ( err ) => vscode . window . showErrorMessage ( err ) ) ;
126109 } ;
127-
110+
128111 watcher . onDidChange ( main ) ;
129112 watcher . onDidCreate ( main ) ;
130113 watcher . onDidDelete ( main ) ;
131-
132- main ( ) ;
114+
115+ main ( ) ;
133116
134117
135118
136- context . subscriptions . push ( disposable ) ;
119+ context . subscriptions . push ( disposable ) ;
137120}
138121exports . activate = activate ;
139122
0 commit comments