rescript-lang/rescript-vscode

Feature request: Code action to convert type to module

開放

#430 建立於 2022年5月27日

 (3 則留言) (2 個反應) (0 位負責人)ReScript (63 個分叉)github user discovery
enhancementgood first issuehelp wanted

倉庫指標

星標
 (350 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

It's pretty common in ReScript that you want to add some method to a type and thus want to restructure it into its own submodule.

E.g.

type readState = New | Unread | Read

to

module ReadState = {
  type t = New | Unread | Read
}

I am not sure though, if we should deliberately not allow this action on types named t (which are supposedly already in their own module).

貢獻者指南