Skip to content

Commit fcf19ae

Browse files
committed
fix(demo/ctx): scope JSONC comment replacement to // CTX: prefix to preserve user comments
Made-with: Cursor
1 parent 1e80ec6 commit fcf19ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/ctx/src/jsonc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ export function injectJsoncComments(filePath: string, comments: Record<string, s
5353
if (keyMatch) {
5454
const indent = keyMatch[1];
5555
const key = keyMatch[2];
56-
if (result.length > 0 && result[result.length - 1].trimStart().startsWith("//")) {
56+
if (result.length > 0 && result[result.length - 1].trimStart().startsWith("// CTX:")) {
5757
result.pop();
5858
}
59-
if (comments[key]) result.push(`${indent}// ${comments[key]}`);
59+
if (comments[key]) result.push(`${indent}// CTX: ${comments[key]}`);
6060
}
6161
result.push(line);
6262
}

0 commit comments

Comments
 (0)