rescript-lang / rescript-lang/rescript-vscode

Consider using root rescript.json if nearest one does not have a setting.

Open
#1,072 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
ReScript
Stars
354
Forks
63
Avg merge
11h 29m
Merged PRs (30d)
1

Description

If I have a monorepo:

.
├── common
│   ├── src
│   └── rescript.json
├── app
│   ├── src
│   └── rescript.json
└── rescript.json

and, in the root rescript.json, I set the suffix to something that is not the default, e.g.

{
  "package-specs": [
    {
      "module": "esmodule",
      "in-source": true,
      "suffix": ".res.mjs"
    }
  ],
}

the suffix resolution for opening the compiled JS file in both the common and app subprojects does not work, since the default is .js. One would need to add the suffix in the subproject's rescript.json as well.

The order of evaluation should be
local > root > default fallback

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 tracing the suffix resolution used when opening compiled JavaScript files in the common and app subprojects. Check how local and root rescript.json files are discovered, then verify that local settings take precedence over root settings and that defaults are used only when neither defines the setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.