Skip to content

Commit

Permalink
Normalize drive letter casing for global eval contexts
Browse files Browse the repository at this point in the history
Fixes #5237
  • Loading branch information
DanTup committed Sep 2, 2024
1 parent 6641097 commit b1da25e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as vs from "vscode";
import { forceWindowsDriveLetterToUppercaseInUriString } from "../../shared/utils/fs";
import { getActiveRealFileEditor, isDartDocument } from "../editors";

export class DartDebugAdapterGlobalEvaluationContextFactory implements vs.DebugAdapterTrackerFactory {
Expand All @@ -13,8 +14,10 @@ class DartDebugAdapterGlobalEvaluationContext implements vs.DebugAdapterTracker
const doc = getActiveRealFileEditor()?.document;
if (doc && isDartDocument(doc)) {
// Don't escape colons in drive letters, as the shipped DAP code here
// will call `lookupPackageUris` on this URI and it won't match.
message.arguments.context = doc?.uri.toString(true);
// will call `lookupPackageUris` on this URI and it won't match. Also normalize
// the drive letter because otherwise it might not work for Windows -> Android
// (see https://github.com/Dart-Code/Dart-Code/issues/5237).
message.arguments.context = forceWindowsDriveLetterToUppercaseInUriString(doc.uri.toString(true));
}
}
}
Expand Down

0 comments on commit b1da25e

Please sign in to comment.