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

Commit

Permalink
Remove noise from errmsg for Go To Definition feature #1336
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Nov 15, 2017
1 parent 68a8d1f commit d20b28e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/goDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function definitionLocation_godef(document: vscode.TextDocument, position: vscod
return reject(missingToolMsg + 'godef');
}
if (err) {
return reject(err);
return reject(err.message || stderr);
};
let result = stdout.toString();
let lines = result.split('\n');
Expand Down Expand Up @@ -147,7 +147,7 @@ function definitionLocation_gogetdoc(document: vscode.TextDocument, position: vs
return definitionLocation_gogetdoc(document, position, offset, env, false, token);
}
if (err) {
return reject(err);
return reject(err.message || stderr);
};
let goGetDocOutput = <GoGetDocOuput>JSON.parse(stdout.toString());
let match = /(.*):(\d+):(\d+)/.exec(goGetDocOutput.pos);
Expand Down Expand Up @@ -193,7 +193,7 @@ function definitionLocation_guru(document: vscode.TextDocument, position: vscode
return reject(missingToolMsg + 'guru');
}
if (err) {
return reject(err);
return reject(err.message || stderr);
};
let guruOutput = <GuruDefinitionOuput>JSON.parse(stdout.toString());
let match = /(.*):(\d+):(\d+)/.exec(guruOutput.objpos);
Expand Down Expand Up @@ -243,7 +243,7 @@ export class GoDefinitionProvider implements vscode.DefinitionProvider {
if (typeof err === 'string' && err.startsWith(missingToolMsg)) {
promptForMissingTool(err.substr(missingToolMsg.length));
} else {
console.log(err);
return Promise.reject(err);
}
}
return Promise.resolve(null);
Expand Down
2 changes: 1 addition & 1 deletion src/goReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class GoReferenceProvider implements vscode.ReferenceProvider {
try {
if (err && (<any>err).code === 'ENOENT') {
promptForMissingTool('guru');
return reject('Cannot find tool "guru" to find references.')
return reject('Cannot find tool "guru" to find references.');
}

if (err && (<any>err).killed !== true) {
Expand Down

0 comments on commit d20b28e

Please sign in to comment.