Skip to content

Commit 5c09a91

Browse files
committed
code cleanup
1 parent 9d0ee51 commit 5c09a91

File tree

2 files changed

+9
-34
lines changed

2 files changed

+9
-34
lines changed

extension.js

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
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
31
var vscode = require('vscode');
42
const SvnSpawn = require('svn-spawn');
53
const 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
7672
function 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}/**/*`);
@@ -108,9 +91,7 @@ function activate(context) {
10891
if (uri.scheme !== 'file') {
10992
return;
11093
}
111-
112-
// As a mitigation for extensions like ESLint showing warnings and errors
113-
// for hg URIs, let's change the file extension of these uris to .hg.
94+
11495
return new Uri().with({ scheme: 'svn-original', query: uri.path, path: uri.path});
11596
}
11697
}
@@ -122,24 +103,24 @@ function activate(context) {
122103
notTracked.hideWhenEmpty = true;
123104

124105
const main = () => {
125-
return checkAllFiles(client, statusBar)
106+
return checkAllFiles(client, statusBar)
126107
.then((data) => {
127108
modified.resourceStates = updateResourceGroup(data, 'modified');
128109
removed.resourceStates = updateResourceGroup(data, 'removed');
129110
notTracked.resourceStates = updateResourceGroup(data, 'unversioned');
130111
})
131-
.catch((err) => vscode.window.showErrorMessage(err));
112+
.catch((err) => vscode.window.showErrorMessage(err));
132113
};
133-
114+
134115
watcher.onDidChange(main);
135116
watcher.onDidCreate(main);
136117
watcher.onDidDelete(main);
137-
138-
main();
118+
119+
main();
139120

140121

141122

142-
context.subscriptions.push(disposable);
123+
context.subscriptions.push(disposable);
143124
}
144125
exports.activate = activate;
145126

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
"*"
2424
],
2525
"main": "./extension",
26-
"contributes": {
27-
"commands": [{
28-
"command": "extension.sayHello",
29-
"title": "Hello World"
30-
}]
31-
},
3226
"scripts": {
3327
"postinstall": "node ./node_modules/vscode/bin/install",
3428
"test": "node ./node_modules/vscode/bin/test"

0 commit comments

Comments
 (0)