Create interface: doc comments are reindented, and `@deprecated` and doc comments on values are dropped
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
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, ocaml
- Área
- compilers
Línea de trabajo
The reindentation and dropped attributes both come from analysis/src/create_interface.ml: start at literal_lines, which marks only string and template tokens as verbatim, and at the Sig_value case, which prints values from their type. Check whether doc comments and the @deprecated attribute are carried through for let values the way they are for external. Done when a multi-line doc comment in a nested module keeps its original indentation in the generated .resi and let f keeps its doc and deprecation attribute.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Found by differential semantic drift analysis from b123b7c3 to c10223e8.
What is broken
-
Doc comments are reindented (since #9144). In a nested module, the lines of a multi-line doc comment after its first are shifted to the declaration's indentation:
module A = { module B = { /** Example: ```rescript let v: t = 1 ``` */ type t = int } }The generated
.resiindents```rescript,let v: t = 1and```by four spaces.rescript-tools docthen reads"Example:\n ```rescript\n let v: t = 1\n ```"from the.resiand"Example:\n```rescript\nlet v: t = 1\n```"from the.res: the fenced block becomes an indented code block. Relative indentation inside a doc comment also collapses (a line at column 0 inside a type at column 4 moves to column 4). #9144 copies lines inside string and template literals verbatim because reindenting them "would change its value"; a doc comment is the string payload of@res.doc.literal_linesmarks only string and template tokens as verbatim. -
@deprecatedand doc comments onletvalues are dropped (before this range as well). For/** Doc of f. */ @deprecated("use g") let f = x => x + 1 let g = x => x + 1the generated interface is
let f: int => intandlet g: int => int. A module callingDep.f(1)gets warning 3 without the.resiand none with it. Anexternalkeeps both attributes. #9096 covers type declarations; theSig_valuecase prints values from their type.
Possible cause (speculation only)
The reindentation added by #9144 protects string and template literals but not comments, although #9096 had already made doc comments part of the copied text.
🤖 Generated with Claude Code
- Lenguaje dominante
- OCaml
- Estrellas
- 7.5k
- Forks
- 484
- Merge medio
- 16 h 57 min
- PR fusionados (30 d)
- 258
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 rescript-lang/rescript
-
Exception analysis does not know the Temporal `fromStringOrThrow` functionsPosiblemente ocupada @cknitt la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rescript-lang/rescript#9182 ·
Los mantenedores suelen responder en 1 día
-
await in a functor body compiles to invalid JavaScriptPosiblemente ocupada @mununki la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
rescript-lang/rescript#9219 ·
Los mantenedores suelen responder en 1 día
-
`(() :> string)` compiles, and other coercions and variant spreads treat `bool` and `unit` as variantsPosiblemente ocupada @mununki la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rescript-lang/rescript#9216 ·
Los mantenedores suelen responder en 1 día
-
A polymorphic variant argument of an external is evaluated twice, or inside a generated functionPosiblemente ocupada @mununki la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
rescript-lang/rescript#9215 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
rescript-lang/rescript#9212 ·
Los mantenedores suelen responder en 1 día
Todos los issues de rescript-lang/rescript
Issues similares
-
C ABI signature lowering drops explicit function alignmentPosiblemente ocupada @cpunion la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug Fortran low priority OOP
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug stdlib
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
WebAssembly/spec#2321 · 2 comentarios ·
Los mantenedores suelen responder en 1 día