File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ export function createLaunchConfigFromContext(
338338
339339 let dir = '' ;
340340 const tsConfig = loadJSON < ITSConfig > ( folder , 'tsconfig.json' ) ;
341- if ( tsConfig && tsConfig . compilerOptions && tsConfig . compilerOptions . outDir ) {
341+ if ( tsConfig ? .compilerOptions ?. outDir && canDetectTsBuildTask ( ) ) {
342342 const outDir = tsConfig . compilerOptions . outDir ;
343343 if ( ! path . isAbsolute ( outDir ) ) {
344344 dir = outDir ;
@@ -357,6 +357,11 @@ export function createLaunchConfigFromContext(
357357 return config ;
358358}
359359
360+ function canDetectTsBuildTask ( ) {
361+ const value = vscode . workspace . getConfiguration ( ) . get ( 'typescript.tsc.autoDetect' ) ;
362+ return value !== 'off' && value !== 'watch' ;
363+ }
364+
360365function configureMern ( config : ResolvingNodeConfiguration ) {
361366 if ( config . request !== 'launch' ) {
362367 return ;
@@ -374,7 +379,7 @@ function isTranspiledLanguage(languagId: string): boolean {
374379 return languagId === 'typescript' || languagId === 'coffeescript' ;
375380}
376381
377- function loadJSON < T > ( folder : vscode . WorkspaceFolder | undefined , file : string ) : T | void {
382+ function loadJSON < T > ( folder : vscode . WorkspaceFolder | undefined , file : string ) : T | undefined {
378383 if ( folder ) {
379384 try {
380385 const content = fs . readFileSync ( path . join ( folder . uri . fsPath , file ) , 'utf8' ) ;
You can’t perform that action at this time.
0 commit comments