From a7a14e59bf792d38af3b4008c127459e956f58e1 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:35:55 -0300 Subject: [PATCH] edit predictions: Clarify `disabled_globs` documentation (#24460) This PR clarifies how the `disabled_globs` work. Release Notes: - N/A --------- Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com> --- assets/settings/default.json | 2 ++ crates/language/src/language_settings.rs | 4 ++++ docs/src/configuring-zed.md | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 3369807b324a8f4e15979e1f0d950179c5406b25..884583167cd54a7d4835148885a623b628dbcfde 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -783,6 +783,8 @@ "load_direnv": "direct", "edit_predictions": { // A list of globs representing files that edit predictions should be disabled for. + // There's a sensible default list of globs already included. + // Any addition to this list will be merged with the default list. "disabled_globs": [ "**/.env*", "**/*.pem", diff --git a/crates/language/src/language_settings.rs b/crates/language/src/language_settings.rs index c8f47f7c8362221610d3369e25ea7a447bb450dd..b9c0821721bc15fbf5ba8b0fa286f9f25695731d 100644 --- a/crates/language/src/language_settings.rs +++ b/crates/language/src/language_settings.rs @@ -224,6 +224,8 @@ pub struct EditPredictionSettings { /// The provider that supplies edit predictions. pub provider: EditPredictionProvider, /// A list of globs representing files that edit predictions should be disabled for. + /// This list adds to a pre-existing, sensible default set of globs. + /// Any additional ones you add are combined with them. pub disabled_globs: Vec, /// When to show edit predictions previews in buffer. pub inline_preview: InlineCompletionPreviewMode, @@ -428,6 +430,8 @@ pub struct LanguageSettingsContent { #[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema, PartialEq)] pub struct InlineCompletionSettingsContent { /// A list of globs representing files that edit predictions should be disabled for. + /// This list adds to a pre-existing, sensible default set of globs. + /// Any additional ones you add are combined with them. #[serde(default)] pub disabled_globs: Option>, /// When to show edit predictions previews in buffer. diff --git a/docs/src/configuring-zed.md b/docs/src/configuring-zed.md index 779c9e2a5930eceba83d79716ebc481e26963390..91cd144406937d67d78b3f72b604eb7a5d70ae9e 100644 --- a/docs/src/configuring-zed.md +++ b/docs/src/configuring-zed.md @@ -398,13 +398,13 @@ There are two options to choose from: ### Disabled Globs -- Description: A list of globs representing files that edit predictions should be disabled for. +- Description: A list of globs for which edit predictions should be disabled for. This list adds to a pre-existing, sensible default set of globs. Any additional ones you add are combined with them. - Setting: `disabled_globs` -- Default: `[".env"]` +- Default: `["**/.env*", "**/*.pem", "**/*.key", "**/*.cert", "**/*.crt", "**/secrets.yml"]` **Options** -List of `string` values +List of `string` values. ## Edit Predictions Disabled in