Positions are UTF-8 byte offsets while positionEncoding says utf-16
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- ruby
- Área
- developer-experience, tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Ruby
- Estrellas
- 2k
- Forks
- 300
- Merge medio
- 2 h 54 min
- PR fusionados (30 d)
- 9
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Shopify/ruby-lsp
-
Bundler settings containing spaces are rewritten with colons when composing the bundlePosiblemente ocupada @efegokdemir la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Shopify/ruby-lsp#4275 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryPosiblemente ocupada @efegokdemir la tomó hace 44 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Linux file system with square brackets in the directory/filename are failing to be indexedPosiblemente ocupada @andriytyurnikov la tomó hace 249 días. Abiertobug help-wanted pinned
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Shopify/ruby-lsp#3503 · 9 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Composed bundle rewrites project binstubs when Bundler bin is setPosiblemente ocupada @efegokdemir la tomó hace 1 día. Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de Shopify/ruby-lsp
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
TarteelAI/quranic-universal-library#1111 ·
Los mantenedores suelen responder en 1 día
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandPosiblemente ocupada @k4kratik la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sachincool/cruft#4 ·
-
load_reserved() and store_conditional() call memory_model_acquire() before the memory accessAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
riscv/riscv-unified-db#2859 ·
Los mantenedores suelen responder en 2 días
-
agent-driven deployment documentation future releases nice to have
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
changesets
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
openstreetmap/openstreetmap-website#7629 · 1 comentario ·
Los mantenedores suelen responder en 1 día