Skip to content

Commit 783eaaa

Browse files
committed
feat: makes type checking more strict
1 parent a1b41a7 commit 783eaaa

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

.helix/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[editor]
2+
auto-format = false

server/src/server.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,19 +1445,19 @@ async function onMessage(msg: p.Message) {
14451445
// TODO: Support range for full, and add delta support
14461446
full: true,
14471447
},
1448-
inlayHintProvider: config.extensionConfiguration.inlayHints?.enable,
1449-
codeLensProvider: config.extensionConfiguration.codeLens
1450-
? {
1451-
workDoneProgress: false,
1452-
}
1453-
: undefined,
1454-
signatureHelpProvider: config.extensionConfiguration.signatureHelp
1455-
?.enabled
1456-
? {
1457-
triggerCharacters: ["("],
1458-
retriggerCharacters: ["=", ","],
1459-
}
1460-
: undefined,
1448+
inlayHintProvider:
1449+
config.extensionConfiguration.inlayHints?.enable || false,
1450+
...(config.extensionConfiguration.codeLens && {
1451+
codeLensProvider: {
1452+
workDoneProgress: false,
1453+
},
1454+
}),
1455+
...(config.extensionConfiguration.signatureHelp?.enabled && {
1456+
signatureHelpProvider: {
1457+
triggerCharacters: ["("],
1458+
retriggerCharacters: ["=", ","],
1459+
},
1460+
}),
14611461
},
14621462
};
14631463
let response: p.ResponseMessage = {

server/src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,9 @@ export let parseCompilerLogOutput = async (
969969
let diagnostic: p.Diagnostic = {
970970
severity: parsedDiagnostic.severity,
971971
tags: parsedDiagnostic.tag === undefined ? [] : [parsedDiagnostic.tag],
972-
code: parsedDiagnostic.code,
972+
...(parsedDiagnostic.code && {
973+
code: parsedDiagnostic.code,
974+
}),
973975
range,
974976
source: "ReScript",
975977
message,

server/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
23
"compilerOptions": {
34
"target": "es2019",
45
"lib": ["ES2019"],
@@ -8,6 +9,8 @@
89
"strict": true,
910
"outDir": "out",
1011
"rootDir": "src",
12+
"strictNullChecks": true,
13+
"exactOptionalPropertyTypes": true,
1114
"esModuleInterop": true
1215
},
1316
"include": ["src"],

0 commit comments

Comments
 (0)