Skip to content

Commit

Permalink
Add showSyntaxErrors extension setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jun 27, 2024
1 parent f4e5105 commit e711f60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@
"additionalProperties": false,
"markdownDescription": "Whether to display Quick Fix actions to disable rules via `noqa` suppression comments."
},
"ruff.showSyntaxErrors": {
"default": true,
"markdownDescription": "Controls whether Ruff should show syntax error diagnostics.",
"scope": "window",
"type": "boolean"
},
"ruff.ignoreStandardLibrary": {
"default": true,
"markdownDescription": "Whether to ignore files that are inferred to be part of the Python standard library.",
Expand Down
4 changes: 4 additions & 0 deletions src/common/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ISettings {
exclude?: string[];
lineLength?: number;
configurationPreference?: ConfigPreference;
showSyntaxErrors: boolean;
}

export function getExtensionSettings(namespace: string): Promise<ISettings[]> {
Expand Down Expand Up @@ -156,6 +157,7 @@ export async function getWorkspaceSettings(
lineLength: config.get<number>("lineLength"),
configurationPreference:
config.get<ConfigPreference>("configurationPreference") ?? "editorFirst",
showSyntaxErrors: config.get<boolean>("showSyntaxErrors") ?? true,
};
}

Expand Down Expand Up @@ -205,6 +207,7 @@ export async function getGlobalSettings(namespace: string): Promise<ISettings> {
"configurationPreference",
"editorFirst",
),
showSyntaxErrors: getGlobalValue<boolean>(config, "showSyntaxErrors", true),
};
}

Expand Down Expand Up @@ -234,6 +237,7 @@ export function checkIfConfigurationChanged(
`${namespace}.exclude`,
`${namespace}.lineLength`,
`${namespace}.configurationPreference`,
`${namespace}.showSyntaxErrors`,
// Deprecated settings (prefer `lint.args`, etc.).
`${namespace}.args`,
`${namespace}.run`,
Expand Down

0 comments on commit e711f60

Please sign in to comment.