Skip to content

Commit

Permalink
Merge pull request #141 from yefansky/master
Browse files Browse the repository at this point in the history
修复调试器在一些特殊目录结构中会找错同名文件的bug
  • Loading branch information
CppCXY authored Mar 21, 2024
2 parents 22d6105 + 39310c3 commit f9b5abe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/debugger/base/DebuggerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export abstract class DebuggerProvider implements vscode.DebugConfigurationProvi
while (parts.length >= 2) {
parts = parts.slice(1);
const matchFile = path.join("**", ...parts)
uris = await vscode.workspace.findFiles(matchFile, null, 1);
uris = await vscode.workspace.findFiles(matchFile, null, 10);
if (uris.length !== 0) {
break;
}
Expand All @@ -101,6 +101,10 @@ export abstract class DebuggerProvider implements vscode.DebugConfigurationProvi
break;
}
}

if (results.length !== 0) {
results = results.sort((a, b) => a.length - b.length)
}

e.session.customRequest('findFileRsp', { files: results, seq: seq });
}
Expand Down

0 comments on commit f9b5abe

Please sign in to comment.