aboutsummaryrefslogblamecommitdiff
path: root/src/extension.js
blob: 81ba639e6677ca63e70dbe208cff9ab5d261953b (plain) (tree)
1
2
3
4
5
6
7
8
                                 

                                                         
                                                



                                           













                                                                                            
                                                                                                      

                                                                                                     




                                                           
 

                  

              
 
const vscode = require('vscode');
const { ErrorsWrapper, wrapError } = require('./errors');
const selectReceiver = require('./implement-interface');
const groupImports = require('./group-imports');
/**
 * @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);

    context.subscriptions.push(vscode.commands.registerCommand("gotools.group-imports", groupImports))

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

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



module.exports = {
    activate,
    deactivate
}