rescript-lang/rescript-vscode

Feature request: Code action to convert type to module

Aperta

#430 aperta il 27 mag 2022

 (3 commenti) (2 reazioni) (0 assegnatari)ReScript (63 fork)github user discovery
enhancementgood first issuehelp wanted

Metriche repository

Star
 (350 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor