Skip to content

Commit f250ad8

Browse files
authored
Avoid redaction of modelId. (microsoft#252999)
1 parent 454208e commit f250ad8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vs/editor/common/textModelEditReason.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const EditReasons = {
9090
inlineChatApplyEdit(data: { modelId: string | undefined }) {
9191
return createEditReason({
9292
source: 'inlineChat.applyEdits',
93-
$modelId: data.modelId,
93+
$modelId: avoidRedaction(data.modelId),
9494
} as const);
9595
},
9696

@@ -115,3 +115,11 @@ export const EditReasons = {
115115

116116
type Values<T> = T[keyof T];
117117
type ITextModelEditReasonMetadata = Values<{ [TKey in keyof typeof EditReasons]: ReturnType<typeof EditReasons[TKey]>['metadataT'] }>;
118+
119+
function avoidRedaction(str: string | undefined): string | undefined {
120+
if (str === undefined) {
121+
return undefined;
122+
}
123+
// To avoid false-positive file path redaction.
124+
return str.replaceAll('/', '|');
125+
}

0 commit comments

Comments
 (0)