Quellcode durchsuchen

Fix breakpoints out of order and confusing VSCode (#217)

Francois Belair vor 5 Jahren
Ursprung
Commit
d3914bceaf
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      src/debugger/debug_session.ts

+ 2 - 0
src/debugger/debug_session.ts

@@ -302,6 +302,8 @@ export class GodotDebugSession extends LoggingDebugSession {
 			});
 
 			bps = this.debug_data.get_breakpoints(path);
+			// Sort to ensure breakpoints aren't out-of-order, which would confuse VS Code.
+			bps.sort((a, b) => (a.line < b.line ? -1 : 1));
 
 			response.body = {
 				breakpoints: bps.map((bp) => {