Positions are UTF-8 byte offsets while positionEncoding says utf-16
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ruby
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Ruby
- スター
- 2k
- フォーク
- 300
- 平均マージ
- 2時間 54分
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/ruby-lsp のほかの issue
-
Bundler settings containing spaces are rewritten with colons when composing the bundle対応中かも @efegokdemir が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Shopify/ruby-lsp#4275 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memory対応中かも @efegokdemir が 44 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
Linux file system with square brackets in the directory/filename are failing to be indexed対応中かも @andriytyurnikov が 249 日前に担当しました。 オープンbug help-wanted pinned
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Shopify/ruby-lsp#3503 · コメント 9 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Composed bundle rewrites project binstubs when Bundler bin is set対応中かも @efegokdemir が 1 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
Shopify/ruby-lsp の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TarteelAI/quranic-universal-library#1111 ·
メンテナーはふだん 1 日以内に返信
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every command対応中かも @k4kratik が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sachincool/cruft#4 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
riscv/riscv-unified-db#2859 ·
メンテナーはふだん 2 日以内に返信
-
agent-driven deployment documentation future releases nice to have
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
changesets
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openstreetmap/openstreetmap-website#7629 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信