Skip to content

Commit 48bb784

Browse files
felixlagaclaude
andauthored
fix(shared): inline code like allocator.cc:217 becomes a file chip (pingdotgg#32403)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 7f7bf26 commit 48bb784

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/shared/src/markdownLinks.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe("inlineCodeFilePathCandidate", () => {
2424
// regression: #13909 model ids in inline code do not become file chips
2525
it.each([
2626
["src\\main.ts", "src/main.ts"],
27+
["allocator.cc:217", "allocator.cc:217"],
2728
["origin/main", null],
2829
["z-ai/glm-5.3", null],
2930
["share/man/ls.1", "share/man/ls.1"],

‎packages/shared/src/markdownLinks.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ const GENERIC_HOSTNAME_TLDS = new Set([
116116
"xyz",
117117
"me",
118118
"tv",
119-
"cc",
120119
"gg",
121120
"chat",
122121
"cloud",
@@ -159,6 +158,8 @@ const COUNTRY_HOSTNAME_TLDS = new Set([
159158
"tr",
160159
"sg",
161160
"hk",
161+
// C++ sources end in `.cc`, so `allocator.cc:217` names a file, not a host and port.
162+
"cc",
162163
]);
163164

164165
function looksLikeHostname(segment: string, hasPosition: boolean): boolean {

0 commit comments

Comments
 (0)