Skip to content

Commit a670b0a

Browse files
authored
Fix suspected bug, replacing string with itself
The original code did a string.replace('|', '\|'), which is a no-op. I think it was meant to escape pipes, in which case, you need another slash in there. I did not test this, and have no idea of the context for this code.
1 parent d22fd6d commit a670b0a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/platform/markers/common/markers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ export namespace IMarkerData {
135135
export function makeKeyOptionalMessage(markerData: IMarkerData, useMessage: boolean): string {
136136
let result: string[] = [emptyString];
137137
if (markerData.source) {
138-
result.push(markerData.source.replace('¦', '\¦'));
138+
result.push(markerData.source.replace('¦', '\\¦'));
139139
} else {
140140
result.push(emptyString);
141141
}
142142
if (markerData.code) {
143143
if (typeof markerData.code === 'string') {
144-
result.push(markerData.code.replace('¦', '\¦'));
144+
result.push(markerData.code.replace('¦', '\\¦'));
145145
} else {
146-
result.push(markerData.code.value.replace('¦', '\¦'));
146+
result.push(markerData.code.value.replace('¦', '\\¦'));
147147
}
148148
} else {
149149
result.push(emptyString);
@@ -157,7 +157,7 @@ export namespace IMarkerData {
157157
// Modifed to not include the message as part of the marker key to work around
158158
// https://github.com/microsoft/vscode/issues/77475
159159
if (markerData.message && useMessage) {
160-
result.push(markerData.message.replace('¦', '\¦'));
160+
result.push(markerData.message.replace('¦', '\\¦'));
161161
} else {
162162
result.push(emptyString);
163163
}

0 commit comments

Comments
 (0)