Skip to content

Commit e711f60

Browse files
committed
Add showSyntaxErrors extension setting
1 parent f4e5105 commit e711f60

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@
269269
"additionalProperties": false,
270270
"markdownDescription": "Whether to display Quick Fix actions to disable rules via `noqa` suppression comments."
271271
},
272+
"ruff.showSyntaxErrors": {
273+
"default": true,
274+
"markdownDescription": "Controls whether Ruff should show syntax error diagnostics.",
275+
"scope": "window",
276+
"type": "boolean"
277+
},
272278
"ruff.ignoreStandardLibrary": {
273279
"default": true,
274280
"markdownDescription": "Whether to ignore files that are inferred to be part of the Python standard library.",

src/common/settings.ts

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface ISettings {
5656
exclude?: string[];
5757
lineLength?: number;
5858
configurationPreference?: ConfigPreference;
59+
showSyntaxErrors: boolean;
5960
}
6061

6162
export function getExtensionSettings(namespace: string): Promise<ISettings[]> {
@@ -156,6 +157,7 @@ export async function getWorkspaceSettings(
156157
lineLength: config.get<number>("lineLength"),
157158
configurationPreference:
158159
config.get<ConfigPreference>("configurationPreference") ?? "editorFirst",
160+
showSyntaxErrors: config.get<boolean>("showSyntaxErrors") ?? true,
159161
};
160162
}
161163

@@ -205,6 +207,7 @@ export async function getGlobalSettings(namespace: string): Promise<ISettings> {
205207
"configurationPreference",
206208
"editorFirst",
207209
),
210+
showSyntaxErrors: getGlobalValue<boolean>(config, "showSyntaxErrors", true),
208211
};
209212
}
210213

@@ -234,6 +237,7 @@ export function checkIfConfigurationChanged(
234237
`${namespace}.exclude`,
235238
`${namespace}.lineLength`,
236239
`${namespace}.configurationPreference`,
240+
`${namespace}.showSyntaxErrors`,
237241
// Deprecated settings (prefer `lint.args`, etc.).
238242
`${namespace}.args`,
239243
`${namespace}.run`,

0 commit comments

Comments
 (0)