Skip to content

Commit

Permalink
editor/code: Enable noPropertyAccessFromIndexSignature ts option
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuharuohzeki committed Jun 28, 2023
1 parent 0a7a1d5 commit 597c7e5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion editors/code/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function getServer(
config: Config,
state: PersistentState
): Promise<string | undefined> {
const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
const explicitPath = process.env["__RA_LSP_SERVER_DEBUG"] ?? config.serverPath;
if (explicitPath) {
if (explicitPath.startsWith("~/")) {
return os.homedir() + explicitPath.slice("~".length);
Expand Down
4 changes: 2 additions & 2 deletions editors/code/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export function substituteVariablesInEnv(env: Env): Env {
const depRe = new RegExp(/\${(?<depName>.+?)}/g);
let match = undefined;
while ((match = depRe.exec(value))) {
const depName = unwrapUndefinable(match.groups?.depName);
const depName = unwrapUndefinable(match.groups?.["depName"]);
deps.add(depName);
// `depName` at this point can have a form of `expression` or
// `prefix:expression`
Expand Down Expand Up @@ -443,7 +443,7 @@ function computeVscodeVar(varName: string): string | null {
// https://github.com/microsoft/vscode/blob/08ac1bb67ca2459496b272d8f4a908757f24f56f/src/vs/workbench/api/common/extHostVariableResolverService.ts#L81
// or
// https://github.com/microsoft/vscode/blob/29eb316bb9f154b7870eb5204ec7f2e7cf649bec/src/vs/server/node/remoteTerminalChannel.ts#L56
execPath: () => process.env.VSCODE_EXEC_PATH ?? process.execPath,
execPath: () => process.env["VSCODE_EXEC_PATH"] ?? process.execPath,

pathSeparator: () => path.sep,
};
Expand Down
5 changes: 3 additions & 2 deletions editors/code/src/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ async function getDebugConfiguration(
debugConfig.name = `run ${path.basename(executable)}`;
}

if (debugConfig.cwd) {
debugConfig.cwd = simplifyPath(debugConfig.cwd);
const cwd = debugConfig["cwd"];
if (cwd) {
debugConfig["cwd"] = simplifyPath(cwd);
}

return debugConfig;
Expand Down
2 changes: 1 addition & 1 deletion editors/code/src/toolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const getPathForExecutable = memoizeAsync(
);

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

const candidates = paths.split(path.delimiter).flatMap((dirInPath) => {
const candidate = path.join(dirInPath, exec);
Expand Down
2 changes: 1 addition & 1 deletion editors/code/tests/unit/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function getTests(ctx: Context) {
USING_VSCODE_VAR: "${workspaceFolderBasename}",
};
const actualEnv = await substituteVariablesInEnv(envJson);
assert.deepStrictEqual(actualEnv.USING_VSCODE_VAR, "code");
assert.deepStrictEqual(actualEnv["USING_VSCODE_VAR"], "code");
});
});
}
3 changes: 1 addition & 2 deletions editors/code/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
// These disables some enhancement type checking options
// to update typescript version without any code change.
"useUnknownInCatchVariables": false,
"exactOptionalPropertyTypes": false,
"noPropertyAccessFromIndexSignature": false
"exactOptionalPropertyTypes": false
},
"exclude": ["node_modules", ".vscode-test"],
"include": ["src", "tests"]
Expand Down

0 comments on commit 597c7e5

Please sign in to comment.