The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 10:15 UTC
refactor(shared): remove unused mention path serializer (#9990)
Julius Marminge committed
Sep 5, 2026 at 00:18 UTC
c6410d37d7ff1bdb65b38f0e9c30da392a4de804
2 files changed
+1
-24
packages/shared/src/composerTrigger.test.ts
+1
-15
@@ -1,20 +1,6 @@
1
import { describe, expect, it } from "vite-plus/test";
2
3
-import { serializeComposerFileLink, serializeComposerMentionPath } from "./composerTrigger.ts";
4
-
5
-describe("serializeComposerMentionPath", () => {
6
- it("keeps simple mention paths unquoted", () => {
7
- expect(serializeComposerMentionPath("src/index.ts")).toBe("src/index.ts");
8
- });
9
-
10
- it("quotes mention paths containing whitespace", () => {
11
- expect(serializeComposerMentionPath("docs/My File.md")).toBe('"docs/My File.md"');
12
- });
13
-
14
- it("escapes quoted mention path content", () => {
15
- expect(serializeComposerMentionPath('docs/My "File".md')).toBe('"docs/My \\"File\\".md"');
16
- });
17
-});
3
+import { serializeComposerFileLink } from "./composerTrigger.ts";
4
5
describe("serializeComposerFileLink", () => {
6
it("uses the basename as the markdown label", () => {
packages/shared/src/composerTrigger.ts
-9
@@ -8,15 +8,6 @@ export interface ComposerTrigger {
8
rangeEnd: number;
9
}
10
11
-const SIMPLE_MENTION_PATH_REGEX = /^[^\s@"\\]+$/;
12
-
13
-export function serializeComposerMentionPath(path: string): string {
14
- if (SIMPLE_MENTION_PATH_REGEX.test(path)) {
15
- return path;
16
- }
17
- return `"${path.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
18
-}
19
-
11
function composerFileLinkBasename(path: string): string {
12
const separatorIndex = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
13
return separatorIndex >= 0 ? path.slice(separatorIndex + 1) : path;