浏览代码

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

Francois Belair 5 年之前
父节点
当前提交
d3914bceaf
共有 1 个文件被更改,包括 2 次插入0 次删除
  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) => {