@@ -11,6 +11,15 @@ import * as vscode from 'vscode';
1111import * as serverUtils from "../omnisharpUtils" ;
1212import * as protocol from '../protocol' ;
1313
14+ let enableDebug = false ;
15+
16+ // check if debugger start is enable
17+ vscode . commands . getCommands ( ) . then ( commands => {
18+ if ( commands . find ( c => c == "vscode.startDebug" ) ) {
19+ enableDebug = true ;
20+ }
21+ } ) ;
22+
1423export function registerDotNetTestRunCommand ( server : OmnisharpServer ) : vscode . Disposable {
1524 return vscode . commands . registerCommand (
1625 'dotnet.test.run' ,
@@ -54,7 +63,11 @@ export function debugDotnetTest(testMethod: string, fileName: string, server: Om
5463 "cwd" : "${workspaceRoot}" ,
5564 "stopAtEntry" : false
5665 }
57- ) . then ( undefined , reason => { vscode . window . showErrorMessage ( 'Failed to debug test because ' + reason + '.' ) } ) ;
66+ ) . then (
67+ response => {
68+ vscode . window . showInformationMessage ( 'call back from debugger start command' )
69+ } ,
70+ reason => { vscode . window . showErrorMessage ( 'Failed to debug test because ' + reason + '.' ) } ) ;
5871 } ) ;
5972}
6073
@@ -68,8 +81,10 @@ export function updateCodeLensForTest(bucket: vscode.CodeLens[], fileName: strin
6881 toRange ( node . Location ) ,
6982 { title : "run test" , command : 'dotnet.test.run' , arguments : [ testMethod , fileName ] } ) ) ;
7083
71- bucket . push ( new vscode . CodeLens (
72- toRange ( node . Location ) ,
73- { title : "debug test" , command : 'dotnet.test.debug' , arguments : [ testMethod , fileName ] } ) ) ;
84+ if ( enableDebug ) {
85+ bucket . push ( new vscode . CodeLens (
86+ toRange ( node . Location ) ,
87+ { title : "debug test" , command : 'dotnet.test.debug' , arguments : [ testMethod , fileName ] } ) ) ;
88+ }
7489 }
7590}
0 commit comments