Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Lexer counts a leading tab as 4 columns in token spans; LSP rename then edits the wrong bytes

Đang mở
#1,343 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/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ệ
c
Lĩnh vực
compilers, devtools

Hướng nghiên cứu

Start at the lexer’s token span and column tracking, then follow how the LSP rename operation consumes those spans. Run or extend the rename tests for a tab-indented identifier and an identifier after a leading tab inside an f-string. Done means both renames produce programs with identical output and token positions use source byte offsets.

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

Mô tả

area:lint-tooling found-by:code-review kind:silent-wrong

Found by /code-review on PR #1331. The problem predates that PR, which extends it to f-strings.

At line start, the lexer counts a tab as 4 columns for indentation, and it records token columns in those units rather than in bytes. So the token spans that the LSP uses for rename, cursor lookup and semantic tokens are off by 3 per leading tab:

  • on tab-indented lines (pre-existing);
  • after #1331, for an identifier right after a leading tab inside an f-string's braces: print of f"{<TAB>count}".

A rename then rewrites the wrong bytes.

Done when

  • Token columns and lengths are byte offsets in the source (indentation width is tracked separately from the column), or the LSP converts them correctly.
  • Rename tests: renaming an identifier on a tab-indented line, and after a leading tab inside f"{...}", produces a program with identical output.
Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
3 giờ 58 phút
Pull request đã merge (30 ngày)
105

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 InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

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.