@@ -184,6 +184,7 @@ protected override async Task<bool> AcceptCommand (MessageId id, string method,
184
184
}
185
185
186
186
var bpid = resp . Value [ "breakpointId" ] ? . ToString ( ) ;
187
+ var locations = resp . Value [ "locations" ] ? . Values < object > ( ) ;
187
188
var request = BreakpointRequest . Parse ( bpid , args ) ;
188
189
context . BreakpointRequests [ bpid ] = request ;
189
190
if ( await IsRuntimeAlreadyReadyAlready ( id , token ) ) {
@@ -193,7 +194,8 @@ protected override async Task<bool> AcceptCommand (MessageId id, string method,
193
194
await SetBreakpoint ( id , store , request , token ) ;
194
195
}
195
196
196
- SendResponse ( id , Result . OkFromObject ( request . AsSetBreakpointByUrlResponse ( ) ) , token ) ;
197
+ var result = Result . OkFromObject ( request . AsSetBreakpointByUrlResponse ( locations ) ) ;
198
+ SendResponse ( id , result , token ) ;
197
199
return true ;
198
200
}
199
201
@@ -765,17 +767,21 @@ async Task SetBreakpoint (SessionId sessionId, DebugStore store, BreakpointReque
765
767
return ;
766
768
}
767
769
768
- var locations = store . FindBreakpointLocations ( req ) . ToList ( ) ;
770
+ var comparer = new SourceLocation . LocationComparer ( ) ;
771
+ // if column is specified the frontend wants the exact matches
772
+ // and will clear the bp if it isn't close enoug
773
+ var locations = store . FindBreakpointLocations ( req )
774
+ . Distinct ( comparer )
775
+ . Where ( l => l . Line == req . Line && ( req . Column == 0 || l . Column == req . Column ) )
776
+ . OrderBy ( l => l . Column )
777
+ . GroupBy ( l => l . Id ) ;
778
+
769
779
logger . LogDebug ( "BP request for '{req}' runtime ready {context.RuntimeReady}" , req , GetContext ( sessionId ) . IsRuntimeReady ) ;
770
780
771
781
var breakpoints = new List < Breakpoint > ( ) ;
772
782
773
- // if column is specified the frontend wants the exact matches
774
- // and will clear the bp if it isn't close enough
775
- if ( req . Column != 0 )
776
- locations = locations . Where ( l => l . Column == req . Column ) . ToList ( ) ;
777
-
778
- foreach ( var loc in locations ) {
783
+ foreach ( var sourceId in locations ) {
784
+ var loc = sourceId . First ( ) ;
779
785
var bp = await SetMonoBreakpoint ( sessionId , req . Id , loc , token ) ;
780
786
781
787
// If we didn't successfully enable the breakpoint
0 commit comments