aboutsummaryrefslogtreecommitdiff
path: root/src/extension.js
blob: 850d5be3e34b68fa916d4470b5e3beae744d36a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const vscode = require('vscode');
const { ErrorsWrapper, wrapError } = require('./errors');
const selectReceiver = require('./implement-interface');
/**
 * @param {vscode.ExtensionContext} context
 */
function activate(context) {
    let wrapErrorCommand = vscode.commands.registerCommand('gotools.wrap-error', wrapError);
    context.subscriptions.push(
        vscode.languages.registerCodeActionsProvider(
            'go',
            new ErrorsWrapper(),
            {
                providedCodeActionKinds: [
                    vscode.CodeActionKind.RefactorRewrite
                ]
            }
        )
    );
    context.subscriptions.push(wrapErrorCommand);

    vscode.commands.registerCommand("gotools.imports", function () {
        // TODO
    })

    context.subscriptions.push(vscode.commands.registerCommand("gotools.implement", selectReceiver));
}

// This method is called when your extension is deactivated
function deactivate() { }



module.exports = {
    activate,
    deactivate
}