From 6271064160cbfb84890743c25e314a4d2940b697 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Thu, 12 May 2022 18:24:52 +0200 Subject: [PATCH 1/3] update readme with all commands we have, and how to setup file nesting in VSCode --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 0535413a4..05d3ca7b3 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,22 @@ The plugin activates on `.res` and `.resi` files. If you've already got Reason-L - `try`, `for`, etc. - Folding, and [custom folding](https://code.visualstudio.com/docs/editor/codebasics#_folding) through `//#region` and `//#endregion`. +### Commands + +#### `> ReScript: Create an interface file for this implementation file.` + +Creates an interface file (`.resi`) for the current `.res` file, automatically filling in all types and values in the current file. + +#### `> Open the compiled JS file for this implementation file.` + +Opens the compiled JS file for the current `.res` file. + +#### `> ReScript: Switch implementation/interface` + +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. + +> This can also be triggered with the keybinding `Alt+O`. + ### Experimental Features #### Dead Code Analysis mode @@ -69,6 +85,21 @@ When done, stop the dead code analysis mode by clicking the `Stop Dead Code Anal Currently does not work for full monorepo dead code analysis (although it should work for each monorepo package individually). +## Configuration + +### Hide generated files + +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. + +Open your VSCode settings and type `editor.filenesting`. Enable the feature and scroll down to patterns. + +The example has two patterns added: +[insert screenshot] + +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. A screenshot of the result: + +[insert screenshot] + ## Use with Other Editors 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. From 5fed028e686b7589d939954a69f2b34faf925fc4 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Thu, 12 May 2022 18:32:17 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 05d3ca7b3..a4a8416cd 100644 --- a/README.md +++ b/README.md @@ -94,11 +94,14 @@ You can configure VSCode to collapse the JavaScript files ReScript generates und Open your VSCode settings and type `editor.filenesting`. Enable the feature and scroll down to patterns. The example has two patterns added: -[insert screenshot] -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. A screenshot of the result: +![Shows configuration of file nesting patterns in VSCode.](https://user-images.githubusercontent.com/1457626/168123605-43ef53cf-f371-4f38-b488-d3cd081879de.png) -[insert screenshot] +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. + +A screenshot of the result: + +![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) ## Use with Other Editors From c8d96edc97bc9f80e8522f71a5582e854b5f15e6 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Thu, 12 May 2022 19:51:37 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4a8416cd..fb8cec089 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Creates an interface file (`.resi`) for the current `.res` file, automatically f #### `> Open the compiled JS file for this implementation file.` -Opens the compiled JS file for the current `.res` file. +Opens the compiled JS file for the current ReScript file. #### `> ReScript: Switch implementation/interface`