mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-04 09:03:21 +01:00
Add support for "..." in edit_predictions.disabled_globs (#64540)
## Objective Let users and projects add edit prediction exclusion patterns without repeating defaults or inherited patterns. Part of #64399. ## Solution Extend the `"..."` convention from #62769, #64222, #64440, and #64484 to `edit_predictions.disabled_globs` using `SplicingVec`. Inherited patterns are inserted at `"..."`, and duplicates retain their first occurrence. Omitting the marker replaces the list, `[]` clears it, and omitting the setting preserves inheritance. Opening an absent setting now initializes it with `["..."]` instead of clearing inherited patterns, and the selection is located by parsing the JSON instead of a regex, so a commented-out or nested `"disabled_globs"` can no longer capture it. Cursor imports append `"..."` like the `files.exclude` import does, so Zed's sensitive-file defaults survive an import; empty lists and empty or literal `"..."` entries are dropped, matching `enabled_patterns`. ## Testing Tested on macOS with settings merge and loading tests, Cursor import tests, the UI settings update and selection path (including commented-out and nested decoy keys), the new `settings_json` key-path lookup, and Copilot integration coverage. To check manually, configure custom disabled patterns alongside `"..."` and confirm that both custom patterns and inherited sensitive-file patterns remain disabled. Repeat without `"..."` and with `[]` to verify replacement and clearing. Opening the setting when it is absent should preserve inherited patterns. ## Self-Review Checklist: - [x] I’ve reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed’s UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Added support for `"..."` in `edit_predictions.disabled_globs` so custom patterns can extend inherited exclusions, and fixed "Configure Excluded Files" selecting the wrong list when a commented-out `disabled_globs` precedes it. --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
1 parent
656e3aed84
commit
5a137cbc9b
12 files changed
+598
-68
No files matched your search
@@ -100,7 +100,7 @@ To configure panel sizing, open the Settings Editor and search for “Agent Pane
|
||||
|
||||
### Flexible Sizing {#agent-panel-flexible-sizing}
|
||||
|
||||
- Description: Whether the agent panel uses flexible (proportional) sizing when docked to the left or right. When enabled, `agent.default_width` does not control the panel width, and double-clicking the panel’s outer resize handle restores the default proportion.
|
||||
- Description: Whether the agent panel uses flexible (proportional) sizing when docked to the left or right. When enabled, `agent.default_width` does not control the panel width, and double-clicking the panel's outer resize handle restores the default proportion.
|
||||
- Setting: `agent.flexible`
|
||||
- Default: `true`
|
||||
|
||||
@@ -141,7 +141,7 @@ Open the Settings Editor and search for “Threads Sidebar Default Width”. Or
|
||||
}
|
||||
```
|
||||
|
||||
If you haven’t manually resized the sidebar, its width follows changes to this setting immediately. A manually resized width takes precedence until you double-click the divider to reset it. After resetting, the sidebar follows this setting again.
|
||||
If you haven't manually resized the sidebar, its width follows changes to this setting immediately. A manually resized width takes precedence until you double-click the divider to reset it. After resetting, the sidebar follows this setting again.
|
||||
|
||||
Widths saved by older versions of Zed are preserved if they differ from the previous default of 300 pixels. A saved width of 300 pixels uses this setting instead.
|
||||
|
||||
@@ -789,6 +789,7 @@ For the case of "open", regular selection behavior can be achieved by holding `a
|
||||
- Default:
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
"edit_predictions": {
|
||||
"disabled_globs": [
|
||||
"**/.env*",
|
||||
@@ -803,6 +804,7 @@ For the case of "open", regular selection behavior can be achieved by holding `a
|
||||
"/**/zed/keymap.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Options**
|
||||
@@ -847,7 +849,7 @@ For the case of "open", regular selection behavior can be achieved by holding `a
|
||||
|
||||
### Disabled Globs
|
||||
|
||||
- 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.
|
||||
- Description: Disable edit predictions for files matching these glob patterns.
|
||||
- Setting: `disabled_globs`
|
||||
- Default: `["**/.env*", "**/*.pem", "**/*.key", "**/*.cert", "**/*.crt", "**/.dev.vars", "**/secrets.yml", "**/.zed/settings.json", "/**/zed/settings.json", "/**/zed/keymap.json"]`
|
||||
|
||||
@@ -855,6 +857,22 @@ For the case of "open", regular selection behavior can be achieved by holding `a
|
||||
|
||||
List of `string` values.
|
||||
|
||||
Use `"..."` to add patterns without repeating Zed's defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
"edit_predictions": {
|
||||
"disabled_globs": ["**/build/**", "..."]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Inherited patterns are inserted at `"..."`, and duplicates keep their first occurrence.
|
||||
|
||||
Set `[]` to clear the inherited list. Omit this setting to inherit it unchanged.
|
||||
|
||||
Relative patterns are matched against paths relative to the worktree root. Absolute patterns are matched against absolute paths. A leading `~` is expanded to your home folder.
|
||||
|
||||
### Prediction Debounce
|
||||
|
||||
- Description: How long Zed waits after you stop typing before automatically requesting an edit prediction.
|
||||
@@ -1878,13 +1896,13 @@ Each option controls displaying of a particular toolbar element. If all elements
|
||||
|
||||
## Use System Tabs
|
||||
|
||||
- Description: Whether to allow windows to tab together based on the user’s tabbing preference (macOS only).
|
||||
- Description: Whether to allow windows to tab together based on the user's tabbing preference (macOS only).
|
||||
- Setting: `use_system_window_tabs`
|
||||
- Default: `false`
|
||||
|
||||
**Options**
|
||||
|
||||
This setting enables integration with macOS’s native window tabbing feature. When set to `true`, Zed windows can be grouped together as tabs in a single macOS window, following the system-wide tabbing preferences set by the user (such as "Always", "In Full Screen", or "Never"). This setting is only available on macOS.
|
||||
This setting enables integration with macOS's native window tabbing feature. When set to `true`, Zed windows can be grouped together as tabs in a single macOS window, following the system-wide tabbing preferences set by the user (such as "Always", "In Full Screen", or "Never"). This setting is only available on macOS.
|
||||
|
||||
## Fullscreen Mode
|
||||
|
||||
@@ -2353,7 +2371,7 @@ The result is still `)))` and not `))))))`, which is what it would be by default
|
||||
}
|
||||
```
|
||||
|
||||
Use `"..."` to add patterns without repeating Zed’s defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
Use `"..."` to add patterns without repeating Zed's defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
@@ -2375,7 +2393,7 @@ Inherited patterns are inserted at `"..."`, and duplicates keep their first occu
|
||||
}
|
||||
```
|
||||
|
||||
Use `"..."` to add patterns without repeating Zed’s defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
Use `"..."` to add patterns without repeating Zed's defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
@@ -2944,7 +2962,7 @@ Example:
|
||||
}
|
||||
```
|
||||
|
||||
Use `"..."` to add patterns without repeating Zed’s defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
Use `"..."` to add patterns without repeating Zed's defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
@@ -3908,7 +3926,7 @@ List of `string` glob patterns
|
||||
}
|
||||
```
|
||||
|
||||
Use `"..."` to add patterns without repeating Zed’s defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
Use `"..."` to add patterns without repeating Zed's defaults. In project settings, it extends the user or parent configuration value. Omit `"..."` to replace the inherited list.
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user