Skip to content

Commit b9750d0

Browse files
committed
DAP sources are case sensitive on insensitive filesystems
fixes microsoft#106382
1 parent aa2a14c commit b9750d0

26 files changed

Lines changed: 78 additions & 93 deletions

src/vs/workbench/contrib/debug/browser/breakpointsView.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
3737
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
3838
import { Orientation } from 'vs/base/browser/ui/splitview/splitview';
3939
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
40-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
4140

4241
const $ = dom.$;
4342

@@ -78,7 +77,6 @@ export class BreakpointsView extends ViewPane {
7877
@IOpenerService openerService: IOpenerService,
7978
@ITelemetryService telemetryService: ITelemetryService,
8079
@ILabelService private readonly labelService: ILabelService,
81-
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
8280
) {
8381
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
8482

@@ -135,7 +133,7 @@ export class BreakpointsView extends ViewPane {
135133
const element = this.list.element(e.element);
136134

137135
if (element instanceof Breakpoint) {
138-
openBreakpointSource(element, e.sideBySide, e.editorOptions.preserveFocus || false, this.debugService, this.editorService, this.uriIdentityService);
136+
openBreakpointSource(element, e.sideBySide, e.editorOptions.preserveFocus || false, this.debugService, this.editorService);
139137
}
140138
if (e.browserEvent instanceof MouseEvent && e.browserEvent.detail === 2 && element instanceof FunctionBreakpoint && element !== this.debugService.getViewModel().getSelectedFunctionBreakpoint()) {
141139
// double click
@@ -194,7 +192,7 @@ export class BreakpointsView extends ViewPane {
194192
if (element instanceof Breakpoint || element instanceof FunctionBreakpoint) {
195193
actions.push(new Action('workbench.action.debug.openEditorAndEditBreakpoint', nls.localize('editBreakpoint', "Edit {0}...", breakpointType), '', true, async () => {
196194
if (element instanceof Breakpoint) {
197-
const editor = await openBreakpointSource(element, false, false, this.debugService, this.editorService, this.uriIdentityService);
195+
const editor = await openBreakpointSource(element, false, false, this.debugService, this.editorService);
198196
if (editor) {
199197
const codeEditor = editor.getControl();
200198
if (isCodeEditor(codeEditor)) {
@@ -673,7 +671,7 @@ class BreakpointsAccessibilityProvider implements IListAccessibilityProvider<Bre
673671
}
674672
}
675673

676-
export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolean, preserveFocus: boolean, debugService: IDebugService, editorService: IEditorService, uriIdentityService: IUriIdentityService): Promise<IEditorPane | undefined> {
674+
export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolean, preserveFocus: boolean, debugService: IDebugService, editorService: IEditorService): Promise<IEditorPane | undefined> {
677675
if (breakpoint.uri.scheme === DEBUG_SCHEME && debugService.state === State.Inactive) {
678676
return Promise.resolve(undefined);
679677
}
@@ -691,7 +689,7 @@ export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolea
691689
};
692690

693691
return editorService.openEditor({
694-
resource: uriIdentityService.asCanonicalUri(breakpoint.uri),
692+
resource: breakpoint.uri,
695693
options: {
696694
preserveFocus,
697695
selection,

src/vs/workbench/contrib/debug/browser/callStackView.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import { posix } from 'vs/base/common/path';
4646
import { ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree';
4747
import { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree';
4848
import { ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel';
49-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
5049

5150
const $ = dom.$;
5251

@@ -138,8 +137,7 @@ export class CallStackView extends ViewPane {
138137
@IContextKeyService readonly contextKeyService: IContextKeyService,
139138
@IOpenerService openerService: IOpenerService,
140139
@IThemeService themeService: IThemeService,
141-
@ITelemetryService telemetryService: ITelemetryService,
142-
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
140+
@ITelemetryService telemetryService: ITelemetryService
143141
) {
144142
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
145143
this.callStackItemType = CONTEXT_CALLSTACK_ITEM_TYPE.bindTo(contextKeyService);
@@ -291,7 +289,7 @@ export class CallStackView extends ViewPane {
291289
const element = e.element;
292290
if (element instanceof StackFrame) {
293291
focusStackFrame(element, element.thread, element.thread.session);
294-
element.openInEditor(this.editorService, this.uriIdentityService, e.editorOptions.preserveFocus, e.sideBySide, e.editorOptions.pinned);
292+
element.openInEditor(this.editorService, e.editorOptions.preserveFocus, e.sideBySide, e.editorOptions.pinned);
295293
}
296294
if (element instanceof Thread) {
297295
focusStackFrame(undefined, element, element.session);

src/vs/workbench/contrib/debug/browser/debugActions.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
1414
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
1515
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
1616
import { deepClone } from 'vs/base/common/objects';
17-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
1817

1918
export abstract class AbstractDebugAction extends Action {
2019

@@ -370,8 +369,7 @@ export class FocusSessionAction extends AbstractDebugAction {
370369
constructor(id: string, label: string,
371370
@IDebugService debugService: IDebugService,
372371
@IKeybindingService keybindingService: IKeybindingService,
373-
@IEditorService private readonly editorService: IEditorService,
374-
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
372+
@IEditorService private readonly editorService: IEditorService
375373
) {
376374
super(id, label, '', debugService, keybindingService);
377375
}
@@ -380,7 +378,7 @@ export class FocusSessionAction extends AbstractDebugAction {
380378
await this.debugService.focusStackFrame(undefined, undefined, session, true);
381379
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
382380
if (stackFrame) {
383-
await stackFrame.openInEditor(this.editorService, this.uriIdentityService, true);
381+
await stackFrame.openInEditor(this.editorService, true);
384382
}
385383
}
386384
}

src/vs/workbench/contrib/debug/browser/debugCommands.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
2929
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
3030
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
3131
import { IViewsService } from 'vs/workbench/common/views';
32-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
3332

3433
export const ADD_CONFIGURATION_ID = 'debug.addConfiguration';
3534
export const TOGGLE_INLINE_BREAKPOINT_ID = 'editor.debug.action.toggleInlineBreakpoint';
@@ -565,7 +564,7 @@ export function registerCommands(): void {
565564
if (list instanceof List) {
566565
const focus = list.getFocusedElements();
567566
if (focus.length && focus[0] instanceof Breakpoint) {
568-
return openBreakpointSource(focus[0], true, false, accessor.get(IDebugService), accessor.get(IEditorService), accessor.get(IUriIdentityService));
567+
return openBreakpointSource(focus[0], true, false, accessor.get(IDebugService), accessor.get(IEditorService));
569568
}
570569
}
571570

src/vs/workbench/contrib/debug/browser/debugEditorActions.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { IViewsService } from 'vs/workbench/common/views';
1919
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
2020
import { Action } from 'vs/base/common/actions';
2121
import { getDomNodePagePosition } from 'vs/base/browser/dom';
22-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
2322

2423
export const TOGGLE_BREAKPOINT_ID = 'editor.debug.action.toggleBreakpoint';
2524
class ToggleBreakpointAction extends EditorAction {
@@ -306,7 +305,6 @@ class GoToBreakpointAction extends EditorAction {
306305
async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<any> {
307306
const debugService = accessor.get(IDebugService);
308307
const editorService = accessor.get(IEditorService);
309-
const uriIdentityService = accessor.get(IUriIdentityService);
310308
if (editor.hasModel()) {
311309
const currentUri = editor.getModel().uri;
312310
const currentLine = editor.getPosition().lineNumber;
@@ -333,7 +331,7 @@ class GoToBreakpointAction extends EditorAction {
333331
}
334332

335333
if (moveBreakpoint) {
336-
return openBreakpointSource(moveBreakpoint, false, true, debugService, editorService, uriIdentityService);
334+
return openBreakpointSource(moveBreakpoint, false, true, debugService, editorService);
337335
}
338336
}
339337
}

src/vs/workbench/contrib/debug/browser/debugService.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import { DebugTelemetry } from 'vs/workbench/contrib/debug/common/debugTelemetry
4848
import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot';
4949
import { ICommandService } from 'vs/platform/commands/common/commands';
5050
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
51-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
5251

5352
export class DebugService implements IDebugService {
5453
declare readonly _serviceBrand: undefined;
@@ -93,8 +92,7 @@ export class DebugService implements IDebugService {
9392
@IExtensionHostDebugService private readonly extensionHostDebugService: IExtensionHostDebugService,
9493
@IActivityService private readonly activityService: IActivityService,
9594
@ICommandService private readonly commandService: ICommandService,
96-
@IQuickInputService private readonly quickInputService: IQuickInputService,
97-
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
95+
@IQuickInputService private readonly quickInputService: IQuickInputService
9896
) {
9997
this.toDispose = [];
10098

@@ -792,7 +790,7 @@ export class DebugService implements IDebugService {
792790
const { stackFrame, thread, session } = getStackFrameThreadAndSessionToFocus(this.model, _stackFrame, _thread, _session);
793791

794792
if (stackFrame) {
795-
const editor = await stackFrame.openInEditor(this.editorService, this.uriIdentityService, true);
793+
const editor = await stackFrame.openInEditor(this.editorService, true);
796794
if (editor) {
797795
const control = editor.getControl();
798796
if (stackFrame && isCodeEditor(control) && control.hasModel()) {

src/vs/workbench/contrib/debug/browser/debugSession.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { localize } from 'vs/nls';
3737
import { canceled } from 'vs/base/common/errors';
3838
import { filterExceptionsFromTelemetry } from 'vs/workbench/contrib/debug/common/debugUtils';
3939
import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot';
40+
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
4041

4142
export class DebugSession implements IDebugSession {
4243

@@ -82,7 +83,8 @@ export class DebugSession implements IDebugSession {
8283
@IExtensionHostDebugService private readonly extensionHostDebugService: IExtensionHostDebugService,
8384
@IOpenerService private readonly openerService: IOpenerService,
8485
@INotificationService private readonly notificationService: INotificationService,
85-
@ILifecycleService lifecycleService: ILifecycleService
86+
@ILifecycleService lifecycleService: ILifecycleService,
87+
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
8688
) {
8789
this._options = options || {};
8890
if (this.hasSeparateRepl()) {
@@ -1026,12 +1028,12 @@ export class DebugSession implements IDebugSession {
10261028
//---- sources
10271029

10281030
getSourceForUri(uri: URI): Source | undefined {
1029-
return this.sources.get(this.getUriKey(uri));
1031+
return this.sources.get(this.uriIdentityService.asCanonicalUri(uri).toString());
10301032
}
10311033

10321034
getSource(raw?: DebugProtocol.Source): Source {
1033-
let source = new Source(raw, this.getId());
1034-
const uriKey = this.getUriKey(source.uri);
1035+
let source = new Source(raw, this.getId(), this.uriIdentityService);
1036+
const uriKey = source.uri.toString();
10351037
const found = this.sources.get(uriKey);
10361038
if (found) {
10371039
source = found;
@@ -1072,11 +1074,6 @@ export class DebugSession implements IDebugSession {
10721074
this.cancellationMap.clear();
10731075
}
10741076

1075-
private getUriKey(uri: URI): string {
1076-
// TODO: the following code does not make sense if uri originates from a different platform
1077-
return platform.isLinux ? uri.toString() : uri.toString().toLowerCase();
1078-
}
1079-
10801077
// REPL
10811078

10821079
getReplElements(): IReplElement[] {

src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
3939
import { IThemeService } from 'vs/platform/theme/common/themeService';
4040
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
4141
import { IPathService } from 'vs/workbench/services/path/common/pathService';
42-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
4342

4443
const NEW_STYLE_COMPRESS = true;
4544

@@ -432,8 +431,7 @@ export class LoadedScriptsView extends ViewPane {
432431
@IPathService private readonly pathService: IPathService,
433432
@IOpenerService openerService: IOpenerService,
434433
@IThemeService themeService: IThemeService,
435-
@ITelemetryService telemetryService: ITelemetryService,
436-
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
434+
@ITelemetryService telemetryService: ITelemetryService
437435
) {
438436
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
439437
this.loadedScriptsItemType = CONTEXT_LOADED_SCRIPTS_ITEM_TYPE.bindTo(contextKeyService);
@@ -500,7 +498,7 @@ export class LoadedScriptsView extends ViewPane {
500498
const source = e.element.getSource();
501499
if (source && source.available) {
502500
const nullRange = { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 };
503-
source.openInEditor(this.editorService, this.uriIdentityService, nullRange, e.editorOptions.preserveFocus, e.sideBySide, e.editorOptions.pinned);
501+
source.openInEditor(this.editorService, nullRange, e.editorOptions.preserveFocus, e.sideBySide, e.editorOptions.pinned);
504502
}
505503
}
506504
}));

src/vs/workbench/contrib/debug/browser/replViewer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { IReplElementSource, IDebugService, IExpression, IReplElement, IDebugCon
2323
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
2424
import { IThemeService } from 'vs/platform/theme/common/themeService';
2525
import { localize } from 'vs/nls';
26-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
2726

2827
const $ = dom.$;
2928

@@ -139,8 +138,7 @@ export class ReplSimpleElementsRenderer implements ITreeRenderer<SimpleReplEleme
139138
private readonly linkDetector: LinkDetector,
140139
@IEditorService private readonly editorService: IEditorService,
141140
@ILabelService private readonly labelService: ILabelService,
142-
@IThemeService private readonly themeService: IThemeService,
143-
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
141+
@IThemeService private readonly themeService: IThemeService
144142
) { }
145143

146144
get templateId(): string {
@@ -161,7 +159,7 @@ export class ReplSimpleElementsRenderer implements ITreeRenderer<SimpleReplEleme
161159
e.stopPropagation();
162160
const source = data.getReplElementSource();
163161
if (source) {
164-
source.source.openInEditor(this.editorService, this.uriIdentityService, {
162+
source.source.openInEditor(this.editorService, {
165163
startLineNumber: source.lineNumber,
166164
startColumn: source.column,
167165
endLineNumber: source.lineNumber,

src/vs/workbench/contrib/debug/common/debug.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
2525
import { CancellationToken } from 'vs/base/common/cancellation';
2626
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/api/common/extHostTypes';
2727
import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot';
28-
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
2928

3029
export const VIEWLET_ID = 'workbench.view.debug';
3130

@@ -348,7 +347,7 @@ export interface IStackFrame extends ITreeElement {
348347
forgetScopes(): void;
349348
restart(): Promise<any>;
350349
toString(): string;
351-
openInEditor(editorService: IEditorService, uriIdentityService: IUriIdentityService, preserveFocus?: boolean, sideBySide?: boolean): Promise<ITextEditorPane | undefined>;
350+
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean): Promise<ITextEditorPane | undefined>;
352351
equals(other: IStackFrame): boolean;
353352
}
354353

0 commit comments

Comments
 (0)