diff --git a/src/goLanguageServer.ts b/src/goLanguageServer.ts index e2afaca975..53830cba69 100644 --- a/src/goLanguageServer.ts +++ b/src/goLanguageServer.ts @@ -21,6 +21,7 @@ import { } from 'vscode-languageclient'; import WebRequest = require('web-request'); import { extensionId } from './const'; +import { GoCodeActionProvider } from './goCodeAction'; import { GoDefinitionProvider } from './goDeclaration'; import { toolExecutionEnvironment } from './goEnv'; import { GoHoverProvider } from './goExtraInfo'; @@ -334,6 +335,7 @@ function registerDefaultProviders(ctx: vscode.ExtensionContext) { ); defaultLanguageProviders.push(vscode.languages.registerRenameProvider(GO_MODE, new GoRenameProvider())); defaultLanguageProviders.push(vscode.workspace.onDidChangeTextDocument(parseLiveFile, null, ctx.subscriptions)); + defaultLanguageProviders.push(vscode.languages.registerCodeActionsProvider(GO_MODE, new GoCodeActionProvider())); for (const provider of defaultLanguageProviders) { ctx.subscriptions.push(provider); diff --git a/src/goMain.ts b/src/goMain.ts index ac4fc8e577..bff871e2bc 100644 --- a/src/goMain.ts +++ b/src/goMain.ts @@ -11,7 +11,6 @@ import vscode = require('vscode'); import { browsePackages } from './goBrowsePackage'; import { buildCode } from './goBuild'; import { check, notifyIfGeneratedFile, removeTestStatus } from './goCheck'; -import { GoCodeActionProvider } from './goCodeAction'; import { applyCodeCoverage, applyCodeCoverageToAllEditors, initCoverageDecorators, removeCodeCoverageOnFileSave, toggleCoverageCurrentPackage, trackCodeCoverageRemovalOnFileChange, updateCodeCoverageDecorators @@ -176,7 +175,6 @@ export function activate(ctx: vscode.ExtensionContext): void { const testCodeLensProvider = new GoRunTestCodeLensProvider(); const referencesCodeLensProvider = new GoReferencesCodeLensProvider(); - ctx.subscriptions.push(vscode.languages.registerCodeActionsProvider(GO_MODE, new GoCodeActionProvider())); ctx.subscriptions.push(vscode.languages.registerCodeLensProvider(GO_MODE, testCodeLensProvider)); ctx.subscriptions.push(vscode.languages.registerCodeLensProvider(GO_MODE, referencesCodeLensProvider)); ctx.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('go', new GoDebugConfigurationProvider()));