Create interface: doc comments are reindented, and `@deprecated` and doc comments on values are dropped
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, ocaml
- Ambito
- compilers
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 484
- Merge medio
- 17h 2m
- PR unite (30g)
- 249
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rescript-lang/rescript
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rescript-lang/rescript#9182 ·
I maintainer di solito rispondono entro 1 giorno
-
Issues from differential semantic drift analysis (b123b7c3 to c10223e8)Forse già presa @cknitt l’ha presa oggi. Aperta
rescript-lang/rescript#9186 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
rescript-lang/rescript#9185 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
rescript-lang/rescript#9184 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
rescript-lang/rescript#9183 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rescript-lang/rescript
Issue simili
-
0.kind: enhancement 9.needs: package (update)
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Bug: the Atlas reports the five injected `$` helpers as unknown identifiers, including in the default scaffoldForse già presa @ShahadatTest l’ha presa oggi. Apertabug Compiler difficulty:easy good first issue help wanted Tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Avenx-JS/avenx-js#1615 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
respond_to? on a poly receiver answers true for a program class's private or protected methodAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
AeneasVerif/aeneas#1534 ·
I maintainer di solito rispondono entro 1 giorno