File links with a line range (file.py:67-69) are either not linked or open a missing file

Đang mở Phù hợp với người mới
#28,555 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu từ packages/shared/src/markdownLinks.ts tại inlineCodeFilePathCandidate, nơi các kiểm tra đường dẫn tương đối từ chối :67-69, sau đó đọc splitFilePathPosition và mẫu của nó trong packages/shared/src/fileLinks.ts, mẫu này không loại bỏ phạm vi đối với đường dẫn tuyệt đối. Mở rộng cả hai mẫu hậu tố vị trí để chấp nhận :N-M và mở tại dòng N. Hoàn thành khi các liên kết path:1-3 hoạt động với đường dẫn tương đối và tuyệt đối và mở đúng tệp, thay vì một tệp không tồn tại có tên chứa phạm vi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

via-triage
What happened

Agents often write line ranges. In v0.1.5 a range never opens the file:

  • src/foo.py:67-69 and foo.py:1-3 (relative): rendered as plain code, no link.
  • /abs/path/foo.py:67-69 (absolute): rendered as a file link, but the click targets a file literally named foo.py:67-69, which does not exist.
Diagnosis

Confirmed by a click in the desktop app (v0.1.5): an absolute <root>/pyproject.toml:1-3 link opens the panel with "The file could not be accessed or read", attempted path <root>/pyproject.toml:1-3. Source:

  • inlineCodeFilePathCandidate (packages/shared/src/markdownLinks.ts:173): POSITION_SUFFIX_PATTERN /:\d+(?::\d+)?$/ does not match :67-69, so a relative candidate without / returns null (line 179), and with / its basename foo.py:67-69 fails FILE_EXTENSION_PATTERN (line 198).
  • Absolute paths skip those checks; splitFilePathPosition (packages/shared/src/fileLinks.ts:37, pattern line 8) does not strip :67-69, so the range stays in the path.
Steps to reproduce
  1. Message containing `<absolute path of an existing file>:1-3`.
  2. Click it: panel says "The file could not be accessed or read", attempted path ends in :1-3.
  3. A relative `<dir>/file.py:1-3` renders as plain code (from source; not clicked).
Version

0.1.5 (desktop, t3code-bin). Link code unchanged on main as of 2026-11-01. Triage CLI: 0.1.6.

Environment

Linux x64 (Arch, Hyprland), desktop app against local server, Claude provider.

Evidence
Click result above (screenshot available). Shipped bundle (app.asar, version 0.1.5) has only `/:(\d+)(?::(\d+))?$/` as its position parser (fileLinks-*.js). An agent emitted an absolute `locomo.py:67-69` link in practice.
Related issues

Companion to the issue about relative links in worktrees (filed alongside).

Fix applied or workaround

Local Stop hook rejects ranges and asks for :N. Suggested fix: accept :N-M in POSITION_SUFFIX_PATTERN and POSITION_SUFFIX_CAPTURE_PATTERN (open at N, optionally highlight to M).

Filed by

Claude Opus 5.5 (claude-opus-5-5) via Claude Code, t3 triage.

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
13 giờ 49 phút
Pull request đã merge (30 ngày)
179

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.