Commit Graph

20580 Commits

Author SHA1 Message Date
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
Nicolò Santilio
710c387395
docs: Update installation instructions for MSYS2 (#13251)
Fixes #13229 

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-06-20 10:56:59 -07: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
Lukas Lihotzki
d5b0df6efa
blade: Bump rev to fix GLES (#13114)
Based on the work on GLES support of @kvark, only two pieces were
missing for usable GLES support:
- https://github.com/kvark/blade/pull/125 was upstreamed 2 weeks ago and
is contained in the currently referenced zed-industries/blade fork
- https://github.com/kvark/blade/pull/126 was upstreamed 17 hours ago
and is not contained in the zed-industries fork. As the zed-industries
fork was also upstreamed in https://github.com/kvark/blade/pull/128, we
can switch back to mainline blade.

If you don't want to switch back to mainline blade, please integrate
https://github.com/kvark/blade/pull/126 to your fork.

Release Notes:

- Fix GLES backend (#9581)
2024-06-20 10:40:03 -07: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
Thorsten Ball
963b0c010a
linux: Cleanup comments in keymap (#13299)
Release Notes:

- N/A
2024-06-20 11:28:53 +02:00
Hugh Do
558808b97d
docs: Fix a typo in replacement command in vim doc (#13288)
### Changes 

- Fix a typo in the replacement command
- Align command descriptions for better readability

Release Notes:

- N/A
2024-06-20 11:03:25 +02:00
Thorsten Ball
4b19eac5c8
docs: Explain how to forward keys to the terminal (#13298)
Follow-up to https://github.com/zed-industries/zed/pull/13263

Release Notes:

- N/A
2024-06-20 11:03:18 +02: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
Thorsten Ball
cd2533de5a
linux: Scroll linewise up/down on ctrl-up/ctrl-down (#13269)
This matches the behavior of VS Code and JetBrains.

(Of course I implemented both actions myself before figuring out that we
already have actions to scroll a line up and down.)


Release Notes:

- N/A
2024-06-19 17:27:40 +02:00
Pocæus
acc9648753
haskell: Update author name (#13268)
I updated my Github username, and some bot is now parked at the old
username. I figured I should open a PR to update this.

Referring to the PRs (which show _this_ updated username):
https://github.com/zed-industries/zed/pull/6786,
https://github.com/zed-industries/zed/pull/6995,
https://github.com/zed-industries/zed/pull/7331.

Release Notes:

- N/A
2024-06-19 10:28:49 -04:00
Marshall Bowers
bc35235800
docs: Remove $ in shell commands (#13266)
This PR removes the `$` from the shell commands in the OCaml docs, as we
don't use them anywhere else.

Release Notes:

- N/A
2024-06-19 10:14:56 -04:00
Piotr Osiewicz
2ca83b2f17
snippets: Bump to 0.0.3, add support for more languages (#13265)
This fixes issues spotted by @eproxus in
https://github.com/zed-industries/zed/pull/13253#issuecomment-2178724849
Release Notes:
 -N/A
2024-06-19 16:01:41 +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
aff7a83815
linux: Forward ctrl-w/ctrl-e to terminal (#13263)
This fixes `ctrl-w` and `ctrl-e` not working in the terminal pane but
instead triggering Zed actions ("close pane" and "search project files"
respectively).

I've added both because I think they're pretty commonly used in
terminals, since they're default Emacs-style keybindings.

But I also didn't want to add more, since it's relatively easy for users
to define themselves which keybindings should be forwarded to the
terminal and which not.

All that's required is adding something like this to the keymap:

```json
{
  "context": "Terminal",
  "bindings": {
    "ctrl-n": ["terminal::SendKeystroke", "ctrl-n"],
    "ctrl-p": ["terminal::SendKeystroke", "ctrl-p"]
  }
}
```
cc @mikayla-maki 

Release Notes:

- N/A
2024-06-19 15:14:58 +02: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
Piotr Osiewicz
59c005b086
snippets: Fix package metadata (#13261)
Release Notes:

- N/A
2024-06-19 14:30:15 +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
Piotr Osiewicz
d665f28671
Add language-agnostic snippets (#13253)
Note that right now we can't attach a language server to arbitrary
buffer, which is why I've listed a bunch of languages verbatim.
See
https://github.com/zed-industries/simple-completion-language-server/tree/main
for docs on how to define your snippets. They should be placed in
~/.config/zed/snippets ; `snippets.(toml|json)` file can be used to
define language-agnostic snippets, and any other name (e.g.
`python.toml`) will apply only to buffers of that particular type.

There's https://github.com/rafamadriz/friendly-snippets you can use as a
repository of snippets, for your convenience.

Fixes https://github.com/zed-industries/zed/issues/4611

Release Notes:
- Added support for snippets via simple-completion-language-server
2024-06-19 14:03:04 +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
Conrad Irwin
99e4b3a4cf
Add linux arm support to installer (#13231)
Release Notes:

- N/A
2024-06-18 14:29:19 -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
6cea9813ad
Stop using xtask for clippy (#13223)
This fixes an extra 10 second delay when needing to recompile xtask, and
allows passing arbitrary clippy args (like --allow-dirty)

Release Notes:

- N/A
2024-06-18 13:49:44 -06: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
Marshall Bowers
39edbe1c50
Update .mailmap (#13219)
This PR updates the `.mailmap` file to merge some commit authors using
multiple emails.

Release Notes:

- N/A
2024-06-18 13:20:50 -04: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