Skip to content

Commit a643c39

Browse files
authored
Merge pull request #419 from rescript-lang/update-readme
Update Readme
2 parents 4163ad2 + c8d96ed commit a643c39

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ The plugin activates on `.res` and `.resi` files. If you've already got Reason-L
4949
- `try`, `for`, etc.
5050
- Folding, and [custom folding](https://code.visualstudio.com/docs/editor/codebasics#_folding) through `//#region` and `//#endregion`.
5151

52+
### Commands
53+
54+
#### `> ReScript: Create an interface file for this implementation file.`
55+
56+
Creates an interface file (`.resi`) for the current `.res` file, automatically filling in all types and values in the current file.
57+
58+
#### `> Open the compiled JS file for this implementation file.`
59+
60+
Opens the compiled JS file for the current ReScript file.
61+
62+
#### `> ReScript: Switch implementation/interface`
63+
64+
Switches between the implementation and interface file. If you're in a `.res` file, the command will open the corresponding `.resi` file (if it exists), and if you're in a `.resi` file the command will open the corresponding `.res` file.
65+
66+
> This can also be triggered with the keybinding `Alt+O`.
67+
5268
### Experimental Features
5369

5470
#### Dead Code Analysis mode
@@ -69,6 +85,24 @@ When done, stop the dead code analysis mode by clicking the `Stop Dead Code Anal
6985

7086
Currently does not work for full monorepo dead code analysis (although it should work for each monorepo package individually).
7187

88+
## Configuration
89+
90+
### Hide generated files
91+
92+
You can configure VSCode to collapse the JavaScript files ReScript generates under its source ReScript file. This will "hide" the generated files in the VSCode file explorer, but still leaving them accessible by expanding the source ReScript file they belong to.
93+
94+
Open your VSCode settings and type `editor.filenesting`. Enable the feature and scroll down to patterns.
95+
96+
The example has two patterns added:
97+
98+
![Shows configuration of file nesting patterns in VSCode.](https://user-images.githubusercontent.com/1457626/168123605-43ef53cf-f371-4f38-b488-d3cd081879de.png)
99+
100+
This nests implementations under interfaces if they're present and nests all generated files under the main ReScript file. Adapt and tweak to your liking.
101+
102+
A screenshot of the result:
103+
104+
![Shows the end result in VSCode, with ReScript related files nested under eachother appropriately.](https://user-images.githubusercontent.com/1457626/168123647-400e2f09-31e3-45a2-b74b-190c7c207446.png)
105+
72106
## Use with Other Editors
73107

74108
This repo also contains a language server that can power other editors. **However, the language server in this project is a pure implementation detail. We don't guarantee its stability for other editors' consumption** apart from Vim and Sublime Text.

0 commit comments

Comments
 (0)