Skip to content

Commit e810c07

Browse files
committed
disable type checking
1 parent 24342cb commit e810c07

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/extension.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,15 @@ async function fixPylanceConfig(
221221
context: vscode.ExtensionContext,
222222
folder?: vscode.WorkspaceFolder
223223
) {
224-
// disable warnings about wildcard imports, add wypp to pylance's extraPaths
224+
// disable warnings about wildcard imports, add wypp to pylance's extraPaths,
225+
// turn typechecking off
225226
const libDir = context.asAbsolutePath('python/code/');
226227

227-
// Use the "python" section; Pylance contributes python.analysis.*
228228
const cfg = vscode.workspace.getConfiguration('python', folder?.uri);
229229
const target = folder ? vscode.ConfigurationTarget.WorkspaceFolder
230230
: vscode.ConfigurationTarget.Workspace;
231231

232-
// Read existing overrides (don’t clobber other rules)
232+
// wildcard warnings
233233
const keyOverride = 'analysis.diagnosticSeverityOverrides';
234234
const overrides = cfg.get<Record<string, string>>(keyOverride) ?? {};
235235
if (overrides.reportWildcardImportFromLibrary !== 'none') {
@@ -244,6 +244,7 @@ async function fixPylanceConfig(
244244
);
245245
}
246246

247+
// extraPaths
247248
const keyExtraPaths = 'analysis.extraPaths';
248249
const extra = cfg.get<string[]>(keyExtraPaths) ?? [];
249250
if (!extra.includes(libDir)) {
@@ -253,7 +254,14 @@ async function fixPylanceConfig(
253254
[...extra, libDir],
254255
target
255256
);
256-
}
257+
}
258+
259+
// typechecking off
260+
await cfg.update(
261+
'analysis.typeCheckingMode',
262+
'off',
263+
target
264+
);
257265
}
258266

259267
class Location implements vscode.TerminalLink {

0 commit comments

Comments
 (0)