Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit test debugging post October VSCode breaking change #1800

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"tslint-microsoft-contrib": "^2.0.12",
"typescript": "^2.0.3",
"vsce": "^1.7.0",
"vscode": "^1.0.3"
"vscode": "^1.1.6"
},
"runtimeDependencies": [
{
Expand Down Expand Up @@ -190,7 +190,7 @@
}
],
"engines": {
"vscode": "^1.12.0"
"vscode": "^1.15.0"
},
"activationEvents": [
"onLanguage:csharp",
Expand Down
8 changes: 3 additions & 5 deletions src/features/codeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ export default class OmniSharpCodeLensProvider extends AbstractProvider implemen
toRange(node.Location),
{ title: "run test", command: 'dotnet.test.run', arguments: [testFeature.Data, fileName, testFrameworkName] }));

if (this._server.isDebugEnable()) {
bucket.push(new vscode.CodeLens(
toRange(node.Location),
{ title: "debug test", command: 'dotnet.test.debug', arguments: [testFeature.Data, fileName, testFrameworkName] }));
}
bucket.push(new vscode.CodeLens(
toRange(node.Location),
{ title: "debug test", command: 'dotnet.test.debug', arguments: [testFeature.Data, fileName, testFrameworkName] }));
}
}
}
5 changes: 4 additions & 1 deletion src/features/dotnetTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ export default class TestManager extends AbstractProvider {
}
})
.then(() => this._getLaunchConfiguration(debugType, fileName, testMethod, testFrameworkName, targetFrameworkVersion, debugEventListener))
.then(config => vscode.commands.executeCommand('vscode.startDebug', config))
.then(config => {
const workspaceFolder = vscode.workspace.getWorkspaceFolder(vscode.Uri.file(fileName));
return vscode.debug.startDebugging(workspaceFolder, config);
})
.catch(reason => {
vscode.window.showErrorMessage(`Failed to start debugger: ${reason}`);
if (debugEventListener != null) {
Expand Down
13 changes: 0 additions & 13 deletions src/omnisharp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ export class OmniSharpServer {
private _channel: vscode.OutputChannel;
private _logger: Logger;

private _isDebugEnable: boolean = false;

private _serverProcess: ChildProcess;
private _options: Options;

Expand Down Expand Up @@ -146,10 +144,6 @@ export class OmniSharpServer {
return this._channel;
}

public isDebugEnable(): boolean {
return this._isDebugEnable;
}

// --- eventing

public onStdout(listener: (e: string) => any, thisArg?: any) {
Expand Down Expand Up @@ -285,13 +279,6 @@ export class OmniSharpServer {
this._fireEvent(Events.ServerStart, solutionPath);

return this._doConnect();
}).then(() => {
return vscode.commands.getCommands()
.then(commands => {
if (commands.find(c => c === 'vscode.startDebug')) {
this._isDebugEnable = true;
}
});
}).then(() => {
// Start telemetry reporting
this._telemetryIntervalId = setInterval(() => this._reportTelemetry(), TelemetryReportingDelay);
Expand Down