Positions are UTF-8 byte offsets while positionEncoding says utf-16
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- ruby
- Domínio
- developer-experience, tooling
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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).
- Linguagem predominante
- Ruby
- Estrelas
- 2k
- Forks
- 300
- Merge médio
- 2h 54min
- PRs com merge (30d)
- 9
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Shopify/ruby-lsp
-
Bundler settings containing spaces are rewritten with colons when composing the bundleTalvez já em andamento @efegokdemir assumiu há 5 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Shopify/ruby-lsp#4275 · 1 comentário · 3 reações ·
Mantenedores costumam responder em até 1 dia
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryTalvez já em andamento @efegokdemir assumiu há 44 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Linux file system with square brackets in the directory/filename are failing to be indexedTalvez já em andamento @andriytyurnikov assumiu há 249 dias. Abertabug help-wanted pinned
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Shopify/ruby-lsp#3503 · 9 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Composed bundle rewrites project binstubs when Bundler bin is setTalvez já em andamento @efegokdemir assumiu há 1 dia. Abertabug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
Mantenedores costumam responder em até 1 dia
Todas as issues de Shopify/ruby-lsp
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
TarteelAI/quranic-universal-library#1111 ·
Mantenedores costumam responder em até 1 dia
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandTalvez já em andamento @k4kratik assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
sachincool/cruft#4 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
riscv/riscv-unified-db#2859 ·
Mantenedores costumam responder em até 2 dias
-
agent-driven deployment documentation future releases nice to have
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
changesets
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
openstreetmap/openstreetmap-website#7629 · 1 comentário ·
Mantenedores costumam responder em até 1 dia