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(client-runtime): remove unused file position predicate (#9976)
Julius Marminge committed
Sep 5, 2026 at 00:09 UTC
044a6e168ad1eb213c2c7c277034e65c638cc937
2 files changed
-19
packages/client-runtime/src/markdownLinks.test.ts
-10
@@ -3,7 +3,6 @@ import { describe, expect, it } from "vite-plus/test";
3
import {
4
fileBasename,
5
inlineCodeFilePathCandidate,
6
- isConventionalFilePosition,
6
parseFileUrlHref,
7
parseMarkdownFileLink,
8
splitFilePathPosition,
@@ -28,15 +27,6 @@ describe("inlineCodeFilePathCandidate", () => {
27
});
28
});
29
31
-describe("isConventionalFilePosition", () => {
32
- it("distinguishes extensionless file locations from labels and ports", () => {
33
- expect(isConventionalFilePosition("Dockerfile:8:2")).toBe(true);
34
- expect(isConventionalFilePosition("Makefile")).toBe(false);
35
- expect(isConventionalFilePosition("TODO:12")).toBe(false);
36
- expect(isConventionalFilePosition("port:3000")).toBe(false);
37
- });
38
-});
39
-
30
describe("parseFileUrlHref", () => {
31
it.each([
32
["file:///Users/julius/project/src/main.ts#L42", "/Users/julius/project/src/main.ts", "#L42"],
packages/client-runtime/src/markdownLinks.ts
-9
@@ -15,7 +15,6 @@ const INLINE_CODE_DISQUALIFIER_PATTERN = /[\s`]/;
15
const PATH_SEPARATOR_PATTERN = /[\\/]/;
16
const FILE_EXTENSION_PATTERN = /\.[A-Za-z0-9_-]+$/;
17
const NUMERIC_DOTTED_PATTERN = /^\d+(?:\.\d+)+$/;
18
-const BARE_EXTENSIONLESS_POSITION_PATTERN = /^[A-Za-z0-9_-]+(?::\d+){1,2}$/;
18
// Standard OS and dev-container roots; deliberately excludes app-route-ish
19
// prefixes like /app/ or /chat/ so SPA routes never read as files.
20
const POSIX_FILE_ROOT_PREFIXES = [
@@ -152,14 +151,6 @@ function looksLikeHostname(segment: string, hasPosition: boolean): boolean {
151
return !hasPosition && COUNTRY_HOSTNAME_TLDS.has(lastLabel);
152
}
153
155
-/** Recognizes conventional extensionless filenames with an explicit line position. */
156
-export function isConventionalFilePosition(path: string): boolean {
157
- return (
158
- BARE_EXTENSIONLESS_POSITION_PATTERN.test(path) &&
159
- EXTENSIONLESS_FILE_NAMES.has(path.replace(POSITION_SUFFIX_PATTERN, ""))
160
- );
161
-}
162
-
154
/**
155
* Picks path-shaped inline code for the client's markdown file-link resolver.
156
* It does not resolve paths or turn plain prose and fenced code into links.