Create interface: doc comments are reindented, and `@deprecated` and doc comments on values are dropped
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, ocaml
- Bereich
- compilers
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- OCaml
- Sterne
- 7.5k
- Forks
- 484
- Ø Merge
- 16 Std. 57 Min.
- Gemergte PRs (30 T.)
- 258
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rescript-lang/rescript
-
Exception analysis does not know the Temporal `fromStringOrThrow` functionsEvtl. vergeben @cknitt hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
rescript-lang/rescript#9182 ·
Maintainer antworten meist innerhalb von 1 Tag
-
await in a functor body compiles to invalid JavaScriptEvtl. vergeben @mununki hat das heute übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
rescript-lang/rescript#9219 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`(() :> string)` compiles, and other coercions and variant spreads treat `bool` and `unit` as variantsEvtl. vergeben @mununki hat das heute übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
rescript-lang/rescript#9216 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A polymorphic variant argument of an external is evaluated twice, or inside a generated functionEvtl. vergeben @mununki hat das heute übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
rescript-lang/rescript#9215 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
rescript-lang/rescript#9212 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rescript-lang/rescript
Ähnliche Issues
-
bug stdlib
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
0.kind: enhancement 9.needs: package (update)
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
S3: friction & debt ws:tooling
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
MedakaLang/medaka#4865 ·
Maintainer antworten meist innerhalb von 1 Tag
-
subsystem: saw-core type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
GaloisInc/saw-script#3516 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug: the Atlas reports the five injected `$` helpers as unknown identifiers, including in the default scaffoldEvtl. vergeben @ShahadatTest hat das heute übernommen. Offenbug Compiler difficulty:easy good first issue help wanted Tooling
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Avenx-JS/avenx-js#1615 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag