Commit Graph

20580 Commits

Author SHA1 Message Date
Max Brunsfeld
c6c5907693
Fix unnecessary gitignore status updates due to failure to clear 'needs update' flag (#13471)
I found this bug while investigating
https://github.com/zed-industries/zed/issues/13176. When running zed
with `RUST_LOG=worktree=trace`, I realized we were updating all
gitignore statuses on every file change. This was due to a logic error
where we were marking a gitignore as up-to-date on a temporary *clone*
of our snapshot, but not in the `BackgroundScanner` itself.

Release Notes:

- Fixed a bug that caused unnecessary computations to happen on every
file-system event.
2024-06-24 10:39:08 -07:00
Benjamin Davies
dea928b00c
vim: Allow count and repeat for "r" and "shift-r" action (#13287)
Fixing the "r" action just involved adapting `normal_replace` to replace
multiple characters.

Fixing the "shift-r" command was less straightforward. The bindings for
`vim::BeforeNormal` in replace mode were being overwritten and several
other steps required for action repetition were not performed. Finally,
the cursor adjustment after re-entering normal mode was duplicated
(`vim::BeforeNormal` was now triggered correctly) so I removed the
special case for replace mode.

Release Notes:

- Fixed vim "r" action to accept a count argument
- Fixed vim "shift-r" action to accept a count argument and allow
repetition

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-24 09:41:33 -06:00
Benjamin Davies
77b2da2b42
vim: Surround in visual mode (#13347)
Adds support for surrounding text in visual/visual-line/visual-block
mode by re-using the `AddSurrounds` operator. There is no default
binding though so the user must follow the instructions to enable it.

Note that the behaviour varies slightly for the visual-line and
visual-block modes. In visual-line mode the surrounds are placed on
separate lines (the vim-surround extension also indents the contents but
I opted not to as that behaviour is less important with the use of code
formatters). In visual-block mode each of the selected regions is
surrounded and the cursor returns to the beginning of the selection
after the action is complete.

Release Notes:

- Added action to surround text in visual mode (no default binding).

Fixes #13122
2024-06-24 09:29:06 -06:00
Thorsten Ball
5a8c2a4a88
linux/x11: Prioritize rendering in X11 event loop (#13468)
This is a small change that aims to address frames being dropped when we
get a ton of X11 input events.

What it does, in short, is to first read all X11 input events and then
prioritize the rendering.

In my testing, it causes less frames to be dropped when the system is
under heavy load and lots of input events are being created.

Release Notes:

- N/A
2024-06-24 17:21:11 +02:00
Piotr Osiewicz
d46e494bd9
chore: Take down codegen-units in dev builds to 16 (#13466)
codegen-units determines how many object files are used when building a
single crate. By default it is set to 256 in dev builds and to 16 in
release builds. Higher values can get in the way of optimizations, but
they should help when performing an incremental build (as higher
granularity means that it's less likely we'd have to rebuild the whole
crate). When we were tinkering with Linux builds we found that we're
spreading ourselves too thin at times; large values of codegen-units
were making builds of smaller crates, such as file_finder, redundantly
long, where some CGs were miniscule. This PR significantly reduces the #
of CGs we use in dev builds. This means that an incremental build of a
crate might have to rebuild a bit more, but overall, we should be
spending *less* time in multicrate builds.

As a result of this change, incremental build of gpui (`cargo build;
touch crates/gpui/src/gpui.rs; cargo build`) goes down from 29-32s to
22s on my machine. Same scenario for editor: 13s to 11s. I've ran `cargo
clean` before executing each run



Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-06-24 15:43:31 +02:00
Thorsten Ball
82435075a5
Revert "linux/x11: Reduce input latency and ensure rerender priority (#13355)" (#13465)
This reverts commit f69c8ca74e after it
has already been partially reverted in
https://github.com/zed-industries/zed/pull/13458.

Why the revert?

The changes in that commit/PR fix one type of problem — dropping of
frames when being blasted with input events — but trades it for another
one that I can't explain yet: when the system is under load, then input
becomes _laggy_ and input events seem to be delayed.

Two examples of how that shows up:

1. When the system is under load* and you hold down the `down` key to
scroll, then lift the finger, the cursor stops sometimes. If you then
produce another input event by jiggling the mouse cursor you'll see more
`down`-key events coming up and the cursor moving down. It feels as if
the event loop is not being woken up even though there are still events.
I suspect it might have something to do with XIM, because if it's
disabled, it seems as if problems become less severe.
2. When the system is under load* and you click-and-drag a selection in
the editor, you can see how the selection is delayed and takes 500ms-1s
to catch up to where the cursor is.

* system under load: start Zed, then in another terminal window create a
release build of Zed, for example.

With the changes reverted, the failure mode looks different: we skip
frames. But that, I think, is the better of two bad options, because
skipping frames means that you see what's happening vs. input events
seemingly still coming in seconds after you stopped using the keyboard.

Release Notes:

- N/A
2024-06-24 15:31:49 +02:00
Thorsten Ball
40748b0a15
autosave: Respect project autosave settings per file (#13369)
This fixes #13316 by checking whether there are any local workspace
settings for a given file.

Release Notes:

- Fixed `autosave` settings in project-specific settings file being
ignored. ([#13316](https://github.com/zed-industries/zed/issues/13316)).

Co-authored-by: Bennet <bennet@zed.dev>
2024-06-24 14:56:22 +02:00
Thorsten Ball
3ee3c6a3bd
cargo: Add release-fast profile (#13464)
This saves us ~1min of linking time on my Linux machine.

Release Notes:

- N/A

Co-authored-by: Piotr <piotr@zed.dev>
2024-06-24 14:34:16 +02:00
Thorsten Ball
6cc3a4d95c
linux/x11: Fallback to 800x600 if window bounds size has 0 (#13462)
As reported here
https://github.com/zed-industries/zed/issues/13203#issuecomment-2183514518
it seems that sometimes we get 0 values for the window bounds.

Instead of failing to start up, we log a warning and fall back to
defaults that let a window show up.


Release Notes:

- N/A
2024-06-24 14:32:40 +02:00
d1y
b58dfe502e
Update Cargo.toml (#13375)
miss nightly build https://github.com/servo/pathfinder/issues/565

Release Notes:

- N/A
2024-06-24 14:15:40 +02:00
张小白
03e2f240ee
windows: Fix JSON schema validation (#13459)
This PR needs suggestions, especially from the Zed team. As I mentioned
in a previous issue #13394 , the `vscode-json-languageserver` that Zed
originally relied on has some issues with JSON schema validation on
Windows, and it hasn't been updated for a long time. This PR uses the
more frequently updated `vscode-langservers-extracted`, which resolves
this issue.

Currently, `vscode-langservers-extracted` includes not only the JSON LSP
server but also LSP servers for other languages. I think we might need a
package specifically for the JSON LSP server, such as something like
`vscode-json-langserver-extracted`, or we could consider using the LSP
servers for other languages from this package as well.

And, there are some issues with installing
`vscode-langservers-extracted` on Windows, causing the `postinstall`
script to fail. However, this does not seem to affect any functionality.
Therefore, I think the best solution is for the Zed team to maintain a
package like `vscode-json-langserver-extracted` or something else. This
way, we can update it promptly and address the installation issues on
Windows.

Any suggestions or advices are welcome.


#### JSON vaildation on Winodws



https://github.com/zed-industries/zed/assets/14981363/8cd7ff54-28ec-4601-b2e5-183e2fae2051



Closes #13394 

Release Notes:

- Fixed JSON schema validation issue on Windows.(#13394 )
2024-06-24 12:52:07 +02:00
Piotr Osiewicz
145cd798c0
project panel: Sticky dragging + do not move thumb when it's clicked (#13460)
/cc @mrnugget 
Release Notes:

- N/A
2024-06-24 12:51:32 +02:00
Thorsten Ball
9ef9baef6f
linux/x11: Fix CPU being pinned at 100% in X11 loop (#13458)
This was part of https://github.com/zed-industries/zed/pull/13355 to fix
the problem of XIM events not waking up the loop. Problem is that it
seems to pin a single CPU at 100%.

Luckily, it looks like the change is not necessary anymore after we
refactored the improvements in #13355.

This fixes https://github.com/zed-industries/zed/issues/13409.

Release Notes:

- N/A
2024-06-24 11:11:17 +02:00
Kirill Bulatov
d2a2faf7a2
Update soft_wrap config option documentation (#13457)
Closes https://github.com/zed-industries/zed/discussions/13440

Release Notes:

- N/A
2024-06-24 11:52:52 +03:00
Krzysztof Witkowski
10f7ca65cf
Multi-cursor removal possibility (#13431)
Release Notes:

- Added the ability to remove multi-cursors by clicking on them again.
([#13058](https://github.com/zed-industries/zed/issues/13058)).
2024-06-24 10:32:37 +02:00
crwen
354427413a
vim: Switch to normal mode after toggling comments (#13412)
Release Notes:

- vim: Fixed switching to normal mode after `g c`(vim::ToggleComments)
in visual mode
([#4439](https://github.com/zed-industries/zed/issues/4439))
2024-06-24 10:23:40 +02:00
Max Brunsfeld
9813297892
Combine multiple buffer update count fields into one (#13449)
Buffers carry several pieces of state besides their text: syntax tree,
diagnostics, git diff, and file data. Previously, the buffer maintained
a separate integer version number for each of these four pieces of
state, incrementing it every time that piece of state is updated. This
is used by MultiBuffers to detect when they need to update excerpts.

Previously, for a given buffer, these four version numbers were stored
on the buffer itself, on every snapshot of the buffer, in any
multi-buffer that referenced that buffer, **and** on snapshots of that
multi-buffer. But the only use for the version numbers was reduced down
to a single boolean predicate: whether or not the buffer's state has
changed.

In this PR, I've combined those 4 version numbers into one. I've called
it `non_text_state_update_count` because it tracks all state updates
outside of the text itself. This removes a bunch of unnecessary code,
and reduces the size of buffer snapshots and multi-buffer snapshots.

Release Notes:

- N/A
2024-06-23 22:20:10 -07:00
Piotr Osiewicz
78bc3a9a36
snippets: Release 0.0.5 (#13434)
Fix invalid platform name on Linux.
Related to:
https://github.com/zed-industries/zed/pull/13253#issuecomment-2185323702
Release Notes:

- N/A
2024-06-24 00:39:42 +02:00
Nathan Sobo
73de99bee0 Use - instead of _ in secret name 2024-06-23 15:32:47 -06:00
Nathan Sobo
0ed1b29b01
Assign GOOGLE_AI_API_KEY from a Kubernetes secret (#13429)
Release Notes:

- N/A
2024-06-23 14:52:43 -06:00
Nathan Sobo
5b754915e4
Respect requested gemini model (#13427)
Previously, we always went to gemini-pro.

Release Notes:

- N/A
2024-06-23 14:10:31 -06:00
Piotr Osiewicz
9298d3b525
editor: Select first match in "Find all references" editor (#13424)
Previously we've placed cursor on the first line of the first excerpt in
the multibuffer, but alas,
https://x.com/fasterthanlime/status/1804883499809165473 happened (j/k,
this feedback is totally valid) and now we're gonna place it at the end
of the first reference. As a bonus, with the old configuration `editor:
select next` tripped over itself. Now it's possible (& feasible) to do a
"select next" in "find all references"; consecutive referenced ranges
will be selected.

Fixes #13419



Release Notes:

- Fixed a bug where "Find all references" editor had cursor placed on
the first line of the first excerpt in the multibuffer instead of having
it on the first reference.
2024-06-23 18:53:27 +02:00
Piotr Osiewicz
89739d5874
project panel: Do not display scrollbar when entries do not overflow the panel (#13422)
/cc @JunkuiZhang 

Fixes
https://github.com/zed-industries/zed/pull/13358#issuecomment-2185032031

Release Notes:

- N/A
2024-06-23 18:24:21 +02:00
Piotr Osiewicz
d272e402ea
project panel: Add vertical scrollbar (#13358)
Fixes #4865
Release Notes:

- Added vertical scrollbar to project panel
2024-06-23 14:04:19 +02:00
ᴀᴍᴛᴏᴀᴇʀ
5c93506e9f
Fix a prompt typo (#13416)
Release Notes:

- N/A
2024-06-23 07:39:01 -04:00
Vitor Ramos
7df8b6fe10
Fix: Picker select_last not scrolling to item index (#13393)
Release Notes:

- Fix: Command palette not scrolling down to the last element
2024-06-23 09:36:52 +02:00
Max Brunsfeld
6fba1e46a8
Remove never-used client parameter from message handler functions (#13406)
Every single client-side RPC message handler function took an unused
`Arc<Client>` parameter. This removes that.

Release Notes:

- N/A
2024-06-22 16:07:36 -07:00
Max Brunsfeld
988ee93a81 Demote LSP request time log to trace level 2024-06-22 15:59:53 -07:00
Dave Grijalva
00a505e41a
docs: Correct path to global tasks file (#13372)
The documentation lists the path to the global tasks config file as
`~/.config/tasks.json`, but it's actually `~/.config/zed/tasks.json`.


Release Notes:

- N/A
2024-06-22 11:53:59 +03:00
Antonio Scandurra
ed9f6e2141
Fix inline assistant not working at the start/end of a file (#13384)
This was due to a bug in the `MultiBufferSnapshot::excerpts_in_ranges`
method. As part of this, I took the chance to rewrite that logic and
simplify it a bit.

Release Notes:

- N/A
2024-06-22 10:38:00 +02:00
Conrad Irwin
fe7d53cb96
Dynamicer builds (#13074)
Fixes https://github.com/zed-industries/zed/issues/13073

Note that, contrary to the issue's text, we're still shipping a
statically bundled sqlite3 after this PR. We use enough new features of
sqlite, like `sqlite3_error_offset` and `STRICT`, that our minimum
version (v3.38.0) is higher than is presumably accessible on Ubuntu.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-21 16:32:32 -07:00
Bennet Bo Fenner
edca195e3c
assistant: Fix gutter width (#13373)
The gutter width of the assistant panel was wider then expected after
#13329 was merged.

Release Notes:

- N/A
2024-06-21 19:59:46 +02:00
Sean Billig
d3b3e072a7
Make Claude 3.5 the default Anthropic model (#13324)
Release Notes:

- N/A

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-06-21 18:47:38 +02:00
Thorsten Ball
6b04b668ad
settings: Load .zed/settings.json even if .gitignored (#13370)
This fixes #4432 by ensuring that we scan & watch the `.zed` folder,
just like we watch the `.git`, for changes.

Release Notes:

- Settings are now loaded from local `.zed/settings.json` files even if
they are `.gitignore`d.
([#4432](https://github.com/zed-industries/zed/issues/4432)).

Co-authored-by: Bennet <bennet@zed.dev>
2024-06-21 18:39:14 +02:00
Antonio Scandurra
4072ad2858
Add support for Claude 3.5 Sonnet (#13371)
Release Notes:

- Added support for Claude 3.5 Sonnet.
2024-06-21 18:32:26 +02:00
Antonio Scandurra
cb0b8b4c4b
Introduce multi-cursor inline transformations (#13368)
https://github.com/zed-industries/zed/assets/482957/591def34-e5c8-4402-9c6b-372cbca720c3

Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2024-06-21 17:41:43 +02:00
Thorsten Ball
c58a8f1a04
linux/x11: Add more debug info to error if opening window fails (#13364)
Release Notes:

- N/A
2024-06-21 15:37:31 +02:00
Bennet Bo Fenner
abb46473c9
assistant: Include diagnostics in slash commands by default (#13359)
Include error diagnostics by default for the following slash commands:
`/file`, `/tabs`, `/active`

Release Notes:

- N/A
2024-06-21 14:28:12 +02:00
Piotr Osiewicz
9bdb154a9b
snippets: Read user settings for workspace configuration (#13356)
Fixes #13334

Use `settings` field in `lsp` subsettings to fix up the settings as
wish:
```
  "lsp": {
    "snippet-completion-server": {
      "settings": {
        "max_completion_items": 20, 
        "snippets_first": false,
        "feature_words": true,
        "feature_snippets": true,
        "feature_paths": true,
        "feature_unicode_input": false
      }
    }
  }
```


Release Notes:

- N/A
2024-06-21 12:44:19 +02:00
Thorsten Ball
f69c8ca74e
linux/x11: Reduce input latency and ensure rerender priority (#13355)
This change ensures that we always render a window according to its
refresh rate, even if there are a lot of X11 events.

We're working around some limitations of `calloop`. In the future, we
think we should revisit how the event loop is implemented on X11, so
that we can ensure proper prioritization of input events vs. rendering.

Release Notes:

- N/A

Co-authored-by: Antonio <me@as-cii.com>
2024-06-21 12:14:55 +02:00
Bennet Bo Fenner
04a79780d8
assistant: Include worktree name in diagnostics slash command (#13354)
Files included with the diagnostics command now include the worktree
name, making it more consistent with the way other commands work
(`/active`, `/tabs`, `/file`). Also, the diagnostics command will now
insert nothing when there are no diagnostics.

Release Notes:

- N/A
2024-06-21 11:48:52 +02:00
Piotr Osiewicz
4dd05a80e0
YAML: set auto_indent_using_last_non_empty_line to false (fix wonky formatting) (#13351)
This makes us treat yaml like other indentation-sensitive languages
(e.g. Python) and not reformat it on pasting and what not.

Fixes #12236
Fixes #13338

Release Notes:

- Fixed spurious appliance of auto-formatting to YAML blocks.
2024-06-21 10:58:44 +02:00
Stanislav Alekseev
44c479c50c
Add a setting to increase the thickness of the active indent guide (#13210)
Resolves #12312.

Release Notes:

- Added an option to configure the line width of the active indent guide
[#12312](https://github.com/zed-industries/zed/issues/12312)
2024-06-21 10:53:46 +02:00
0x2CA
c8709978a1
Dealing with missing arm architectures (#13349)
![image](https://github.com/zed-industries/zed/assets/19868292/341bf8c6-4586-4d51-8889-2c706dc98f6f)

"AArch64" and "ARM64" refer to the same thing.

AArch64 is the 64-bit state introduced in the [Armv8-A
architecture](https://en.wikipedia.org/wiki/ARM_architecture_family#Armv8-A).
The 32-bit state which is backwards compatible with Armv7-A and previous
32-bit Arm architectures is referred to as AArch32. Therefore the GNU
triplet for the 64-bit ISA is aarch64. The Linux kernel community
[chose](https://lkml.org/lkml/2012/7/6/624) to call their port of the
kernel to this architecture arm64 rather than aarch64, so that's where
some of the arm64 usage comes from.

The Apple-developed backend for AArch64 was called "ARM64" whereas the
LLVM community-developed backend was called "AArch64" (as it is the
canonical name for the 64-bit ISA). The two were merged [in
2014](https://www.phoronix.com/news/MTY5ODk) and the backend now is
called "AArch64".

Remote Normal


![image](https://github.com/zed-industries/zed/assets/19868292/f8c5505a-f455-45a6-83bd-230054f8aebd)


Release Notes:

- N/A
2024-06-21 10:46:25 +03:00
Adam Soutar
f78f6a6e1e
Add Markdown Preview shortcut to Atom keymap (#13313)
This patch maps `Ctrl+Shift+M` to "Open Markdown Preview to the side".

That's what it used to be in Atom:
https://github.com/atom/markdown-preview

Release Notes:

- Added Markdown Preview shortcut for the Atom keymap
2024-06-21 10:28:31 +03:00
Nigel Jose
fefc91c6ad
Improve code folding to exclude folding line breaks in whitespace-sensitive languages (#13108)
<img width="1219" alt="Screenshot 2024-06-16 at 15 43 31"
src="https://github.com/zed-industries/zed/assets/87859239/dd05de16-7f20-4c88-9e95-021555b8b78b">
<img width="1219" alt="Screenshot 2024-06-16 at 15 45 10"
src="https://github.com/zed-industries/zed/assets/87859239/b1b78cdd-f34d-4ea3-9728-4741727a9643">

Updated the foldable_range method to exclude folding line breaks during
code folding in whitespace-sensitive languages like Python and YAML.
This adjustment ensures that folding behaves as expected, similar to
other code editors.

Ref #11614

Release Notes:

- Improved code folds to ignore trailing newlines
2024-06-21 10:03:06 +03:00
loczek
3076567f6b
workspace: Add clear notifications command (#13320)
Release Notes:

- Added the `workspace: clear all notifications` command to clear
notifications
([#10761](https://github.com/zed-industries/zed/issues/10761))


https://github.com/zed-industries/zed/assets/30776250/36f2c3f3-5b5e-4f98-9418-8806ce311504
2024-06-21 07:00:46 +02:00
Evan Liu
6eb537643a
editor: Add scroll_beyond_last_line setting (#11155)
Add `scroll_beyond_last_line` setting with 3 options: 

- `one_page`: The default (current) behaviour of scrolling one more page
beyond the last line.
<img width="568" alt="SCR-20240429-sxry"
src="https://github.com/zed-industries/zed/assets/126383/1effbee9-759f-4858-9022-83bbb208ef82">

- `off`: No scrolling beyond the last line. 
<img width="568" alt="SCR-20240429-syhv"
src="https://github.com/zed-industries/zed/assets/126383/5391b1d7-918d-43f3-8a6f-7642ef32d174">

- `vertical_scroll_margin`: Scroll beyond the last line by the same
number of lines as `vertical_scroll_margin`. Matches the behaviour of
keyboard scrolling.
<img width="568" alt="SCR-20240429-sypc"
src="https://github.com/zed-industries/zed/assets/126383/bb9cc928-e515-4503-88f7-e434c45d742f">

Release Notes:

- Added `scroll_beyond_last_line` setting
([#4962](https://github.com/zed-industries/zed/issues/4962)).
2024-06-20 14:22:37 -07:00
Mikayla Maki
40eb84109d
Update linux build documentation (#13335)
Follow up to https://github.com/zed-industries/zed/pull/13165

Release Notes:

- N/A
2024-06-20 14:08:18 -07:00
Peter Tripp
51601cf6bd
Docs: Specify the location of the tasks.json files (#13333)
- Docs: Tasks: Explicitly note the location of `tasks.json` files.
- Docs: Keybindings: Add link to task docs showing example of binding to
a specific task.

Release Notes:

- N/A
2024-06-20 16:12:21 -04:00