Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

createInterface indents a copied type by its source column

未關閉 適合新手
#9,135 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
74/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
ocaml
領域
compilers

研究方向

從 analysis/src/create_interface.ml 開始,特別查看 Source_file_extractor.extract 和 process_signature 中的 Sig_type 案例,issue 在此指出了複製文字和縮排處理。使用提供的 Make 範例重現問題,並檢查像 module M = {type t = int} 這樣的一行 module 是否也有相同問題。完成標準是產生的介面在輸出位置縮排複製的型別宣告;payload 沒有指定測試檔案。

由索引模型根據 Issue 內容生成。

描述

createInterface copies a type declaration from the source with the column it has there as its indentation, instead of the indentation of the place it is printed at.

module Make = (X: {type t}) => {
  type u = X.t
}

generates

module Make: (
  X: {
                   type t
  },
) =>
{
  type u = X.t
}

type t is at column 19 in the source. Source_file_extractor.extract (analysis/src/create_interface.ml) prefixes the first line of the copied text with col_start spaces, and the Sig_type case of process_signature adds that text without its indent. A type in a module written on one line, such as module M = {type t = int}, is likely affected the same way.

主要語言
OCaml
星號
7.5k
分支
484
平均合併
21 小時 9 分鐘
30 天內合併 PR
255

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

rescript-lang/rescript 的其他 Issue

查看 rescript-lang/rescript 的全部 Issue

相似的 Issue

更多 Compilers Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。