rescript-lang / rescript-lang/rescript-vscode

Feature request: Code action to convert type to module

Open
#430 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
ReScript
Stars
354
Forks
63
Avg merge
11h 29m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing VSCode code-action entry points and their tests, since the issue names no files. Implement the requested conversion from a ReScript type to a module-wrapped type, and establish the expected behavior for types named t; done means the action produces the intended structure and its behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.