Skip to content

Commit 1cfb50f

Browse files
committed
enable project cache config by default
1 parent 5dc5e60 commit 1cfb50f

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@
192192
"default": false,
193193
"description": "(debug) Enable debug logging (ends up in the extension output)."
194194
},
195-
"rescript.settings.cache.projectConfig.enabled": {
195+
"rescript.settings.cache.projectConfig.enable": {
196196
"type": "boolean",
197-
"default": false,
198-
"description": "(beta/experimental) Enable project config caching. Can speed up latency dramatically."
197+
"default": true,
198+
"description": "Enable project config caching. Can speed up latency dramatically."
199199
},
200200
"rescript.settings.binaryPath": {
201201
"type": [

server/src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface extensionConfiguration {
2323
};
2424
cache?: {
2525
projectConfig?: {
26-
enabled?: boolean;
26+
enable?: boolean;
2727
};
2828
};
2929
}
@@ -52,7 +52,7 @@ let config: { extensionConfiguration: extensionConfiguration } = {
5252
},
5353
cache: {
5454
projectConfig: {
55-
enabled: false,
55+
enable: true,
5656
},
5757
},
5858
},

server/src/server.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,7 @@ let compilerLogsWatcher = chokidar
218218
})
219219
.on("all", (_e, changedPath) => {
220220
if (changedPath.includes("build.ninja")) {
221-
if (
222-
config.extensionConfiguration.cache?.projectConfig?.enabled === true
223-
) {
221+
if (config.extensionConfiguration.cache?.projectConfig?.enable === true) {
224222
let projectRoot = utils.findProjectRootOfFile(changedPath);
225223
if (projectRoot != null) {
226224
syncProjectConfigCache(projectRoot);
@@ -284,9 +282,7 @@ let openedFile = (fileUri: string, fileContent: string) => {
284282
compilerLogsWatcher.add(
285283
path.join(projectRootPath, c.compilerLogPartialPath)
286284
);
287-
if (
288-
config.extensionConfiguration.cache?.projectConfig?.enabled === true
289-
) {
285+
if (config.extensionConfiguration.cache?.projectConfig?.enable === true) {
290286
compilerLogsWatcher.add(
291287
path.join(projectRootPath, c.buildNinjaPartialPath)
292288
);

server/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export let runAnalysisAfterSanityCheck = (
228228
? "true"
229229
: undefined,
230230
RESCRIPT_PROJECT_CONFIG_CACHE:
231-
config.extensionConfiguration.cache?.projectConfig?.enabled === true
231+
config.extensionConfiguration.cache?.projectConfig?.enable === true
232232
? "true"
233233
: undefined,
234234
},

0 commit comments

Comments
 (0)