Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Prompt for missing tools when config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jun 1, 2018
1 parent f78d12d commit 641c783
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Binary file modified Go-latest.vsix
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Go",
"version": "0.6.81-beta.3",
"version": "0.6.81-beta.4",
"publisher": "ms-vscode",
"description": "Rich Go language support for Visual Studio Code",
"author": {
Expand Down
17 changes: 16 additions & 1 deletion src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { GoSignatureHelpProvider } from './goSignature';
import { GoWorkspaceSymbolProvider } from './goSymbol';
import { GoCodeActionProvider } from './goCodeAction';
import { check, removeTestStatus, notifyIfGeneratedFile } from './goCheck';
import { updateGoPathGoRootFromConfig, offerToInstallTools } from './goInstallTools';
import { updateGoPathGoRootFromConfig, offerToInstallTools, promptForMissingTool } from './goInstallTools';
import { GO_MODE } from './goMode';
import { showHideStatus } from './goStatus';
import { toggleCoverageCurrentPackage, getCodeCoverage, removeCodeCoverage } from './goCover';
Expand Down Expand Up @@ -308,6 +308,15 @@ export function activate(ctx: vscode.ExtensionContext): void {
referencesCodeLensProvider.setEnabled(updatedGoConfig['enableCodeLens']['references']);
}

if (e.affectsConfiguration('go.formatTool')) {
checkToolExists(updatedGoConfig['formatTool']);
}
if (e.affectsConfiguration('go.lintTool')) {
checkToolExists(updatedGoConfig['lintTool']);
}
if (e.affectsConfiguration('go.docsTool')) {
checkToolExists(updatedGoConfig['docsTool']);
}
}));

ctx.subscriptions.push(vscode.commands.registerCommand('go.test.generate.package', () => {
Expand Down Expand Up @@ -478,3 +487,9 @@ function sendTelemetryEventForConfig(goConfig: vscode.WorkspaceConfiguration) {
function didLangServerConfigChange(e: vscode.ConfigurationChangeEvent): boolean {
return e.affectsConfiguration('go.useLanguageServer') || e.affectsConfiguration('go.languageServerFlags') || e.affectsConfiguration('go.languageServerExperimentalFeatures');
}

function checkToolExists(tool: string) {
if (tool === getBinPath(tool)) {
promptForMissingTool(tool);
}
}

0 comments on commit 641c783

Please sign in to comment.