Skip to content

Commit 1a08cfa

Browse files
author
Bart Schuurmans
committed
Add rescript.settings.platformPath
1 parent 0b03e94 commit 1a08cfa

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ You'll find all ReScript specific settings under the scope `rescript.settings`.
106106
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
107107
| Prompt to Start Build | If there's no ReScript build running already in the opened project, the extension will prompt you and ask if you want to start a build automatically. You can turn off this automatic prompt via the setting `rescript.settings.askToStartBuild`. |
108108
| ReScript Binary Path | The extension will look for the existence of a `node_modules/.bin/rescript` file and use its directory as the `binaryPath`. If it does not find it at the project root (which is where the nearest `bsconfig.json` resides), it goes up folders in the filesystem recursively until it either finds it (often the case in monorepos) or hits the top level. To override this lookup process, the path can be configured explicitly using the setting `rescript.settings.binaryPath` |
109+
| ReScript Platform Path | The extension will look for the existence of a `node_modules/rescript` directory and use the subdirectory corresponding to the current platform as the `platformPath`. If it does not find it at the project root (which is where the nearest `bsconfig.json` resides), it goes up folders in the filesystem recursively until it either finds it (often the case in monorepos) or hits the top level. To override this lookup process, the path can be configured explicitly using the setting `rescript.settings.platformPath` |
109110
| Inlay Hints (experimental) | This allows an editor to place annotations inline with text to display type hints. Enable using `rescript.settings.inlayHints.enable: true` |
110111
| Code Lens (experimental) | This tells the editor to add code lenses to function definitions, showing its full type above the definition. Enable using `rescript.settings.codeLens: true` |
111112
| Autostarting the Code Analyzer | The Code Analyzer needs to be started manually by default. However, you can configure the extension to start the Code Analyzer automatically via the setting `rescript.settings.autoRunCodeAnalysis`. |
@@ -122,6 +123,9 @@ You'll find all ReScript specific settings under the scope `rescript.settings`.
122123
// Path to the directory where cross-platform ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project.
123124
"rescript.settings.binaryPath": null
124125

126+
// Path to the directory where platform-specific ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project.
127+
"rescript.settings.platformPath": null
128+
125129
// Enable (experimental) inlay hints.
126130
"rescript.settings.inlayHints.enable": true
127131

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@
162162
"type": ["string", "null"],
163163
"default": null,
164164
"description": "Path to the directory where cross-platform ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project."
165+
},
166+
"rescript.settings.platformPath": {
167+
"type": ["string", "null"],
168+
"default": null,
169+
"description": "Path to the directory where platform-specific ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project."
165170
}
166171
}
167172
},

server/src/server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface extensionConfiguration {
3333
};
3434
codeLens: boolean;
3535
binaryPath: string | null;
36+
platformPath: string | null;
3637
}
3738

3839
// All values here are temporary, and will be overridden as the server is
@@ -46,6 +47,7 @@ let extensionConfiguration: extensionConfiguration = {
4647
},
4748
codeLens: false,
4849
binaryPath: null,
50+
platformPath: null,
4951
};
5052
// Below here is some state that's not important exactly how long it lives.
5153
let hasPromptedAboutBuiltInFormatter = false;

0 commit comments

Comments
 (0)