Skip to content

Commit f708453

Browse files
editor/code: Enable noPropertyAccessFromIndexSignature ts option
1 parent 72a3883 commit f708453

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

editors/code/src/bootstrap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function getServer(
3636
config: Config,
3737
state: PersistentState
3838
): Promise<string | undefined> {
39-
const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
39+
const explicitPath = process.env["__RA_LSP_SERVER_DEBUG"] ?? config.serverPath;
4040
if (explicitPath) {
4141
if (explicitPath.startsWith("~/")) {
4242
return os.homedir() + explicitPath.slice("~".length);

editors/code/src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export function substituteVariablesInEnv(env: Env): Env {
339339
const depRe = new RegExp(/\${(?<depName>.+?)}/g);
340340
let match = undefined;
341341
while ((match = depRe.exec(value))) {
342-
const depName = unwrapUndefinable(match.groups?.depName);
342+
const depName = unwrapUndefinable(match.groups?.["depName"]);
343343
deps.add(depName);
344344
// `depName` at this point can have a form of `expression` or
345345
// `prefix:expression`
@@ -448,7 +448,7 @@ function computeVscodeVar(varName: string): string | null {
448448
// https://github.com/microsoft/vscode/blob/08ac1bb67ca2459496b272d8f4a908757f24f56f/src/vs/workbench/api/common/extHostVariableResolverService.ts#L81
449449
// or
450450
// https://github.com/microsoft/vscode/blob/29eb316bb9f154b7870eb5204ec7f2e7cf649bec/src/vs/server/node/remoteTerminalChannel.ts#L56
451-
execPath: () => process.env.VSCODE_EXEC_PATH ?? process.execPath,
451+
execPath: () => process.env["VSCODE_EXEC_PATH"] ?? process.execPath,
452452

453453
pathSeparator: () => path.sep,
454454
};

editors/code/src/debug.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ async function getDebugConfiguration(
147147
debugConfig.name = `run ${path.basename(executable)}`;
148148
}
149149

150-
if (debugConfig.cwd) {
151-
debugConfig.cwd = simplifyPath(debugConfig.cwd);
150+
const cwd = debugConfig["cwd"];
151+
if (cwd) {
152+
debugConfig["cwd"] = simplifyPath(cwd);
152153
}
153154

154155
return debugConfig;

editors/code/src/toolchain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export const getPathForExecutable = memoizeAsync(
176176
);
177177

178178
async function lookupInPath(exec: string): Promise<boolean> {
179-
const paths = process.env.PATH ?? "";
179+
const paths = process.env["PATH"] ?? "";
180180

181181
const candidates = paths.split(path.delimiter).flatMap((dirInPath) => {
182182
const candidate = path.join(dirInPath, exec);

editors/code/tests/unit/settings.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function getTests(ctx: Context) {
5757
USING_VSCODE_VAR: "${workspaceFolderBasename}",
5858
};
5959
const actualEnv = await substituteVariablesInEnv(envJson);
60-
assert.deepStrictEqual(actualEnv.USING_VSCODE_VAR, "code");
60+
assert.deepStrictEqual(actualEnv["USING_VSCODE_VAR"], "code");
6161
});
6262
});
6363
}

editors/code/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
// These disables some enhancement type checking options
1414
// to update typescript version without any code change.
1515
"useUnknownInCatchVariables": false,
16-
"exactOptionalPropertyTypes": false,
17-
"noPropertyAccessFromIndexSignature": false
16+
"exactOptionalPropertyTypes": false
1817
},
1918
"exclude": ["node_modules", ".vscode-test"],
2019
"include": ["src", "tests"]

0 commit comments

Comments
 (0)