Positions are UTF-8 byte offsets while positionEncoding says utf-16
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/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ệ
- ruby
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Start from the InitializeResult where positionEncoding is advertised, then trace how textDocument/references, definition, hover and diagnostics convert character offsets; compare that path with the ranged didChange sync path that already handles UTF-16. Reproduce with the a.rb snippet and check the call site on line 5 at UTF-16 column 19 versus UTF-8 byte column 22. Done means those requests and diagnostics use UTF-16 code units, with regression tests covering non-ASCII text before a token.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: ruby-lsp 0.26.11, Ruby 4.0.3, Linux x86_64, a plain stdio LSP client (not VS Code).
What happens. The server's InitializeResult advertises positionEncoding: "utf-16", whether the
client offers general.positionEncodings: ["utf-16"] or no positionEncodings at all. On a line with
non-ASCII text before a token, the character it returns and reads is a UTF-8 byte offset, not a
UTF-16 code-unit offset.
Repro. a.rb:
class Foo
def self.helper
1
end
def self.run
s = "é😀"; Foo.helper
end
end
On line 5, helper starts at UTF-16 column 19 (UTF-8 byte 22, code point 18).
textDocument/referencesat the definition (line 1, character 11) returns the call site at
line 5, character 22.textDocument/definitionandtextDocument/hoverat line 5, character 20 (insidehelper
in UTF-16) return nothing. At character 23 (inside it in UTF-8 bytes), definition goes to line 1
and hover showshelper().- Diagnostics on such lines are also placed at byte offsets.
Expected. UTF-16 code units, as advertised, or advertising utf-8 when the client offers it.
Note. A whole-document ranged didChange whose end is computed in UTF-16 is applied
correctly, so the document sync path seems to convert; requests and responses don't.
Possibly related: #4180 (completion after Unicode in an interpolated string) and #4094 (RuboCop
quickfix with multi-byte characters).
- Ngôn ngữ chính
- Ruby
- Star
- 2k
- Fork
- 300
- Merge trung bình
- 2 giờ 54 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Shopify/ruby-lsp
-
Bundler settings containing spaces are rewritten with colons when composing the bundleCó thể đã có người làm @efegokdemir đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Shopify/ruby-lsp#4275 · 1 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryCó thể đã có người làm @efegokdemir đã nhận 44 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Linux file system with square brackets in the directory/filename are failing to be indexedCó thể đã có người làm @andriytyurnikov đã nhận 249 ngày trước. Đang mởbug help-wanted pinned
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Shopify/ruby-lsp#3503 · 9 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Composed bundle rewrites project binstubs when Bundler bin is setCó thể đã có người làm @efegokdemir đã nhận 1 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Shopify/ruby-lsp
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandCó thể đã có người làm @k4kratik đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sachincool/cruft#4 ·
-
load_reserved() and store_conditional() call memory_model_acquire() before the memory accessĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
riscv/riscv-unified-db#2859 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
agent-driven deployment documentation future releases nice to have
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
changesets
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openstreetmap/openstreetmap-website#7629 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày