Skip to content

Commit

Permalink
Improve debugger install error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
caslan committed Mar 18, 2016
1 parent 0b61630 commit d0f0c4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"run-in-terminal": "*",
"semver": "*",
"vscode-extension-telemetry": "0.0.4",
"tmp": "0.0.28"
"tmp": "0.0.28",
"open": "*"
},
"devDependencies": {
"gulp": "^3.9.1",
Expand Down
25 changes: 18 additions & 7 deletions src/coreclr-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ export function installCoreClrDebug(context: vscode.ExtensionContext) {
}

if (!isOnPath('dotnet')) {
// TODO: In a future release, this should be an error. For this release, we will let it go
console.log("The .NET CLI tools are not installed. .NET Core debugging will not be enabled.");
const getDotNetMessage = "Get .NET CLI tools";
vscode.window.showErrorMessage("The .NET CLI tools cannot be located. .NET Core debugging will not be enabled. Make sure .NET CLI tools are installed and are on the path.",
getDotNetMessage).then(function (value) {
if (value === getDotNetMessage) {
var open = require('open');
open("http://dotnet.github.io/getting-started/");
}
});

return;
}

Expand All @@ -45,9 +52,8 @@ export function installCoreClrDebug(context: vscode.ExtensionContext) {
};
})();

_channel.appendLine("Downloading and configuring the .NET Core Debugger...");
_channel.show(vscode.ViewColumn.Three);

vscode.window.setStatusBarMessage("Downloading and configuring the .NET Core Debugger...");

let installStage = 'dotnet restore';
let installError = '';

Expand All @@ -71,10 +77,15 @@ export function installCoreClrDebug(context: vscode.ExtensionContext) {
return writeCompletionFile();
}).then(function() {
installStage = "completeSuccess";
_channel.appendLine('Succesfully installed .NET Core Debugger.');
vscode.window.setStatusBarMessage('Successfully installed .NET Core Debugger.');
})
.catch(function(error) {
_channel.appendLine('Error while installing .NET Core Debugger.');
const viewLogMessage = "View Log";
vscode.window.showErrorMessage('Error while installing .NET Core Debugger.', viewLogMessage).then(function (value) {
if (value === viewLogMessage) {
_channel.show(vscode.ViewColumn.Three);
}
})

installError = error.toString();
console.log(error);
Expand Down

0 comments on commit d0f0c4b

Please sign in to comment.