Commit Graph

15961 Commits

Author SHA1 Message Date
SELO
7be1ffb9ec
Add cross-compilation support from MacOS to Windows (#13382)
- Modify `build.rs` to use environment variables instead of `cfg`
directive to make cross-compilation to Windows possible
- Make `embed-resource` a global build-dependency for cross-compilation

Release Notes:

- N/A
2024-06-24 21:26:24 -06:00
Aaron Ruan
93a5d0ca29
Add limit to minimum window size (#13126)
Release Notes:

- Add a limit to the minimum window size on macOS.

Here's the minimum window before change:
<img width="121" alt="image"
src="https://github.com/zed-industries/zed/assets/38318044/9e907194-42e5-457e-91ea-96613426b479">

After change:
<img width="410" alt="image"
src="https://github.com/zed-industries/zed/assets/38318044/6e9c3057-9860-4f4b-9a73-c158ebac5ba9">
2024-06-24 21:26:13 -06:00
张小白
328d98dddc
windows: Make IME input on Windows consistent with that on macOS + some small fixs (#13386)
### Before

![Screenshot 2024-06-22
180000](https://github.com/zed-industries/zed/assets/14981363/9efc3ccd-553c-4fe8-ada5-1b54f80bfbd5)

### After

![Screenshot 2024-06-22
175850](https://github.com/zed-industries/zed/assets/14981363/172675ca-9fda-45ae-bd97-59c33573a766)


Release Notes:

- N/A
2024-06-24 20:55:15 -06:00
张小白
76ab9e4d66
macOS: Fix IME action when deleting last char (#13385)
Closes #12862 


https://github.com/zed-industries/zed/assets/14981363/170b1206-5894-4b90-bd5c-79761073d8f2


Release Notes:

- Fixed deleting the last character during IME composition would
mistakenly delete other characters.(#12862)
2024-06-24 20:54:36 -06:00
Conrad Irwin
c477c12956
x11: Fix handling of shift key (#13485)
Fixes: #13306

Release Notes:

- N/A
2024-06-24 20:37:46 -06:00
Conrad Irwin
1ffd87b87e
Fix dev server projects reconnect (#13484)
Release Notes:

- Improved handling of client reconnects for dev-servers (alpha group
only)
2024-06-24 20:36:05 -06:00
Mikayla Maki
df11b646da
Fix Linux search issues (#13479)
In some rare cases, we wouldn't pick up .gitignore files in the right
order, causing performance issues for the project search and the file
finder

Release Notes:

- N/A
2024-06-24 13:46:21 -07:00
Nate Butler
ed94bd41eb
Reorganize Quick Action Bar (#13476)
This PR:

- Moves the selection menu to the end with the editor settings menu
- Tidies up labels in the settings menu
- Minor spacing updates

Release Notes:

- Improved organization in the Quick Action Bar
2024-06-24 15:34:22 -04:00
Conrad Irwin
8949460bd7
fix cli welcome screen (#13474)
Release Notes:

- Fixed first launch via cli

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-24 12:55:30 -06:00
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
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
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
张小白
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
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
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
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
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
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
Bennet Bo Fenner
2c545ce0bc
assistant: Improve discoverability of slash command errors (#13331)
https://github.com/zed-industries/zed/assets/53836821/fca5deef-3a4b-4670-8b92-79f052ea8417



Release Notes:

- N/A
2024-06-20 21:39:53 +02:00
Piotr Osiewicz
58e9952d7b
tasks: Allow disabling runnables in the gutter (#13329)
Runnables can now be disabled with:
```
  "gutter": {
    "runnables": false
  }
```
Fixes #13280



Release Notes:

- Added `gutter.runnables` setting that controls whether runnable
indicators are displayed in the gutter.
2024-06-20 21:07:45 +02:00
agamcsama
25c8cf0c5c
windows: Fix Zed/GPUI misinterpreting keycodes + Refactor (#12814)
Release Notes:

- Fixed Zed/GPUI misinterpreting keycodes on non-US keyboards
([#12811](https://github.com/zed-industries/zed/issues/12811)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2024-06-20 11:39:20 -07:00
Jason Lee
d501a877a0
windows: Improve file_finder to support match with unix style path (#12357)
Release Notes:

- Improved file_finder to support match with Unix style path.


Sometimes we may get the Unix style path string, for example the result
of `git status`:

```bash
$ git status
On branch improve-file-finder-match-unix-paths
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   crates/file_finder/src/file_finder.rs
```

For example, from GitHub page:

<img width="760" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/c6fe8d8a-839e-4eef-a162-43b1dde09593">

If we copy that path to file_finder, it will not match any files on
Windows.

## Before

<img width="699" alt="屏幕截图 2024-05-28 001037"
src="https://github.com/zed-industries/zed/assets/5518/2d2d729e-7d27-421b-9a38-cfe4e53cc033">


## After

Use Unix style path:

<img width="689" alt="屏幕截图 2024-05-28 001150"
src="https://github.com/zed-industries/zed/assets/5518/e82dc8d6-bd6c-4b78-bd91-5b5210da73c4">

Use Windows style path:

<img width="629" alt="屏幕截图 2024-05-28 001302"
src="https://github.com/zed-industries/zed/assets/5518/4892019e-b2f4-41aa-bbf7-2f5f8af7aafa">
2024-06-20 11:33:49 -07:00
Muhammad Talal Anwar
97abf35529
linux: Fix icon not being associated with app window (#13165)
This commit fixes the app icon not being correctly associated with the
app window. For example, the app icon is not correctly shown in the dock
(Gnome on Wayland) when Zed is running.

Release Notes:

- N/A
2024-06-20 11:31:18 -07:00
Bennet Bo Fenner
0150192e26
assistant: Add term slash command (#13162)
This adds a `term` slash command to the assistant which allows to inject
the latest terminal output into the context.

Release Notes:

- N/A
2024-06-20 20:20:34 +02:00
Bennet Bo Fenner
5a6c55149a
assistant: Make including warnings for the diagnostic command more discoverable (#13323)
This makes the `--include-warnings` argument more discoverable

<img width="651" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/02d32496-ad7a-4670-85ce-eda945c0f1c2">

Release Notes:

- N/A
2024-06-20 19:48:13 +02:00
Mikayla Maki
4e2a08edb7
Fix missing IME keys when no input handler is set (#13325)
This fixes a bug introduced by
https://github.com/zed-industries/zed/pull/12702, where GPUI would only
generate the correct key events if you had an input handler set.

Release Notes:

- N/A
2024-06-20 10:39:10 -07:00
Thorsten Ball
c20a1ee032
auto-updates: Do not poll for updates on dev channel (#13311)
Our dev builds don't have updates and will never have updates, so
instead of polling our servers every time we start a dev instance, let's
disable it for the dev channel.

Release Notes:

- N/A
2024-06-20 15:00:54 +02:00
Elliot Thomas
f5f73efa8a
Respect workspace order in recent projects (#12844)
<img width="1266" alt="Screenshot 2024-06-10 at 14 33 32"
src="https://github.com/zed-industries/zed/assets/1347854/c75de033-f2c8-4500-8b34-46b5f0260d3d">

This changes the recent projects panel to use the order of paths from
the workspace rather than always being alphanumerical.

This follows the work to introduce manual workspace ordering to ensure
the recent projects paths reflect the order of paths in the main project
panel.

Release Notes:

- Improve the recent project panel by ordering paths using the workspace
order
2024-06-20 13:16:23 +03:00
Chung Wei Leong
d8c93e1bfd
Disable inline assist button when assistant is disabled (#13290)
Release Notes:

- Hide inline assist button when assistant is disabled
([#13289](https://github.com/zed-industries/zed/issues/13289)).
2024-06-20 12:56:09 +03:00
ᴀᴍᴛᴏᴀᴇʀ
95b06097ee
Add support for auto surround (#13217)
![result](https://github.com/zed-industries/zed/assets/32017007/c400081f-be5d-48fa-994f-90a00e2be359)

In the past, Zed used a single switch called `autoclose` to control both
`autoclose` and `auto_surround` functionalities:
+ `autoclose`: when input '(', append ')' automatically.
+ `auto_surround`: when select text and input '(', surround text with
'(' and ')' automatically.

This PR separates `auto_surround` from `autoclose` to support `<`. 

Previously, if `autoclose` of `<` was set to `false`, `auto_surround`
couldn't be used. However, setting `autoclose` to `true` would affect
the default behavior of simple expression. For example, `a < b` would
become `a <> b`.

For more information, see #13187.

Fix #12898.

Release Notes:

- Added support for `auto_surround`
([#12898](https://github.com/zed-industries/zed/issues/12898)).
2024-06-20 12:48:46 +03:00
Stefan
47174cea50
Add mouse context action to copy permalink (#13247)
<img width="977" alt="Screenshot 2024-06-19 at 00 24 21"
src="https://github.com/zed-industries/zed/assets/5855806/8bdb46ad-2d81-45d0-853b-c1d0cc0fc037">

Selecting the item results in the following link
a8c19ab895/crates/assets/Cargo.toml (L12)
for me.

## Summary

Switching from PyCharm, my number one most missed feature is "Copy
Github link" provided by the Gitlink plugin
(https://plugins.jetbrains.com/plugin/8183-gitlink /
https://github.com/ben-gibson/GitLink). I use this a lot to quickly send
code pointers to teammates.

While digging around, I found that this is basically already
implemented, but wasn't able to find this action exposed anywhere in the
UI.


a8c19ab895/crates/editor/src/editor.rs (L10343-L10367)

Release Notes:

- Added mouse context action to copy permalink to line
2024-06-20 10:46:49 +03:00
Joseph T Lyons
0129d4e250 v0.142.x dev 2024-06-19 12:09:32 -04:00
Thorsten Ball
3d4f275c52
editor: Add SelectPageUp/SelectPageDown actions (#13272)
This adds two new actions to `editor`:

- `editor::SelectPageUp`
- `editor::SelectPageDown`

On Linux they're bound by default to `shift-pageup` and
`shift-pagedown`, which matches VS Code and JetBrains.

Release Notes:

- N/A
2024-06-19 17:37:17 +02:00
Marshall Bowers
ddf07253c4
assistant: Strip out general website chrome in /fetch command (#13264)
This PR updates the `/fetch` command to strip out general website chrome
that likely won't contain content on any websites.

Release Notes:

- N/A
2024-06-19 09:50:02 -04:00
Thorsten Ball
8524e87319
linux/x11: Do panic when unmapping/destroying of X11 window fails (#13262)
We saw this panic come up:

```
called `Result::unwrap()` on an `Err` value: IoError(Custom { kind: Other, error: UnknownError })
core::panicking::panic_fmt
core::result::unwrap_failed
<gpui::platform::linux::x11:🪟:X11Window as core::ops::drop::Drop>::drop
core::ptr::drop_in_place<gpui::platform::linux::x11:🪟:X11Window>
core::ptr::drop_in_place<gpui:🪟:Window>
gpui::app::AppContext::shutdown
gpui::app::AppContext:🆕:{{closure}}
gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run
gpui::app::App::run
zed::main
std::sys_common::backtrace::__rust_begin_short_backtrace
std::rt::lang_start::{{closure}}
std::rt::lang_start_internal
main
__libc_start_call_main
__libc_start_main_impl
_start
```

I'm not sure where exactly that error comes from, except from the X11
stuff. So let's be defensive and log error and only then tear down
everything.

I _think_ that if the error is repeatable that means we won't close the
window but instead just log errors, but I do think that's better than
panicking right now.

Release Notes:

- N/A
2024-06-19 14:36:57 +02:00
Thorsten Ball
522692ef50
linux: Quiet some noisy logs when logging to file (#13260)
zbus, naga, and some parts of blade are pretty noisy at the INFO level.
zbus especially dumps large debug dumps into the logs.

So on Linux, when logging to a file, we reduce that noise. That means
one still gets the full firehose when doing `RUST_LOG=info cargo run`,
but not in the logs.


Release Notes:

- N/A
2024-06-19 14:09:25 +02:00
Thorsten Ball
8c4fb34f6e
Show location of log file when using zed: open log (#13252)
This changes the breadcrumb header from "untitled" to "Last 1000 lines
in <location of log file>".

Reason is that it's been incredibly frustrating not seeing the location
of the log file there and not seeing that it's actually a truncated
version of the logs.

This is one remedy for that.

Other options considered:

1. Opening the actual log file. Turns out that is huge. On Linux right
now it's 5 megabyte after 5 minutes.
2. Opening the file and adding it on the buffer. That is tricky and
weird, because you have to modify the underlying buffer and set the
file, after having to add it to the workspace and getting its entry,
etc.
3. Setting a `display_file_path` on Buffer. That would require also
adding it on `BufferSnapshot` and then threading that through so that it
gets returned by the multi-buffer and then in the editor. And ultimately
this here is a "view concern", so we thought we just add it as such.

So yes, not the best change possible, but it's not that invasive and
makes it clear that it's a view-only concern.

Release Notes:

- N/A

Co-authored-by: Kirill <kirill@zed.dev>
2024-06-19 12:21:28 +02:00
Mikayla Maki
d4891a62bb
Conform to wayland spec on resize (#13243)
Fixes https://github.com/zed-industries/zed/issues/10976

Release Notes:

- N/A

Co-authored-by: conrad <conrad@zed.dev>
2024-06-18 21:01:15 -07:00
Mikayla Maki
17bc0d1b17
Dynamically link libwayland (#13241)
Fixes a bug in current nightly.

Release Notes:

- N/A
2024-06-18 15:07:45 -07:00
Marshall Bowers
db0d843fb1
Allow completing slash command arguments from extensions (#13240)
This PR extends the extension API with support for completing slash
command arguments for slash commands defined in extensions.

Release Notes:

- N/A
2024-06-18 17:58:57 -04:00
Marshall Bowers
ad4e52842c
Make slash commands defined in extensions return SlashCommandOutput (#13237)
This PR extends the interface for slash commands defined in extensions
to have them return `SlashCommandOutput`.

This allows for slash commands to return multiple output sections for a
single piece of generated text.

Note that we don't allow specifying the icon to display in the
placeholder, as we don't want to commit to that in our API at the
moment.

Release Notes:

- N/A
2024-06-18 17:28:01 -04:00
Conrad Irwin
ca18549e02
Keyboardable buttons in linux alerts (#13235)
Release Notes:

- N/A
2024-06-18 14:58:10 -06:00
Marshall Bowers
5cbb360952
zed_extension_api: Add default implementation for language_server_command (#13234)
This PR adds a default implementation for the `language_server_command`
method on the `Extension` trait.

This will allow for extensions to be defined without having to implement
this method, which will be useful for extensions that may just want to
provide slash commands.

Release Notes:

- N/A
2024-06-18 16:55:33 -04:00
Conrad Irwin
5ff7c893be
Fix panic trying to go to next of 0 matches (#13233)
Release Notes:

- Fixed a panic when going to next search result when there are none
2024-06-18 14:46:33 -06:00
Joseph T. Lyons
9af4b6bfc7
Allow telemetry from unofficial builds (#13224)
Release Notes:

- N/A

Co-authored-by: Peter Tripp <notpeter@users.noreply.github.com>
2024-06-18 16:00:47 -04:00
Marshall Bowers
c84d432b5f
Fix modality indicators in user menu (#13228)
This PR updates the modality indicators in the user menu after #12940.

We use the ellipsis throughout the app to indicate that a menu action
will open a modal (e.g., the theme selector), so "Themes" needs the
trailing ellipsis.

Whereas the "Extensions" entry opens up a new tab, which we don't
indicate that same way.

Release Notes:

- N/A
2024-06-18 15:50:18 -04:00
Conrad Irwin
490a75aee6
Fix bug where window contents could appear outside of window bounds on X11 (#13181)
Release Notes:

- N/A
2024-06-18 13:49:01 -06:00
Conrad Irwin
4f364d6d09
Hide old linux panics (#13221)
Remove noise from the #panics channel by excluding any linux build
before
0.139.x. We filter on the os_version and os_name because evern older
versions
of linux set app_version = 1.0.0.

Release Notes:

- N/A
2024-06-18 13:48:26 -06:00
Max Brunsfeld
89d2ace713
Make LSP task cancellation discoverable (#13226)
Release Notes:

- Added the ability to cancel a cargo check by clicking on the status
bar item.
2024-06-18 12:44:35 -07:00
Marshall Bowers
84a44bef8a
storybook: Use theme::setup_ui_font helper function (#13227)
This PR updates the storybook to use the new `theme::setup_ui_font`
helper function to initialize the UI font.

Release Notes:

- N/A
2024-06-18 15:38:11 -04:00
Mikayla Maki
6b9ddbfef2
Add more menus to Zed (#12940)
### TODO

- [x] Make sure keybinding shows up in pane + menu
- [x] Selection tool in the editor toolbar
- [x] Application Menu
- [x] Add more options to pane + menu
   - Go to File...
  - Go to Symbol in Project... 
- [x] Add go items to the selection tool in the editor:
   - Go to Symbol in Editor...
   - Go to Line/Column...
   - Next Problem
   - Previous Problem
- [x] Fix a bug where modals opened from a context menu aren't focused
correclty
- [x] Determine if or what needs to be done with project actions:
- Difficulty is that these are exposed in the UI via clicking the
project name in the titlebar or by right clicking the root entry in the
project panel. But they require reading and are two clicks away. Is that
sufficient?
    - Add Folder to Project
    - Open a new project
    - Open recent
 - [x] Get a style pass 
 - [x] Implement style pass
   - [x] Fix the wrong actions in the selection menu
   - [x] Show selection tool toggle in the 'editor settings' thing
- [x] Put preferences section from the app menu onto the right hand user
menu
- [x] Add Project menu into app menu to replace 'preferences' section,
and put the rest of the actions there
- [ ] ~~Adopt `...` convention for opening a surface~~ uncertain what
this convention is.
   - [x] Adopt link styling  for webview actions
   - [x] Set lucide hamburger for menu icon
   - [x] Gate application menu to only show on Linux and Windows




Release Notes:

- Added a 'selection and movement' tool to the Editor's toolbar, as well
as controls to toggle it and a setting to remove it (`"toolbar":
{"selections_menu": true/false }`)
- Changed the behavior of the `+` menu in the tab bar to use standard
actions and keybindings. Replaced 'New Center Terminal' with 'New
Terminal', and 'New Search', with the usual 'Deploy Search'. Also added
item-creating actions to this menu.
- Added an 'application' menu to the titlebar to Linux and Windows
builds of Zed
2024-06-18 12:16:54 -07:00
Piotr Osiewicz
8af8493da6
typescript: Make VTSLS the default language server for Typescript (#13140)
Additionally, limit # of returned completion items + use fuzzy filtering
on VTSLS side. Prime LSP handler for response handling.


Release Notes:

- VTSLS is now a default language server for TypeScript, TSX, and
JavaScript.
2024-06-18 20:16:03 +02:00
apricotbucket28
f6fa6600bc
wayland: Refactor clipboard implementation (#12405)
Fixes https://github.com/zed-industries/zed/issues/12054

Replaces the `copypasta`/`smithay-clipboard` implementation with a new,
custom one

TODO list:

- [x] Cleanup code
- [x] Remove `smithay-clipboard`
- [x] Add more mime types to the supported list

Release Notes:

- Fixed drag and drop on Gnome
- Fixed clipboard paste on Hyprland
2024-06-18 10:04:19 -07:00
Marshall Bowers
01b836a191
util: Replace lazy_static! with OnceLock (#13215)
This PR replaces the `lazy_static!` usages in the `util` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

Release Notes:

- N/A
2024-06-18 12:44:58 -04:00
Marshall Bowers
41180b8d81
util: Remove leftover http module (#13214)
This PR removes a leftover `http` module in `util` that was lingering
from #11680.

Release Notes:

- N/A
2024-06-18 12:31:50 -04:00
Marshall Bowers
81475ac4cd
paths: Replace lazy_static! with OnceLock (#13213)
This PR replaces the `lazy_static!` usages in the `paths` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

The paths are now exposed as accessor functions that reference a private
static value.

Release Notes:

- N/A
2024-06-18 12:22:37 -04:00
Nigel Jose
ba59e66314
Improve Python syntax highlighting (#12868)
Release Notes:

- Improve syntax highlighting in Python #12578 

Before:
<img width="1181" alt="Screenshot 2024-06-08 at 01 44 54"
src="https://github.com/zed-industries/zed/assets/87859239/0b8ab26b-149b-477e-af08-8cd9f2b1c117">

After:

<img width="1184" alt="Screenshot 2024-06-10 at 01 02 35"
src="https://github.com/zed-industries/zed/assets/87859239/a319a5ea-54b7-4681-951d-130ea26aa390">

---------

Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com>
2024-06-18 12:21:18 -04:00
Panghu
3701e190ce
Add runnable for rust main function (#13087)
Release Notes:

- N/A



https://github.com/zed-industries/zed/assets/21101490/7a57805c-1d31-48b2-bc2c-3a6f0b730d72
2024-06-18 16:25:20 +02:00
Piotr Osiewicz
5dc26c261d
util: Use GlobSet in PathMatcher (#13197)
Previously we were using a single globset::Glob in PathMatcher; higher
up the stack, we were then resorting to using a list of PathMatchers.
globset crate exposes a GlobSet type that's better suited for this use
case. In my benchmarks, using a single PathMatcher with GlobSet instead
of a Vec of PathMatchers with Globs is about 3 times faster with the
default 'file_scan_exclusions' values. This slightly improves our
project load time for projects with large # of files, as showcased in
the following videos of loading a project with 100k source files. This
project is *not* a git repository, so it should measure raw overhead on
our side.

Current nightly: 51404d4ea0


https://github.com/zed-industries/zed/assets/24362066/e0aa9f8c-aae6-4348-8d42-d20bd41fcd76

versus this PR:


https://github.com/zed-industries/zed/assets/24362066/408dcab1-cee2-4c9e-a541-a31d14772dd7



Release Notes:

- Improved performance in large worktrees
2024-06-18 16:12:24 +02:00
Thorsten Ball
64d815a176
linux/x11: Fix closing of GPUI windows not working (#13201)
This fixes everything but the main Zed window (GPUI examples, prompt
library, etc.) not being closable by clicking on the X in X11.

We had a dangling reference before: we would remove the window from the
X11 state, but GPUI itself would still have the window in its
references.

In order to fix this we have to call `window.close()`, which ends up
calling `cx.remove_window()`, which removes the reference.

That in turn then causes the reference to be dropped, which cleans up
the X11 state for the window.

Release Notes:

- N/A
2024-06-18 15:22:26 +02:00
Piotr Osiewicz
5dc54863a4
project panel: Improve performance in large projects (#13202)
In #12980 I've hoisted out creation of HashSet<PathInWorktree> out of
render_entry, which made us not create that hash set for each entry in a
worktree on each frame. In current nightly, we do it once per call to
render() on the whole worktree, which is better.

However, we can still reuse the hashed between the frames, if the
worktree has not changed. Once we calculate the hashset for a given
worktree state, we keep it around for as long as the state is valid for.
We calculate the HashSet lazily, as we may not necessarily need it if
the project panel is collapsed. In large worktrees, this helps keep the
CPU usage of the main thread low-ish.


Release Notes:

- Improved performance of project panel in large worktrees.
2024-06-18 15:09:52 +02:00
Antonio Scandurra
e4ba336971
Preserve sections generated by slash commands when reloading a context (#13199)
Release Notes:

- N/A
2024-06-18 14:49:53 +02:00
Thorsten Ball
195a270e18
vim: Display pending keys in Vim mode indicator (#13195)
This changes the mode indicator to now show pending keys and not just
pending operators.


Release Notes:

- Added pending keys to the mode indicator in Vim mode.

Demo:



https://github.com/zed-industries/zed/assets/1185253/4fc4ffd9-2ba7-4e2c-b2c3-cd19b40cb640
2024-06-18 13:30:18 +02:00
Piotr Osiewicz
3a26a4809d
lsp: Revert URL type change (#13193)
This reverts URI changes made in
https://github.com/zed-industries/zed/pull/12928 while keeping the perf
goodies in tact. We should keep an eye out for
https://github.com/gluon-lang/lsp-types/issues/284
Fixes: https://github.com/zed-industries/zed/issues/13135
Fixes: https://github.com/zed-industries/zed/issues/13131
Release Notes:

- N/A
2024-06-18 12:39:56 +02:00
Conrad Irwin
51404d4ea0
Fix ci" on a brazillian keyboard (#13185)
Fixes: #12523

Release Notes:

- vim: Fix ci" on keyboards where typing a " requires the IME (#12523)
2024-06-17 22:38:36 -06:00
Conrad Irwin
05c4c7872c
Fix ctrl-r with no register (#13184)
Release Notes:

- N/A
2024-06-17 22:17:33 -06:00
Conrad Irwin
0af6e442a7
Don't generate invalid ranges for C code (#13183)
Fixes: #13128

Release Notes:

- Fixed a panic when editing C code
([#13128](https://github.com/zed-industries/zed/issues/13128)).
2024-06-17 21:13:42 -06:00
Max Brunsfeld
7003b0f211
Allow canceling in-progress language server work (e.g. cargo check) (#13173)
Release Notes:

- Added a more detailed message in place of the generic `checking...`
messages when Rust-analyzer is running.
- Added a rate limit for language server status messages, to reduce
noisiness of those updates.
- Added a `cancel language server work` action which will cancel
long-running language server tasks.

---------

Co-authored-by: Richard <richard@zed.dev>
2024-06-17 17:58:47 -07:00
Joseph T. Lyons
f489c8b79f
Allow for non-official builds to report telemetry (#13175)
Release Notes:

- N/A
2024-06-17 20:24:18 -04:00
Marshall Bowers
258a8a37d8
Extract paths out of util (#13182)
This PR extracts the definition of the various Zed paths out of `util`
and into a new `paths` crate.

`util` is for generic utils, while these paths are Zed-specific. For
instance, `gpui` depends on `util`, and it shouldn't have knowledge of
these paths, since they are only used by Zed.

Release Notes:

- N/A
2024-06-17 19:27:42 -04:00