Skip to content

Commit

Permalink
Only update desired key in python.analysis.diagnosticSeverityOverrides
Browse files Browse the repository at this point in the history
This should ensure that only the config key we care about is updated, and not every other config that the user has set.

As mentioned in joedevivo#105
  • Loading branch information
jrwagz committed May 13, 2023
1 parent a976afe commit 1bff58d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ export async function activate(context: vscode.ExtensionContext) {
vscode.workspace.getConfiguration().update("python.languageServer", "Pylance");
vscode.workspace.getConfiguration().update("python.linting.pylintEnabled", false);

vscode.workspace.getConfiguration().update("python.analysis.diagnosticSeverityOverrides",
{
"reportMissingModuleSource": "none"
}
let config_key = "python.analysis.diagnosticSeverityOverrides"
let current_value = vscode.workspace.getConfiguration()[config_key];
current_value["reportMissingModuleSource"] = "none"
vscode.workspace.getConfiguration().update(config_key,
current_value
);
let container: Container = await Container.newInstance(context);
}
Expand Down

0 comments on commit 1bff58d

Please sign in to comment.