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

Commit

Permalink
Dont try to close gocode when its not found #1966
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Oct 16, 2018
1 parent cb1869c commit 177a905
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,16 @@ export function installTools(missing: string[]) {
let closeToolPromise = Promise.resolve(true);
if (tool === 'gocode' || tool === 'gocode-gomod') {
closeToolPromise = new Promise<boolean>((innerResolve) => {
cp.execFile(getBinPath(tool), ['close'], {}, (err, stdout, stderr) => {
if (stderr && stderr.indexOf('rpc: can\'t find service Server.') > -1) {
outputChannel.appendLine('Installing gocode aborted as existing process cannot be closed. Please kill the running process for gocode and try again.');
return innerResolve(false);
}
innerResolve(true);
});
const gocodeToolPath = getBinPath(tool);
if (path.isAbsolute(gocodeToolPath)) {
cp.execFile(gocodeToolPath, ['close'], {}, (err, stdout, stderr) => {
if (stderr && stderr.indexOf('rpc: can\'t find service Server.') > -1) {
outputChannel.appendLine('Installing gocode aborted as existing process cannot be closed. Please kill the running process for gocode and try again.');
return innerResolve(false);
}
innerResolve(true);
});
}
});
}

Expand Down

0 comments on commit 177a905

Please sign in to comment.