Commit graph

23 commits

Author SHA1 Message Date
Peter Tripp
10028aaae8
Ensure *.json recognized as JSONC if checkout folder not zed (#34289)
Follow-up to: https://github.com/zed-industries/zed/pull/33410

Release Notes:

- N/A
2025-07-11 14:25:09 +00:00
Peter Tripp
dae4e84bc5
Explicitly associate files as JSONC (#33410)
Fixes an issue when the zed repo was checked out to folder other than
`zed` (e.g. `zed2`) files were incorrectly identified as JSON instead of
JSONC.

Release Notes:

- N/A
2025-06-25 16:29:44 -04:00
Bennet Bo Fenner
e5ad2c2518
Add crates/assistant_tools/src/edit_agent/evals/fixtures to file_scan_exclusions (#33224)
Follow up to #32211

Release Notes:

- N/A
2025-06-23 01:06:30 +00:00
Michael Sloan
ce8854007f
Add crates/assistant_tools/src/evals/fixtures to file_scan_exclusions (#32211)
Particularly got tired of `disable_cursor_blinking/before.rs` (an old
copy of `editor.rs`) showing up in tons of searches

Release Notes:

- N/A
2025-06-06 06:56:41 +00:00
Ben Kunkle
8173534ad5
zed: Reinstate default file_scan_exclusions in Zed repo project settings (#29690)
Closes #ISSUE

Re-adds default `file_scan_exclusions` to [project
settings](84e4891d54/.zed/settings.json)
that were overridden in #29106

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-04-30 17:50:56 +00:00
Michael Sloan
2178b36cbc
Add eval worktrees and repos to file_scan_exclusions in zed project settings (#29106)
Release Notes:

- N/A
2025-04-19 23:43:54 +00:00
Peter Tripp
eebee4ab18
Add stop_at_indent for MoveToBeginningOfLine (#25428)
Add support for `stop_at_indent` option for MoveToBeginningOfLine and SelectToBeginningOfLine instead of mixing that with `stop_at_soft_wraps`.
Add emacs mapping for `alt-m` (`back-to-indentation`)
2025-02-25 12:03:14 -05:00
Nate Butler
a03b7624f1
Revert "gpui & ui: Use shader for dashed dividers" (#23850)
Reverts zed-industries/zed#23839

getting some reports of linux crashes – will investigate later today

Release Notes:

- N/A
2025-01-29 19:19:20 +00:00
Nate Butler
e5943975f9
gpui & ui: Use shader for dashed dividers (#23839)
TODO:
- [x] BackgroundOrientation
- [x] PatternDash
- [x] `pattern_horizontal_dash` & `pattern_vertical_dash`
- [x] Metal dash shader
- [x] Blade dash shader
- [x] Update ui::Divider to use new pattern

---

This PR introduces proper dashed dividers using the new `PatternDash`
background shader.

![CleanShot 2025-01-29 at 09 33
06@2x](https://github.com/user-attachments/assets/2db5af58-1aa9-4ad7-aa52-b9046fbf8584)

Before this we were using 128 elements to create a dashed divider, which
is both expensive, and would not scale beyond a certain size. This
allows us to simplify the divider element as well.

Changes:

- Adds `BackgroundOrientation` to `gpui::color::Background` to allow
specifying a direction for a pattern
- Adds the PatternDash pattern variant
- Updates `ui::Divider`'s dashed variants to be more efficient

Misc:
- Documents the `ui::Divider` component
- Treat `.metal` files as `C` in the Zed project until we get some metal
syntax highlighting.

Release Notes:

- N/A
2025-01-29 12:18:34 -05:00
Peter Tripp
74cba2407f
ci: Move collab to Dockerfile-collab (#18515)
This makes it possible to have multiple Dockerfiles, each with their own
`.dockerignore`. Previously any docker builds would always include
anything inside `.dockerignore`. I believe this feature may require
`export DOCKER_BUILDKIT=1` but we use that in CI already.
2024-09-30 16:14:26 -04:00
Mathias
7c8f62e943
Add hard_tabs: false in project settings (#17357)
# Problem

I have a custom system-wide rustfmt configuration, and use tabs over
spaces. So when I contribute to Zed, I will get lots of formatting
errors.

# Proposition

- ~~Add rustfmt.toml (to specify that you are using the default rustfmt
configuration, see https://github.com/rust-lang/cargo/issues/14442)~~
- Add `hard_tabs: false` to `.zed/settings.json` for people using tabs
over spaces.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-09-04 12:30:28 -04:00
Marshall Bowers
acea6f9c0f
docs: Format CSS with Prettier (#15333)
This PR formats the CSS in the docs with Prettier.

The indentation of these CSS files kept changing based on who last
touched them, so I added settings to the Zed repo to try and keep the
formatting intact until we can enforce it in CI.

Release Notes:

- N/A
2024-07-27 10:25:51 -04:00
Peter Tripp
813cc3f5e5
Keymap oneliners (#13887)
This is should be a no-op, whitespace formatting only.
Removes 425 lines of excess whitespace in our default keymap json files.

Release Notes:

- Improved formatting of default keymaps (single line per bind)
2024-07-05 22:00:18 -04:00
Piotr Osiewicz
bac6e2fee7
tasks: Add experimental support for user-defined task variables (#13699)
Context:
@bennetbo spotted a regression in handling of `cargo run` task in zed
repo following a merge of #13658. We've started invoking `cargo run`
from the folder of an active file whereas previously we did it from the
workspace root. We brainstormed few solutions that involved adding a
separate task that gets invoked at a workspace level, but I realized
that a cleaner solution may be to finally add user-configured task
variables. This way, we can choose which crate to run by default at a
workspace level.

This has been originally brought up in the context of javascript tasks
in
https://github.com/zed-industries/zed/pull/12118#issuecomment-2129232114

Note that this is intended for internal use only for the time being.
/cc @RemcoSmitsDev we should be unblocked on having runner-dependant
tasks now.

Release notes:

- N/A
2024-07-01 15:59:19 +02:00
Joseph T. Lyons
f6eaa8b00f
Clean up whitespace (#10755)
I saved the `file_types.json` file and got a diff because it had some
trailing whitespace. I ran
[`lineman`](https://github.com/JosephTLyons/lineman) on the codebase.
I've done this before, but this time, I've added in the following
settings to our `.zed` local settings, to make sure every future save
respects our desire to have consistent whitespace formatting.

```json
"remove_trailing_whitespace_on_save": true,
"ensure_final_newline_on_save": true
```

Release Notes:

- N/A
2024-04-23 13:31:21 -04:00
Thorsten Ball
3853991c20
Format prettier_server.js (#9583)
This PURELY formats the file by opening it in Zed and hitting save with
save-on-format on.

It's been bugging me that I can't change the file without the whole
thing getting reformatted, so here we are.

Release Notes:

- N/A
2024-03-20 19:49:14 +01:00
Kirill Bulatov
9ae5366979
Ensure more Zed files are formatted uniformly (#8505)
Follow-up of
https://github.com/zed-industries/zed/pull/8500#issuecomment-1967522477

Now things are much better, but I still reformat the default.json
settings file:

```diff
diff --git a/assets/settings/default.json b/assets/settings/default.json
index c60c53026..67bf4505b 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -75,14 +75,7 @@
   // Hide the values of in variables from visual display in private files
   "redact_private_values": false,
   // Globs to match against file paths to determine if a file is private.
-  "private_files": [
-    "**/.env*",
-    "**/*.pem",
-    "**/*.key",
-    "**/*.cert",
-    "**/*.crt",
-    "**/secrets.yml"
-  ],
+  "private_files": ["**/.env*", "**/*.pem", "**/*.key", "**/*.cert", "**/*.crt", "**/secrets.yml"],
   // Whether to use additional LSP queries to format (and amend) the code after
   // every "trigger" symbol input, defined by LSP server capabilities.
   "use_on_type_format": true,
```

For me, Zed's doing that with the default prettier:
```
['/Users/someonetoignore/work/zed/zed/assets/settings/default.json' with options: {"printWidth":120,"tabWidth":2,"parser":"json","plugins":[],"path":"/Users/someonetoignore/work/zed/zed/assets/settings/default.json"}](stderr: Resolved config: {}, will format file '/Users/someonetoignore/work/zed/zed/assets/settings/default.json' with options: {"printWidth":120,"tabWidth":2,"parser":"json","plugins":[],"path":"/Users/someonetoignore/work/zed/zed/assets/settings/default.json"})
```

and `!/Library/Application Support/Zed/prettier/package-lock.json`
states that I have
```
    "node_modules/prettier": {
      "version": "3.2.5",
      "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
      "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
      "bin": {
        "prettier": "bin/prettier.cjs"
      },
      "engines": {
        "node": ">=14"
      },
      "funding": {
        "url": "https://github.com/prettier/prettier?sponsor=1"
      }
    },
```

Release Notes:

- N/A
2024-02-27 23:25:36 +02:00
Marshall Bowers
33ecb424af
Adjust tab size for Markdown (#8079)
This PR sets the `tab_size` for Markdown to 2 spaces.

This should prevent Prettier from adding a bunch of leading whitespace
when formatting Markdown lists.

Release Notes:

- N/A
2024-02-20 13:15:14 -05:00
Marshall Bowers
a161a7d0c9
Format YAML files (#7887)
This PR formats the YAML files in the repo with Prettier.

Release Notes:

- N/A
2024-02-15 22:04:57 -05:00
Marshall Bowers
ab6b9196e1
Fix Cargo.toml formatting (#7886)
This PR disables the formatting for `.toml` files within the Zed repo,
as the formatter provided by the TOML language server messes things up.

Release Notes:

- N/A
2024-02-15 21:54:43 -05:00
Mikayla Maki
f98d636203
WIP: Add a setting to visually redact enviroment variables (#7124)
Release Notes:

- Added bash syntax highlighting to `.env` files. 
- Added a `private_files` setting for configuring which files should be
considered to contain environment variables or other sensitive
information.
- Added a `redact_private_values` setting to add or remove censor bars
over variable values in files matching the `private_files` patterns.
-(internal) added a new `redactions.scm` query to our language support,
allowing different config file formats to indicate where environment
variable values can be identified in the syntax tree, added this query
to `bash`, `json`, `toml`, and `yaml` files.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-01-31 11:42:09 -08:00
Kirill Bulatov
a81f48f36b Use auto formatter settings for Zed repo.
Some users might have a language server formatter set in their settings, which is exclusive with prettier formatting.
That causes disruptions in the way whitespaces and other things are formatted, esp. in json and yaml files, hence enforce one formatter settings for the entire Zed repo.
2024-01-12 12:00:18 +02:00
Nate Butler
bb288eb941 Ensure json uses a tab size of 4 2023-07-31 13:08:40 -04:00