@@ -37,7 +37,7 @@ import { BasicCpuProfiler } from './profiling/basicCpuProfiler';
3737import { ScriptSkipper } from './scriptSkipper/implementation' ;
3838import { IScriptSkipper } from './scriptSkipper/scriptSkipper' ;
3939import { SmartStepper } from './smartStepping' ;
40- import { ISourceWithMap , SourceFromMap } from './source' ;
40+ import { ISourceWithMap , Source , SourceFromMap } from './source' ;
4141import { SourceContainer } from './sourceContainer' ;
4242import { Thread } from './threads' ;
4343import { VariableStore } from './variableStore' ;
@@ -136,9 +136,25 @@ export class DebugAdapter implements IDisposable {
136136 private async _getPreferredUILocation (
137137 params : Dap . GetPreferredUILocationParams ,
138138 ) : Promise < Dap . GetPreferredUILocationResult > {
139- const source = this . sourceContainer . source ( params . source ) ;
139+ let source : Source | undefined = undefined ;
140+ if ( params . originalUrl ) {
141+ source = this . sourceContainer . getSourceByOriginalUrl ( params . originalUrl ) ;
142+ }
143+ if ( ! source && params . source ) {
144+ source = this . sourceContainer . source ( params . source ) ;
145+ }
146+
140147 if ( ! source ) {
141- return params ;
148+ if ( params . source ) {
149+ // Return unmodified input source
150+ return {
151+ column : params . column ,
152+ line : params . line ,
153+ source : params . source ,
154+ } ;
155+ } else {
156+ throw new ProtocolError ( errors . missingSourceInformation ( ) ) ;
157+ }
142158 }
143159
144160 const location = await this . sourceContainer . preferredUiLocation ( {
0 commit comments