Create interface: doc comments are reindented, and `@deprecated` and doc comments on values are dropped
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, ocaml
- 领域
- compilers
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- OCaml
- 星标
- 7.5k
- 派生
- 484
- 平均合并
- 17 小时 2 分钟
- 30 天内合并 PR
- 249
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rescript-lang/rescript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
rescript-lang/rescript#9182 ·
维护者通常 1 天内回复
-
Issues from differential semantic drift analysis (b123b7c3 to c10223e8)可能已有人在做 @cknitt 于 1 天前认领。 未关闭
rescript-lang/rescript#9186 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 38/100
rescript-lang/rescript#9185 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 28/100
rescript-lang/rescript#9184 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
rescript-lang/rescript#9183 ·
维护者通常 1 天内回复
查看 rescript-lang/rescript 的全部 Issue
相似的 Issue
-
0.kind: enhancement 9.needs: package (update)
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
S3: friction & debt ws:tooling
难度 2/5 1-3 小时 新手友好度 82/100
MedakaLang/medaka#4865 ·
维护者通常 1 天内回复
-
Bug: the Atlas reports the five injected `$` helpers as unknown identifiers, including in the default scaffold可能已有人在做 @ShahadatTest 今天认领。 未关闭bug Compiler difficulty:easy good first issue help wanted Tooling
难度 2/5 1-3 小时 新手友好度 82/100
Avenx-JS/avenx-js#1615 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
x/arch/x86/x86asm: disp16/disp32 memory displacements are not sign-extended可能已有人在做 @mhr3 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复