Offset encoding in LSIF dumps
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- devtools
Línea de trabajo
No se nombran archivos, pruebas ni puntos de entrada. Empieza leyendo el formato LSIF y las definiciones de metadatos; después, compara las tres opciones de codificación descritas aquí. El trabajo estaría terminado con un modelo de codificación decidido y los cambios correspondientes en el formato, pero este issue registra una discusión sin resolver en lugar de una tarea de implementación delimitada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The LSP defines that character offsets in lines (e.g. the character property in Positions) is an index into a string encoded using uft-16. Strings are encoded in memory using utf-16 in programming languages like Java, JavaScript and .Net. However newer languages use utf-8 as the encoding for strings in memory. This causes some friction in the LSP mainly because:
- implementors of clients and servers are not aware of this
- there is no way right now to detect that the client and server are using a different encoding.
There is a push in LSP right now to improve this (no concrete action has been decided yet) but we should try to avoid the same problem in LSIF. So I would like to discuss possible options:
- we pick one encoding that is supported in LSIF. This doesn't have to be utf-16. However to my knowledge there is no best pick. utf-32 would be great since it is a fixed encoding, but almost no programming language have support for it. So it requires conversion on all sides. utf-16 is bad for new programming lanaguges utf-8 for more traditional languages. Byte offsets would need to be defined on an encoding as well since we render characters in the UI not bytes. So no actual benefit.
- we allow to create dumps with different encodings and store the choosen encoding in the meta data. This means that someone will need to convert if client and server don't speak the same encoding. The tendency in LSP is currently to make servers do the conversion since they usually have access to the files. A web interface for example would have a hard time doing the conversion for example for a find all reference result since it would need to fetch the content of all files mentioned in the references result. Note that this also requires that the file content is part of the dump.
- we allow to store ranges with n encodings (pratically utf-8 and utf-16). This doesn't mean that every range is duplicated since as long as all characters on the line before the character offest are smaller than ASCII 127 the offsets are the same. So we could attach the converted ranges somehow to the orginial range.
I tend to go with a combination of 2. and 3. We store the ecodings with the dump. The first encoding is the primary encoding the ranges are in. All other encodings are scondary and the value can be reach from the primary range using an edge like utf-8 or utf-16
- Lenguaje dominante
- TypeScript
- Estrellas
- 198
- Forks
- 40
- Merge medio
- 3 d 7 h
- PR fusionados (30 d)
- 1
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 microsoft/lsif-node
-
feature-request
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Missing support for es2022 Abiertofeature-request
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
InlayHint for LSIF Abiertofeature-request
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
-
Early exit from LSIF tooling Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
feature-request
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Todos los issues de microsoft/lsif-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
bcgov/bc-wallet-mobile#4761 · 1 comentario ·
-
external-issue to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
area-deployment area-integrations triage:bot-seen
Dificultad 2/5 Medio día Aptitud para principiantes 86/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100