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).

贡献者指南