Commit Graph

16091 Commits

Author SHA1 Message Date
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
Marshall Bowers
78e0f71a28
ui: Use PopoverMenu::new for constructing PopoverMenus (#13178)
This PR replaces the `popover_menu` function for constructing
`PopoverMenu`s with a `PopoverMenu::new` associated function.

This brings `PopoverMenu` in line with our other UI components.

Release Notes:

- N/A
2024-06-17 18:14:37 -04:00
Marshall Bowers
59104a08fd
assistant: Show an indicator when a crate is being indexed (#13174)
This PR adds an indicator when a crate is being indexed as part of the
`/rustdoc` command invocation.


https://github.com/zed-industries/zed/assets/1486634/0dd4b663-658c-4be5-a342-cfbd7a938fca

Release Notes:

- N/A
2024-06-17 17:39:38 -04:00
Marshall Bowers
7aa28c9b24
rustdoc: Strip out additional chrome (#13172)
This PR updates the HTML to Markdown converter for rustdoc to strip out
some additional chrome.

Namely, anchors and links to source files.

Release Notes:

- N/A
2024-06-17 16:44:15 -04:00
Joseph T. Lyons
ca035dbdd8
Move project event logic to telemetry.rs (#13166)
I previously put this logic directly into `project.rs`, but it doesn't
feel good to pollute that code with telemetry logic, so I've moved it
over to `telemetry.rs`.

Release Notes:

- N/A
2024-06-17 15:52:59 -04:00
Marshall Bowers
71cc95d315
Remove copilot and show_copilot_suggestions setting aliases (#13167)
This PR removes the Copilot-specific aliases for the
`inline_completions` and `show_inline_completions` settings.

While these aliases were added to maintain backward-compatibility, the
aliasing behavior here can lead to a confusing experience when both keys
end up in the `settings.json`.

Release Notes:

- Breaking Change: Removed the `copilot` alias for the
`inline_completions` setting. If you have settings under `copilot` they
should get moved to `inline_completions`.
- Breaking Change: Removed the `show_copilot_suggestions` alias for the
`show_inline_completions` setting.
2024-06-17 15:51:37 -04:00
张小白
3707734f0a
windows: Fix executable display name (#13091)
Closes #12907 

**Note:** To actually take effect, delete the registered key of `Zed` in
`HKEY_CLASSES_ROOT\Local
Settings\Software\Microsoft\Windows\Shell\MuiCache`, for example, delete
this:

![Screenshot 2024-06-15
180939](https://github.com/zed-industries/zed/assets/14981363/8da94188-a869-48bb-9ecf-18a0a2cd3061)


### Before

1. In Taskmanager

![Screenshot 2024-06-15
175146](https://github.com/zed-industries/zed/assets/14981363/bb58a136-9f28-4f7f-9079-d83bc8b27580)

2. Right click taskbar

![Screenshot 2024-06-15
175211](https://github.com/zed-industries/zed/assets/14981363/113797c5-fa38-494e-a939-7a05adfa6d9e)

### After

![Screenshot 2024-06-15
174800](https://github.com/zed-industries/zed/assets/14981363/a1e9c1f5-da05-4a47-a97f-bd297f22ae37)

![Screenshot 2024-06-15
175847](https://github.com/zed-industries/zed/assets/14981363/692ed3ac-6ad0-4804-894e-1fae375ebd3d)

Release Notes:

- N/A
2024-06-17 13:02:09 -06:00
张小白
e19627d92f
windows: Fix regression introduced by a prev PR (#13090)
Fix regression introduced by #12991 

### Before

The re-position and re-size of a window is broken.


https://github.com/zed-industries/zed/assets/14981363/d4fb9dce-707e-4ab1-9ff5-f355b7fdd8a8

### After



https://github.com/zed-industries/zed/assets/14981363/7fd232e6-ff6c-4b7f-ad32-c284acd4f6db




Release Notes:

- N/A
2024-06-17 13:01:35 -06:00
Marshall Bowers
bb75d87285
Remove language_overrides setting alias (#13164)
This PR removes the `language_overrides` alias for the `languages`
setting.

I've seen a number of people run into issues where they have both
`languages` and `language_overrides` in their settings and get confused
when their settings don't seem to apply as expected.

This is a breaking change, but I think it is a necessary one to prevent
more users from running into issues.

Release Notes:

- Breaking Change: Removed the `language_overrides` alias for the
`languages` setting. If you have settings under `language_overrides`
they should get moved to `languages`.
2024-06-17 14:50:45 -04:00
Conrad Irwin
eecbf203dc
Fix 100s freeze on boot on X11 (#13156)
Release Notes:

- Fixed switching between dark and light mode with no windows open.
2024-06-17 12:44:32 -06:00
Marshall Bowers
7fe5c27597
repl: Add missing LICENSE file (#13161)
This PR adds a missing LICENSE file to the `repl` crate.

Release Notes:

- N/A
2024-06-17 14:13:12 -04:00
Kyle Kelley
221edfc267
Bring Jupyter to Zed Editing (#12062)
Run any Jupyter kernel in Zed on any buffer (editor):

<img width="1074" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/eac8ed69-d02b-4d46-b379-6186d8f59470">

## TODO

### Lifecycle

* [x] Launch kernels on demand
* [x] Wait for kernel to be started
* [x] Request Kernel info on start
* [x] Show in progress indicator
* [ ] Allow picking kernel (it defaults to first matching language name)
* [ ] Menu for interrupting and shutting down the kernel
* [ ] Drop running kernels once editor is dropped

### Media Outputs

* [x] Render text and tracebacks with ANSI color handling
* [x] Render markdown as text
* [x] Render PNG and JPEG images using an explicit height based on
line-height
* ~~Render SVG~~ -- not happening for this PR due to lack of text in SVG
support
* [ ] Process `update_display_data` message and related `display_id`
* [x] Process `page` data from payloads as outputs
* [ ] Render markdown as, well, rendered markdown -- Note: unsure if we
can get line heights here

### Document

* [x] Select code and run
* [x] Run current line
* [x] Clear previous overlapping runs
* [ ] Support running markdown code blocks
* [ ] Action to export session as notebook or output files
* [ ] Action to clear all outputs
* [ ] Delete outputs when lines are deleted

## Other missing features

The following is a list of missing functionality or expectations that
are out of scope for this PR.

### Python Environments

Detecting python environments should probably be done in a separate PR
in tandem with how they're used with LSP. Users likely want to pick an
environment for their project, whether a virtualenv, conda env, pyenv,
poetry backed virtualenv, or the system. Related issues:

* https://github.com/zed-industries/zed/issues/7646
* https://github.com/zed-industries/zed/issues/7808
* https://github.com/zed-industries/zed/issues/7296

### LSP Integration

* Submit `complete_request` messages for completions to interleave
interactive variables with LSP
* LSP for IPython semantics (`%%timeit`, `!ls`, `get_ipython`, etc.)

## Future release notes

- Run code in any editor, whether it's a script or a markdown document

Release Notes:

- N/A
2024-06-17 10:02:31 -07:00
Antonio Scandurra
d95c424d18
Show correct line number for entry placeholders in /search (#13151)
Release Notes:

- N/A
2024-06-17 18:19:44 +02:00
Kirill Bulatov
d6d56191da
Properly propagate git statuses in the outline panel (#13150)
Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-06-17 19:06:35 +03:00
Marshall Bowers
2e87e1d26e
assistant: Fix loading local crate docs (#13147)
This PR fixes an issue where loading the crate-level docs with
`/rustdoc` wasn't working as expected.

Release Notes:

- N/A
2024-06-17 11:55:53 -04:00
Marshall Bowers
e8862c45cc
assistant: Indicate when the /rustdoc output is from the index (#13148)
This PR makes it so that when `/rustdoc` returns content from the local
index it indicates as such in the placeholder.

Release Notes:

- N/A
2024-06-17 11:53:23 -04:00
Marshall Bowers
0c28b6a11a
rustdoc: Don't start indexing if a crate is already being indexed (#13149)
This PR updates the rustdoc indexing to not start indexing a crate that
is already being indexed.

Currently the indexing of a crate might get continuously interrupted by
the user's typing, resulting in thrashing of the indexing task and never
indexing the crate in its entirety.

Release Notes:

- N/A
2024-06-17 11:52:05 -04:00
dontwanttothink
16fce64d3a
Fix Hide Copilot context menu item (#13113)
The `features.copilot` setting appears to have been replaced by
`"inline_completion_provider": "none"` at some point, but the Hide
Copilot context menu was never updated to reflect that.

Release Notes:

- Fixed the Hide Copilot context menu item to modify the appropriate
setting.
2024-06-17 11:23:03 -04:00
Antonio Scandurra
b075ce8f04
Rename flaps to creases (#13144)
This is a simple rename and should be transparent for users.

Release Notes:

- N/A
2024-06-17 16:58:59 +02:00
Antonio Scandurra
6322351f00
Draw gutter highlights and indicators on top of blocks (#13142)
This ensures that the gutter progress in the inline assistant is
contiguous.

Release Notes:

- N/A
2024-06-17 15:34:05 +02:00
Antonio Scandurra
78091fa91e
Don't include prompt titles / "Default Prompt:" in slash command output (#13139)
This only includes a newline to ensure there's always something to fold.

Release Notes:

- N/A
2024-06-17 13:53:52 +02:00
Bennet Bo Fenner
d5735dab9a
assistant: Add glob matching for file slash command (#13137)
This PR adds support for glob matching when using the `file` slash
command inside the assistant panel:


https://github.com/zed-industries/zed/assets/53836821/696612d2-486c-4ab0-bf3c-d23a3eeefd25

Release Notes:

- N/A
2024-06-17 13:53:27 +02:00
Antonio Scandurra
03c54623d4
Allow cursor to be moved into an unconfirmed prompt editor via esc (#13134)
This also swaps the icons in the prompt editor.

Release Notes:

- N/A
2024-06-17 12:19:06 +02:00
Kirill Bulatov
0afb3abfd2
Improve outline panel entries' revealing and grouping (#13127)
Release Notes:

- N/A
2024-06-17 13:08:25 +03:00
Antonio Scandurra
2b46a4a0e9
Ensure context inserted via commands is syntax-highlighted (#13133)
Release Notes:

- N/A
2024-06-17 11:57:56 +02:00
Antonio Scandurra
bedf57db89
Fix cursor blinking not working (#13130)
This was a bug in https://github.com/zed-industries/zed/pull/12990, due
to the new focus restoration logic introduced with the editor.

With this pull request, the editor will only restore focus when a
descendant lost it. If the focus was lost by the editor itself, there's
no need to restore it and we can instead proceed with starting the
cursor blink.

Release Notes:

- N/A
2024-06-17 11:31:49 +02:00
Richard Feldman
4855da53df
Don't hide inline assist when editor loses focus (#12990)
Release Notes:

- Now when an editor loses focus (e.g. from switching tabs) and then
gains focus again, it doesn't close the inline assist. Instead, it only
closes when you move the cursor outside of it, e.g. by clicking
somewhere else in its parent editor.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-06-17 09:43:52 +02:00
Edwin Aronsson
15d3e54ae3
Remove textDocument/diagnostic capability (#13102)
Zed currently does not support pull diagnostics, yet still has the
capability for it (`textDocument/diagnostic`) (added in
14993e0876).
Some language servers therefore assume Zed will use pull diagnostics,
which leads to there being no diagnostics at all. This PR removes this
capability, making it possible to get diagnostics with more language
servers.

Release Notes:

- N/A
2024-06-16 10:39:04 +03:00
Marshall Bowers
064bdab459
theme: Warn when deprecated scrollbar_thumb.background style is used (#13081)
This PR adds a warning when the deprecated `scrollbar_thumb.background`
style property is present in a theme.

This property has been succeeded by `scrollbar.thumb.background`.

The primary reason for this is to get it into the `zed-extension` CLI so
that we can use it to detect which themes need to be updated.

Release Notes:

- N/A
2024-06-15 22:14:39 -04:00
apricotbucket28
38cb95f427
linux: Update cosmic_text (#13095)
Bumps cosmic_text, removes some stale `todo`s and stores a ShapeBuffer
to prevent reallocations

Improvements:

- Performance should be a lot better (haven't actually tested it)
- Fixed display of `\t` in the terminal

![image](https://github.com/zed-industries/zed/assets/71973804/ca994912-851d-48ef-8dc7-b244c9eb484d)

![image](https://github.com/zed-industries/zed/assets/71973804/42fa9acf-ec10-4247-a5e3-2d4fe664ded6)


Release Notes:

- N/A
2024-06-15 15:23:00 -07:00
Conrad Irwin
fc19cc0ddf
vim: ctrl-r while we're on a register kick (#13085)
Release Notes:

- vim: Support `ctrl-r X` to paste in insert mode (#4308)
2024-06-14 22:38:38 -06:00
Conrad Irwin
e6def62c23
Silence git related errors on linux (#13083)
It's hard to imagine a world where we should package this on linux.

Release Notes:

- N/A
2024-06-14 22:38:13 -06:00
Joseph T. Lyons
ff2347dff5
Add events for identifying node projects (#13078)
Release Notes:

- N/A
2024-06-15 00:34:04 -04:00
Marshall Bowers
6319ae0b4a
extension_cli: Allow building without dynamically linking WebRTC (#13080)
This PR fixes an issue where the `zed-extension` CLI could no longer be
run as a static binary due to the following error:

```
dyld[36964]: Library not loaded: @rpath/WebRTC.framework/WebRTC
  Referenced from: <56332E1D-292E-3F9B-97B9-8A9962D21599> /Users/maxdeviant/projects/zed-extensions/zed-extension
  Reason: no LC_RPATH's found
fish: Job 1, './zed-extension --scratch-dir .…' terminated by signal SIGABRT (Abort)
```

This is the result of the addition of a dependency on `workspace` to the
`extension` crate (and thus, the `extension_cli` crate) in #12360.

Since we don't actually _need_ WebRTC in the extension CLI, we don't
care about dynamically linking it.

To resolve this, a new `no-webrtc` feature has been added to the
`live_kit_client` client crate and threaded through all of the crates
between it and the `extension_cli`.

Enabling the `no-webrtc` feature will prevent linking to the LiveKit
Swift SDK as well as linking the WebRTC framework.

Release Notes:

- N/A
2024-06-14 20:13:31 -04:00
Max Brunsfeld
a8bd602334 Remove stray eprintln 2024-06-14 16:11:24 -07:00
Max Brunsfeld
af45db6d1e
Fix FS-related issues that were causing a test failure on linux (#13072)
This fixes `project_tests::rescan_and_remote_updates` .

That test was actually correctly failing, revealing two bugs on Linux.

Release Notes:

- Fixed an issue where file renames were not detected on Linux.
- Fixed performance problems caused by excessive file system events on
Linux.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-14 16:03:34 -07:00
Conrad Irwin
fab4b01655
Make linux prompts a bit better (#13067)
Also prompt with a sensible error on install:cli

Release Notes:

- N/A
2024-06-14 16:40:54 -06:00
Conrad Irwin
411ee7a47c
Move keyboard focus when foregrounding windows on X11 (#13071)
Release Notes:

- N/A
2024-06-14 16:16:03 -06:00
Joseph T. Lyons
d5a6ca4914
Add os_name and os_version to all event types (#13063)
Release Notes:

- N/A
2024-06-14 16:38:08 -04:00
Marshall Bowers
ea69846281
Silence error logs in zed tests (#13069)
This PR silences the remaining error logs in the `zed` crate tests by
initializing `env_logger` in test mode.

This means that the logs will no longer be shown unless `--nocapture` is
passed to `cargo test`.

Release Notes:

- N/A
2024-06-14 16:30:15 -04:00
Kirill Bulatov
ff8486e67f
Properly align excerpt and outline items (#13070) 2024-06-14 23:26:07 +03:00
Marshall Bowers
9bc3c6810b
Register Markdown language in some tests to silence error logs (#13066)
This PR registers the Markdown language in some of the tests in the
`zed` crate to silence the error logs about the language not being found
when the chat panel attempts to load it.

Release Notes:

- N/A
2024-06-14 15:29:20 -04:00
Conrad Irwin
45ae0dcc2d
Fix dw at the end of a soft wrapped line (#13065)
Co-Authored-By: Richard <richard@zed.dev>
Release Notes:

- vim: Fixed behavior of `dw` at the end of a soft wrapped line

Co-authored-by: Richard <richard@zed.dev>
2024-06-14 13:18:28 -06:00
Joseph T. Lyons
e40c49a143
Fix incorrect data being assigned to os_name (#13064)
Release Notes:

- N/A
2024-06-14 14:40:22 -04:00
versecafe
0d43d484f6
Use square buttons for code action and run indicators in the gutter (#12906)
### Before

<img width="94" alt="Screenshot 2024-06-14 at 1 34 54 PM"
src="https://github.com/zed-industries/zed/assets/1486634/fe756434-f072-4506-8fd2-c220c17cf112">

<img width="115" alt="Screenshot 2024-06-14 at 1 35 04 PM"
src="https://github.com/zed-industries/zed/assets/1486634/e378f02b-cb55-467d-9a5e-04e162d6daab">

### After

<img width="128" alt="Screenshot 2024-06-14 at 1 34 27 PM"
src="https://github.com/zed-industries/zed/assets/1486634/3d857a85-7673-43b1-8c48-56766455dd81">

<img width="134" alt="Screenshot 2024-06-14 at 1 34 33 PM"
src="https://github.com/zed-industries/zed/assets/1486634/b04c1fef-0a30-4eb1-b8f7-4eff351fcdc7">


Release Notes:

- Improved the look of code action and run indicators in the gutter
([#12803](https://github.com/zed-industries/zed/issues/12803)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-06-14 14:21:16 -04:00
Marshall Bowers
6ca09bd4ba
project: Disable project_tests::test_rescan_and_remote_updates on Linux (#13062)
This PR disables the
`project::project_tests::test_rescan_and_remote_updates` test on Linux,
as we've been seeing it fail quite consistently in CI.

We can re-enable it once we've had a chance to investigate and fix.

Release Notes:

- N/A
2024-06-14 14:20:52 -04:00
Kyle Kelley
53f702c92f
Allow Ollama Model KeepAlive to be None, defaulting to indefinite (#13059)
Putting this back to `Option<KeepAlive>` to make existing configs keep
working.

Release Notes:

- N/A
2024-06-14 10:33:28 -07:00
Conrad Irwin
993109aee1
Fix panic in worktree scanning (#13057)
Release Notes:

- Fixed a panic when worktree paths are incorrectly relative.
2024-06-14 10:23:20 -07:00
张小白
4cb45e63f4
windows: Update windows-rs crate and better error handling in DirectWrite (#12818)
- Update `windows-rs` from `0.56` to `0.57`
- Use the newly introduced `Owned` struct in `0.57` to handle the RAII
stuff of `HANDLE`
- Better error handling in `DirectWrite`

Release Notes:

- N/A
2024-06-14 10:12:20 -07:00
Kyle Kelley
1413b5af93
Select the first available model when none configured for Ollama (#13048)
Selects the first available model for Ollama if a model is not
configured.

Release Notes:

- N/A
2024-06-14 09:35:13 -07:00
Kyle Kelley
d9c21b4eb1
Accept numeric keep alive in Ollama settings (#13046)
This adds the ability to set the keep alive as an integer, including
`-1` for staying alive indefinitely until a new model is loaded or
Ollama exits. I've also set the default to `-1` so that models stay
ready to go for Zed to use.

Release Notes:

- N/A
2024-06-14 09:35:04 -07:00
Marshall Bowers
44f66aa426
rustdoc: Add CrateName newtype (#13056)
This PR adds a `CrateName` newtype used to represent crate names.

This makes the code a bit more self-descriptive and prevents confusing
other string values for a crate name.

It also changes the internal representation from a `String` to an
`Arc<str>` for cheaper clones.

Release Notes:

- N/A
2024-06-14 12:21:03 -04:00
Conrad Irwin
3b84b106e2
vim gigv (#13028)
Release Notes:

- vim: Fix `gi` when the insert ended at the end of a line (#12162)
- vim: Add `gv` to restore previous visual selection (#12888)
- vim: Fix `gl` when the first match is at the end of a line
2024-06-14 10:16:59 -06:00
Marshall Bowers
3539a7c04a
Fix a cargo doc warning in the zed crate (#13054)
This PR fixes a warning I observed when running `cargo doc` against the
`zed` crate:

```
 Documenting zed v0.141.0 (/Users/maxdeviant/projects/zed/crates/zed)
warning: this URL is not a hyperlink
   --> crates/zed/src/main.rs:860:69
    |
860 |     /// URLs can either be file:// or zed:// scheme, or relative to https://zed.dev.
    |                                                                     ^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://zed.dev.>`
    |
    = note: bare URLs are not automatically turned into clickable links
    = note: `#[warn(rustdoc::bare_urls)]` on by default
```

Release Notes:

- N/A
2024-06-14 11:41:11 -04:00
Kirill Bulatov
a8481099ca
Prefer the same order of entries inside outline and project panels, project search multi buffer (#13044)
Release Notes:

- N/A
2024-06-14 18:33:36 +03:00
Bennet Bo Fenner
0d8e6e6b12
assistant: Add diagnostics slash command (#12998)
This adds a `diagnostics` command to the assistant which allows to
inject compile errors/warnings into the context.

Release Notes:

- N/A
2024-06-14 17:14:50 +02:00
Peter Tripp
0f59607100
docs: wrap_guides (#12992)
- Add 'wrap_guides' to website config docs.
- Add the word 'ruler' to improve searchability.
2024-06-14 09:48:25 -04:00
Piotr Osiewicz
902d7150fe
collab_ui: Re-enable deafening and screen share on Mac (#13040)
Fixes regression from https://github.com/zed-industries/zed/pull/12994
Release Notes:

- N/A
2024-06-14 15:47:53 +02:00
Piotr Osiewicz
55ba80ddd1
lsp: Add support for label_details in completions (#13043)
This fixes an issue reported by @Spoutnik97 in
https://github.com/zed-industries/zed/issues/12711#issuecomment-2163785111
- vtsls returns auxiliary docs via .label_details and not plain .details
field.

Release Notes:

- Improved quality of auxiliary details in completions returned by VTSLS
2024-06-14 13:49:08 +02:00
Piotr Osiewicz
dcb8dc16ca
editor: Update insert_text_format based on resolved completion (#13041)
Fixes #12920

VTSLS does not mark snippet completions as such in the initial
completion response - not until we resolve them; however, we do not
touch initial contents of completion during resolution, which led to us
not treating a snippet as such.

Release Notes:

- Fixed snippet completions sometimes being treated as plain text
completions when using VTSLS
2024-06-14 13:31:02 +02:00
Kirill Bulatov
eb7a09b459
Add excerpts into outline panel (#13034)
Follow-up of https://github.com/zed-industries/zed/pull/12637

Adds excerpt items into the outline panel: now all outline items are
initially hidden under excerpt items that could be toggled open/closed
similar to directories.


![Screenshot 2024-06-14 at 10 45
04](https://github.com/zed-industries/zed/assets/2690773/9c9ef91b-1666-43c3-acc4-96f850098a28)

On active editor's selection change, a corresponding outline will be
revealed still, expanding the corresponding excerpt

![Screenshot 2024-06-14 at 10 45
13](https://github.com/zed-industries/zed/assets/2690773/7dfd14f7-4aca-48f2-8760-8e1362b9a043)

Release Notes:

- N/A
2024-06-14 12:03:16 +03:00
Angelo.Mateus
64bb79b71d
Allow held key events if key is modifier (#13000)
Release Notes:

- (Fixed) Allows held down key events for modifier keys.
([#12566](https://github.com/zed-industries/zed/issues/12566))

---------

Co-authored-by: Angelo <>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-13 20:54:59 -06:00
Conrad Irwin
a5af5b2883
Multicursor vim registers (#13025)
Release Notes:

- vim: Added support for multicursor registers (#11687)
- vim: Added support for the `"/` register
2024-06-13 20:32:58 -06:00
Yan Qian
8edfd0a963
ui: Fix doctest (#12985)
Fix the documentation tests failed when running `cargo test --workspace`

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-06-13 20:32:41 -04:00
Owen Law
0ed5327b1c
Fix Flatpak desktop entry (#13019)
Fixes a problem where the env variable was being set in the wrong spot
in #12951

Release Notes:

- N/A
2024-06-13 20:23:49 -04:00
Mikayla Maki
10d3ad4e33
Enable linux tests (#12493)
Note:
- We have disabled all tests that rely on Postgres in the Linux CI. We
only really need to test these once, and as macOS is our team's primary
platform, we'll only enable them on macOS for local reproduction.
- We have disabled all tests that rely on the font metrics. We
standardized on Zed Mono in many fonts, but our CoreText Text System and
Cosmic Text System proved to be very different in effect. We should
revisit if we decide to standardize our text system across platforms
(e.g. using Harfbuzz everywhere)
- Extended the condition timeout significantly. Our CI machines are slow
enough that this is causing spurious errors in random tests.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-13 16:38:53 -07:00
Max Brunsfeld
066cdc2297
Fix panic when doing various cursor movements with a pending mouse selection (#13016)
This fixes a panic in the `SelectionsCollection::first_anchor` when
there was a pending mouse selection and no other selections. Until
recently, this method was only used in vim mode, but as of
53b0720d54,
it's also used in the normal `move_up` and `move_down` actions.

So until recently, the panic that this fixes could only happen in vim
mode.

Release Notes:

- Fixed a crash that could happen when using certain cursor-motion
bindings with a pending mouse selection.
2024-06-13 16:22:45 -07:00
Marshall Bowers
01ba1ddef7
gpui_macros: Disable doctests (#13015)
This PR disables the doctests in the `gpui_macros` crate, as they depend
on `gpui` to run.

Since `gpui` depends on `gpui_macros`, we don't really want to add a
dependency on `gpui` (even though it _appears_ to work as a dev
dependency).

Also did some minor stylistic cleanup of some doc comments.

Release Notes:

- N/A
2024-06-13 18:45:28 -04:00
Marshall Bowers
86167138a9
rustdoc: Automatically index crates (#13014)
This PR removes the need to use `/rustdoc --index <CRATE_NAME>` and
instead indexes the crates once they are referenced.

As soon as the first `:` is added after the crate name, the indexing
will kick off in the background and update the index as it goes.

Release Notes:

- N/A
2024-06-13 18:30:15 -04:00
Marshall Bowers
e0c1ab650e
rustdoc: Fix duplicated item path (#13013)
This PR fixes a bug that was introduced in #13011 where the item path
would get duplicated twice in the database key.

Release Notes:

- N/A
2024-06-13 18:21:52 -04:00
Marshall Bowers
6181ac6bad
rustdoc: Index crates progressively (#13011)
This PR updates the rustdoc indexing to be more progressive.

Rather than waiting until we've crawled the entire crate to begin
writing to the database, we instead start writing the docs as we go.

This makes it so you can start getting completions while the indexing is
still running.

Release Notes:

- N/A
2024-06-13 16:40:06 -04:00
Marshall Bowers
0705fb9b97
ui: Remove unused CollapsibleContainer component (#13009)
This PR removes the `CollapsibleContainer` component, as it wasn't used
anywhere.

Release Notes:

- N/A
2024-06-13 16:30:11 -04:00
Kyle Kelley
042be3529d
Add affordance for retry and button to visit Ollama library (#13003) 2024-06-13 13:25:24 -07:00
Marshall Bowers
1a40e98413
Render editor fold indicators using Disclosures (#13008)
This PR updates the spots where we render the fold indicators in editors
to use the `Disclosure` component instead of re-implementing similar UI.

This makes this UI more consistent across Zed.

Release Notes:

- N/A
2024-06-13 16:05:47 -04:00
Max Brunsfeld
af8e7af265
Keep symbol names in bundled linux binaries (#13006)
This ensures that linux panics still contain symbol names. It also
allows us to profile Zed on linux with `perf` and get symbol names.

Release Notes:

- N/A
2024-06-13 12:40:52 -07:00
Marshall Bowers
702fd8f168
ui: Render disclosures with IconButtonShape::Square (#13004)
This PR adjusts the `Disclosure` component to render using
`IconButtonShape::Square`.

This tightens up the hover styles so they aren't quite so massive.

### Before

<img width="116" alt="Screenshot 2024-06-13 at 3 22 43 PM"
src="https://github.com/zed-industries/zed/assets/1486634/dea8f8fb-a041-4aa7-89be-0cd2d7889955">

### After

<img width="113" alt="Screenshot 2024-06-13 at 3 23 02 PM"
src="https://github.com/zed-industries/zed/assets/1486634/7682cce6-4f83-4f3e-b91f-3023849bd314">

Release Notes:

- Tweaked the style of disclosure controls throughout the UI.
2024-06-13 15:39:06 -04:00
Conrad Irwin
2e758dcb64
X11: Fix black flashes on boot and while resizing (#13002)
Release Notes:

- N/A
2024-06-13 13:35:38 -06:00
Bennet Bo Fenner
38d9ee3731
project panel: Support dropping files from finder (#12880)
Partially addresses #7386 



https://github.com/zed-industries/zed/assets/53836821/fc2e9864-40a8-4ada-ac95-a76a31c44437



Release Notes:

- Added support for dropping files from the finder onto the project
panel
2024-06-13 20:48:28 +02:00
Conrad Irwin
95c69d0696
Fix git watching on linux (#12989)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-06-13 11:59:57 -06:00
张小白
599102573a
windows: Implement window_appearance() and should_auto_hide_scrollbars() (#12527)
Release Notes:

- N/A
2024-06-13 10:52:53 -07:00
Max Brunsfeld
da281d6d8f
Fix issues where screen and window sizes contained Pixels, but were declared as DevicePixels (#12991)
On most platforms, things were working correctly, but had the wrong
type. On X11, there were some problems with window and display size
calculations.

Release Notes:

- Fixed issues with window positioning on X11

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-13 10:48:37 -07:00
张小白
22dc88ed3d
windows: Fix scrolling bug (#12431)
Closes #12369 



https://github.com/zed-industries/zed/assets/14981363/14df820e-9be3-4b89-882b-a083ea42d59e



Release Notes:

- N/A
2024-06-13 10:48:20 -07:00
Piotr Osiewicz
14bf07c916
worktree: Fix race condition when a root of worktree is .git directory (#12995)
It was possible to unload a root of worktree when it was a .git
directory; due to that, test_fs_events_in_dot_git_worktree was sometimes
stuck in an infinite loop on CI.

The gist of an issue is that when .git dir is a root dir, then modifying
a file within this directory could sometimes unload the .git dir; the
test went into an infinite loop when the first event in an filesystem
stream was not the event for the file creation, but for a dir
modification. In that case we'd unload the root directory and a
subsequent event for file creation would never be registered, leading to
the test being stuck waiting for it to happen.

This commit alleviates it by special-casing worktrees rooted in .git
directories.



Release Notes:

- Fixed a possible hang when opening a worktree in .git directory.
2024-06-13 19:24:41 +02:00
Mikayla Maki
284559742d
Disable mic and screenshare buttons on non-macOS platforms (#12994)
Release Notes:

- N/A
2024-06-13 10:16:10 -07:00
Marshall Bowers
85acc2be44
Persist index for /rustdoc in LMDB (#12988)
This PR updates the `/rustdoc` command with persistence for the
documented rustdoc items.

Now when you run `/rustdoc --index <CRATE_NAME>` it will index the crate
and store the results in LMDB.

The documented items will then be read from the database when searching
using `/rustdoc` and persist across restarts of Zed.

Release Notes:

- N/A
2024-06-13 12:07:26 -04:00
Conrad Irwin
e2cfbc54ad
Fix headless mode (#12960)
This was broken by two things:
1. A merge conflict in the install.sh script leading to bad sh syntax
2. A return removed by accident when we refactored main

Release Notes:

- N/A
2024-06-13 07:59:28 -06:00
Piotr Osiewicz
0a13b9ee01
lsp: Provide completion reason in the request (#12893)
This should help LS make a better call about the completions it should
return back to the caller. For example, it speeds up import completions
for typescript.
Before: 


https://github.com/zed-industries/zed/assets/24362066/b38fd565-f9ff-4db7-a87f-c3b31a9fdc96

after: 


https://github.com/zed-industries/zed/assets/24362066/d4fbc9ae-9aab-4543-b9f6-16acf1619576


This should be merged after 06.12 Preview to give it some time on
Nightly.

Release Notes:

- N/A
2024-06-13 14:38:34 +02:00
Piotr Osiewicz
eb7b5a7131
project panel: Improve performance in worktrees with lots of files. (#12980)
When working on a repro for a different issue that involved a worktree
with lots of files (100k to be precise), UI became pretty unresponsive.
I pinned it down to us repeatedly preparing a HashSet of all paths in
the currently-scrolled-to worktree, once per each entry in the range
passed to for_each_visible_range (which is e.g. called during
rendering).

This PR makes that hashing happen just once per worktree. Additionally,
we no longer iterate over (potentially) all entries in a given worktree
when calculating the depth of a given entry.

Note that we could probably be smarter about this still; instead of
recalculating the hashset per each call to for_each_visible_entry, we
could do it whenever we update entries in the project panel. However,
with this PR I wanted to get a quick bang for a small buck; I'm pretty
confident in the change as is, it is relatively straightforward and
messing with worktree updates is more involved.



Release Notes:

- Improvement performance of project panel in large worktrees
2024-06-13 14:20:38 +02:00
Piotr Osiewicz
7798f64d1b
chore: Bump lsp-types to 0.97.0 (#12928)
This also includes https://github.com/gluon-lang/lsp-types/pull/287,
which should significantly reduce the time it takes for us to
deserialize completion lists.


Release Notes:
- N/A
2024-06-13 13:48:12 +02:00
Kirill Bulatov
2f43d52e7e
A set of outline panel fixes (#12965)
Follow-up of https://github.com/zed-industries/zed/pull/12637

* Wrong font size for the outline items (fixes
https://github.com/zed-industries/zed/pull/12637#issuecomment-2164084021)
* Duplicate context menu item (fixes
https://github.com/zed-industries/zed/issues/12957)
* Missing `space` keybinding for item opening (fixes
https://github.com/zed-industries/zed/issues/12956)
* Adds 60px more to the default width (fixes
https://github.com/zed-industries/zed/issues/12955)
* Incorrect scroll for singleton buffers (fixes
https://github.com/zed-industries/zed/issues/12953)

Release Notes:

- N/A
2024-06-13 10:46:51 +03:00
Antonio Scandurra
e1f4dfc068
Refine inline transformation UX (#12939)
https://github.com/zed-industries/zed/assets/482957/1790e32e-1f59-4831-8a4c-722cf441e7e9



Release Notes:

- N/A

---------

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2024-06-13 08:35:22 +02:00
Joey Riches
f780504b68
zed.desktop.in: Don't hardcode executable name due to binary conflicts (#12951)
> * There are a couple of other `zed` binaries that may be present on
linux systems
    ([1](https://openzfs.github.io/openzfs-docs/man/v2.2/8/zed.8.html),
[2](https://zed.brimdata.io/docs/commands/zed)). If you want to rename
our CLI
binary because of these issues, we suggest `zedit`, `zeditor`, or
`zed-cli`.

Due to aformentioned issue don't hardcode the executable name in the
.desktop file so envsubst can change it in accordance with the
distributor's requirement.

Resolves #12290.

Release Notes:

- N/A
2024-06-12 17:41:25 -07:00
Max Brunsfeld
76b0120665
Reveal the selected item when cycling a picker's selection (#12950)
Release Notes:

- Fixed a bug where the selected tab was not always shown when cycling
between tabs with `ctrl-tab`.
2024-06-12 17:40:53 -07:00
Marshall Bowers
0ac9af94e0
assistant: Add MVP for /rustdoc using indexed docs (#12952)
This PR adds an MVP of retrieving docs using the `/rustdoc` command from
an indexed set of docs.

To try this out:

1. Build local docs using `cargo doc`
2. Index the docs for the crate you want to search using `/rustdoc
--index <CRATE_NAME>`
    - Note: This may take a while, depending on the size of the crate
3. Search for docs using `/rustdoc my_crate::path::to::item`
    - You should get completions for the available items

Here are some screenshots of it in action:

<img width="640" alt="Screenshot 2024-06-12 at 6 19 20 PM"
src="https://github.com/zed-industries/zed/assets/1486634/6c49bec9-d084-4dcb-a92c-1b4c557ee9ce">

<img width="636" alt="Screenshot 2024-06-12 at 6 52 56 PM"
src="https://github.com/zed-industries/zed/assets/1486634/636a651c-7d02-48dc-b05c-931f33c49f9c">

Release Notes:

- N/A
2024-06-12 19:33:31 -04:00
Kirill Bulatov
8451dba6a7
Introduce an outline panel (#12637)
Adds a new panel: `OutlinePanel` which looks very close to project
panel:

<img width="256" alt="Screenshot 2024-06-10 at 23 19 05"
src="https://github.com/zed-industries/zed/assets/2690773/c66e6e78-44ec-4de8-8d60-43238bb09ae9">

has similar settings and keymap (actions work in the `OutlinePanel`
context and are under `outline_panel::` namespace), with two notable
differences:
* no "edit" actions such as cut/copy/paste/delete/etc.
* directory auto folding is enabled by default

Empty view: 
<img width="841" alt="Screenshot 2024-06-10 at 23 19 11"
src="https://github.com/zed-industries/zed/assets/2690773/dc8bf37c-5a70-4fd5-9b57-76271eb7a40c">


When editor gets active, the panel displays all related files in a tree
(similar to what the project panel does) and all related excerpts'
outlines under each file.
Same as in the project panel, directories can be expanded or collapsed,
unfolded or folded; clicking file entries or outlines scrolls the buffer
to the corresponding excerpt; changing editor's selection reveals the
corresponding outline in the panel.

The panel is applicable to any singleton buffer:
<img width="1215" alt="Screenshot 2024-06-10 at 23 19 35"
src="https://github.com/zed-industries/zed/assets/2690773/a087631f-5c2d-4d4d-ae25-30ab9731d528">

<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/e4f8082c-d12d-4473-8500-e8fd1051285b">

or any multi buffer:

(search multi buffer)

<img width="1728" alt="Screenshot 2024-06-10 at 23 19 41"
src="https://github.com/zed-industries/zed/assets/2690773/60f768a3-6716-4520-9b13-42da8fd15f50">

(diagnostics multi buffer)
<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/64e285bd-9530-4bf2-8f1f-10ee5596067c">

Release Notes:
- Added an outline panel to show a "map" of the active editor
2024-06-12 23:22:52 +03:00
Marshall Bowers
6fa347dff7
Move rustdoc-related code to rustdoc crate (#12945)
This PR moves the rustdoc-related code out of `html_to_markdown` and
into the `rustdoc` crate.

Release Notes:

- N/A
2024-06-12 15:53:05 -04:00
Marshall Bowers
c3df9b79c6
Start on rustdoc crawler (#12942)
This PR adds a first pass at a rustdoc crawler.

We'll be using this to get information about a crate from the rustdoc
artifacts for use in the Assistant.

Release Notes:

- N/A

---------

Co-authored-by: Richard <richard@zed.dev>
2024-06-12 15:21:50 -04:00
Marshall Bowers
72dac24acf
Add missing LICENSE file to ollama crate (#12943)
This PR adds a missing LICENSE file to the recently-added `ollama`
crate.

Also added the missing `lints.workspace = true` to the `Cargo.toml`.

Release Notes:

- N/A
2024-06-12 15:12:36 -04:00
Paul Eguisier
001f17c011
vim: Implement named registers (#12895)
Release Notes:

- vim: Add support for register selection `"a`-`"z`, `"0`-`"9`, `"-`.
`"_` and `"%`
([#11511](https://github.com/zed-industries/zed/issues/11511))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-12 10:40:27 -06:00
Joseph T Lyons
3c3dad6830 v0.141.x dev 2024-06-12 12:35:03 -04:00
Conrad Irwin
1b28f93c64
Make notification windows not have titles on X11 (#12935)
Co-Authored-By: Max <max@zed.dev>

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-06-12 10:27:40 -06:00
Kyle Kelley
bee3441c78
Ollama improvements (#12921)
Attempt to load the model early on when the user has switched the model.

This is a follow up to #12902

Release Notes:

- N/A
2024-06-12 08:10:51 -07:00
claytonrcarter
5e9f9b4edd
Wrap JS/TS runnables in quotes (#12932)
Some of the runnables added in #12118 don't work for tests (or code)
that contain spaces. In other words, the runnable for a test like
```js
it('does the thing', () => ...)
```
would end up w/ something like `npx jest does the thing
/path/to/file.spec.js`, but what we really want is `npx jest
--testNamePattern "does the thing" /path/to/file.spec.js`. A similar
thing was happening for the "node execute selection" runnable: selecting
`let foo = 1` would run `node -e let foo = 1`, not `node -e "let foo =
1"`.

In my (somewhat limited?) experience, it's very common for tests like
these to include spaces, and of course a code selection is almost
certain to contain whitespace.

Not covered: 
- this just blindly wraps quotes around the symbol/code; in the future
it may make sense to try to figure out *what type of quote* to use. (eg
`it('does the "thing"', () => ...)` is a valid test name, but
`--testNamePattern "does the "thing""` would not work. Note the doubled
quotes.)
- I did not wrap the filenames in quotes to escape those for the shell,
nor did I test if that's actually an issue. In my experience, I've not
seen many (any?) test files that contain spaces in the name, but I
suspect that it would be an issue if a containing dir includes spaces.
(eg `npx jest ... /path/to/My Documents/Code/file.spec.js`

/cc @RemcoSmitsDev 

Release Notes:

- Fixed some runnables in Javascript/Typescript
2024-06-12 14:58:04 +02:00
Chung Wei Leong
ec95a33d8c
Added TSX test runnables (#12922)
Fix #12884

Release Notes:

- Added runnable tests for TSX files.

---
Runnable tests can be customized via `tsx-test` tag

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-06-12 11:02:24 +02:00
maan2003
b82350979f
linux: Use filesystem based unix socket instead of abstract namespace (#12756)
Release Notes:

- N/A

fixes: unable to launch multiple zed instances even if the support dirs
are different(example: bwrap based sandboxing)
2024-06-11 19:17:07 -06:00
Mikayla Maki
ab41eddd8b
Fix cursors on some GNOME installations (#12914)
This PR adds support for `org.gnome.desktop.interface`'s `cursor-theme`
setting on Wayland. This should fix cursors not showing up on some GNOME
installs. This PR also adds the wiring to watch the current cursor theme
value.

Thanks to @apricotbucket28 for helping debug the issue.

Release Notes:

- N/A
2024-06-11 17:39:25 -07:00
Kyle Kelley
4cb8d6f40e
Ollama Provider for Assistant (#12902)
Closes #4424.

A few design decisions that may need some rethinking or later PRs:

* Other providers have a check for authentication. I use this
opportunity to fetch the models which doubles as a way of finding out if
the Ollama server is running.
* Ollama has _no_ API for getting the max tokens per model
* Ollama has _no_ API for getting the current token count
https://github.com/ollama/ollama/issues/1716
* Ollama does allow setting the `num_ctx` so I've defaulted this to
4096. It can be overridden in settings.
* Ollama models will be "slow" to start inference because they're
loading the model into memory. It's faster after that. There's no UI
affordance to show that the model is being loaded.

Release Notes:

- Added an Ollama Provider for the assistant. If you have
[Ollama](https://ollama.com/) running locally on your machine, you can
enable it in your settings under:

```jsonc
"assistant": {
    "version": "1",
    "provider": {
      "name": "ollama",
      // Recommended setting to allow for model startup
      "low_speed_timeout_in_seconds": 30,
    }
}
```

Chat like usual

<img width="1840" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/4e0af266-4c4f-4d9e-9d74-1a91f76a12fe">

Interact with any model from the [Ollama
Library](https://ollama.com/library)

<img width="587" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/87433ac6-bf87-4a99-89e1-96a93bf8de8a">

Open up the terminal to download new models via `ollama pull`:


![image](https://github.com/zed-industries/zed/assets/836375/af7ec411-76bf-41c7-ba81-64bbaeea98a8)
2024-06-11 17:35:27 -07:00
Marshall Bowers
127b9ed857
project_panel: Don't show file icon during rename when file icons are otherwise hidden (#12910)
This PR fixes an instance where the file icon for a project panel entry
would be shown during a rename even when the `project_panel.file_icons`
setting was set to `false`.

Resolves #12905.

Release Notes:

- Fixed an issue where file icons were displayed in the project panel
during a rename even when `project_panel.file_icons` was set to `false`
([#12905](https://github.com/zed-industries/zed/issues/12905)).
2024-06-11 19:45:47 -04:00
Mikayla Maki
c30f6a1582
Fix alt key getting stuck when tabbing on linux (#12912)
Release Notes:

- N/A
2024-06-11 15:14:01 -07:00
Marshall Bowers
8ccd2a0c99
Add tag handler for collecting crate items from rustdoc output (#12903)
This PR adds a tag handler for collecting crate items from rustdoc's
HTML output.

This will serve as the foundation for getting more insight into a
crate's contents.

Release Notes:

- N/A
2024-06-11 15:56:37 -04:00
Marshall Bowers
57b87be3a0
Hoist indexmap to workspace level (#12901)
This PR hoists `indexmap` up to a workspace dependency.

Release Notes:

- N/A
2024-06-11 15:31:55 -04:00
Mikayla Maki
80c14c9198
Pull app / OS info out of GPUI, add Linux information, make fallible window initialization (#12869)
TODO:
- [x] Finish GPUI changes on other operating systems 

This is a largely internal change to how we report data to our
diagnostics and telemetry. This PR also includes an update to our blade
backend which allows us to report errors in a more useful way when
failing to initialize blade.


Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-11 11:43:12 -07:00
Thorsten Ball
ec9e700e70
linux/x11: Mark windows as destroyed after destroy request (#12892)
Turns out we still get FocusOut and UnmapNotify events after the window
has been destroyed, which resulted in error messages popping up because
we can't find the window anymore that we want to mark as unfocused.



Release Notes:

- N/A
2024-06-11 17:23:48 +02:00
Conrad Irwin
a06189bbed
Fix most vim tests on linux (#12873)
Fixes most vim tests on linux (and a few editor ones) by loading Zed
Mono
instead of relying on the system fallback stack.

Release Notes:

- N/A
2024-06-11 08:27:55 -06:00
Antonio Scandurra
53b0720d54
Remove headers from prompt library picker (#12889)
Also, as a drive-by, we're fixing up/down not working in inline
assistant editor.

Release Notes:

- N/A
2024-06-11 15:59:30 +02:00
Piotr Osiewicz
b6ea393d14
lsp: Add support for linked editing range edits (HTML tag autorenaming) (#12769)
This PR adds support for [linked editing of
ranges](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange),
which in short means that editing one part of a file can now change
related parts in that same file. Think of automatically renaming
HTML/TSX closing tags when the opening one is changed.
TODO:
- [x] proto changes
- [x] Allow disabling linked editing ranges on a per language basis.

Fixes #4535 

Release Notes:
- Added support for linked editing ranges LSP request. Editing opening
tags in HTML/TSX files (with vtsls) performs the same edit on the
closing tag as well (and vice versa). It can be turned off on a language-by-language basis with the following setting:
```
  "languages": {
    "HTML": {
      "linked_edits": true
    },
  }
```

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-06-11 15:52:38 +02:00
Antonio Scandurra
98659eabf1
Overhaul inline assistant (#12846)
This pull request introduces a new diff mechanism that helps users
understand exactly which lines were changed by the LLM.

Release Notes:

- N/A
2024-06-11 12:39:45 +02:00
Thorsten Ball
3722275cfa
linux/x11: Only create ModifiersChanged event if they changed (#12879)
I noticed that when I use my mouse wheel, we get a ton of the
`XkbStateNotify` events, but the modifiers don't change, so we add a ton
of useless input events for the window.

Release Notes:

- N/A
2024-06-11 11:00:26 +02:00
Conrad Irwin
44a58647e4
Wait for composition to end before sending InputIgnored (#12871)
Release Notes:

- vim: Fixed `f`/`t` etc. for keys that require IME (#12522)
2024-06-10 20:03:21 -06:00
Conrad Irwin
4e98c23463
Reconnect button for remote projects (#12669)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-06-10 18:09:47 -06:00
Marshall Bowers
2509af723f
assistant: Improve JSON handling in /fetch command (#12864)
This PR improves the `/fetch` command with better support for URLs that
return JSON content.

JSON response bodies will now be pretty-printed and placed within a
Markdown code block:

<img width="690" alt="Screenshot 2024-06-10 at 3 39 52 PM"
src="https://github.com/zed-industries/zed/assets/1486634/4a7c1cb7-9f5b-4a63-9e8e-5168bf9a6625">

Release Notes:

- Improved the handling of JSON response bodies in the `/fetch` command
in the Assistant.
2024-06-10 15:49:51 -04:00
Marshall Bowers
8078e58494
Remove unused color crate (#12860)
This PR removes the `color` crate, as it was not used anywhere.

We had added this experimentally, but right now its existence is just a
source of confusion.

Release Notes:

- N/A
2024-06-10 15:35:44 -04:00
Marshall Bowers
b69c3129d0
Add missing LICENSE file to proto crate (#12863)
This PR adds a missing LICENSE file to the recently-extracted `proto`
crate.

Release Notes:

- N/A
2024-06-10 15:35:37 -04:00
Antonio Scandurra
77e88c1ded
Extract a proto crate out of rpc (#12852)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-06-10 12:49:53 -06:00
Marshall Bowers
57c40299a5
Show extension download counts with thousands separators (#12857)
This PR adjusts the extension download counts to be displayed using
thousands separators.

Release Notes:

- Adjusted extension download counts to display with thousands
separators (e.g., `1,000,000`).
2024-06-10 14:19:17 -04:00
Marshall Bowers
0d5485bd6c
assistant: Add /now slash command (#12856)
This PR adds a `/now` command to the Assistant for indicating the
current date and time to the model.

Release Notes:

- Added `/now` command to the Assistant for getting the current date and
time.
2024-06-10 14:05:02 -04:00
Thorsten Ball
05b6581147
linux/x11: handle XIM events sync to reduce lag (#12840)
This helps with the problem of keyboard input feeling laggy when the
event loop is under load.

What would previously happen is:

- N events from X11 arrive
- N events get forwarded to XIM
- N events are handled in N iterations of the event loop (sadly, yes: we
only seem to be getting back one `ClientMessage` per poll from XCB
connection)
- Each event is pushed into the channel
- N event loop iterations are needed to get the events off the channel
and handle them

With this change, we get rid of the last 2 steps: instead of pushing the
event onto a channel, we store it on the XIM handler itself, and then
work it off synchronously.

Usually one shouldn't block the event loop, but I think in this case -
user input! - it's better to handle the events directly instead of
re-enqueuing them again in a channel, where they can accumulate and need
multiple iterations of the loop to be worked off.

This does *not* fix the problem of input feeling choppy/slower when the
system is under load, but it makes the behavior now feel exactly the
same as when XIM is disabled.

I also think the code is easier to understand since it's more
straightforward.

Release Notes:

- N/A
2024-06-10 14:08:16 +02:00
Thorsten Ball
43d1a8040d
linux: run runnables only when event loop is idle (#12839)
This change ensures that the event loop prioritizes enqueueing another
render or handling user input over executing runnables.

It's a subtle change as a result of a week of digging into performance
on X11. It's also not perfect: ideally we'd get rid of the intermediate
channel here and had more control over when and how we run runnables vs.
X11 events, but I think short of rewriting how we use an event loop,
this is good cost/benefit change.

To illustrate:

Before this change, it was possible to block the app from rendering for
a long time by just creating a ton of futures that were executed on the
"main" thread (we don't have a "main" thread on Linux, but we have a
single thread in which we run the event loop).

That was relatively easy to reproduce by opening the `zed` repository
and starting `rust-analyzer`: at some point `rust-analyzer` sends us so
many notifications, that are all handled in futures, that the event loop
is busy just working off the runnables, never getting to the events that
X11 sends us or our own timer to re-enqueue another render.

When you put print statements into the code to show when which event was
handled, you'd see something like this **before this change**:

```
[ ... hundreds of runnable.run() ... ]
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
new render tick timer. lag: 56.942049ms
X11 event
new render tick timer. lag: 9.668µs
X11 event
new render tick timer. lag: 9.955µs
X11 event
runnable.run()
runnable.run()
runnable.run()
runnable.run()
new render tick timer. lag: 12.462µs
X11 event
new render tick timer. lag: 14.868µs
X11 event
new render tick timer. lag: 11.234µs
X11 event
new render tick timer. lag: 11.681µs
X11 event
new render tick timer. lag: 13.926µs
X11 event
```

Note the `lag: 56ms`: that's the difference between when we wanted to
execute the callback that enqueues another render and when it ran.

Longer lags are possible, this is just the first one I grabbed from the
logs.

Now, compare this with the logs **after this change**:

```
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
new render tick timer. lag: 36.051µs
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
X11 event
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
runnable.run()
```

In-between many `runnable.run()` we'll always handle events.

So, in essence, what this change does is to introduce 2 priorities into
the X11 event queue:

- high: X11 events (user events, render events, ...), render tick, XIM
events, ...
- low: all async rust code

I've tested this with a debug build and release build and I think the
app now feels more responsive. It doesn't feel perfect still, especially
in the slow debug builds, but I couldn't observe 10s lockups anymore.

Since it's a pretty small change, I think we should go for it and see
how it behaves.

Thanks to @maan2003 this now also includes the same change to Wayland.

Release Notes:

- N/A

---------

Co-authored-by: maan2003 <manmeetmann2003@gmail.com>
2024-06-10 14:04:41 +02:00
Panghu
e829a8c3b0
Add auto-completion support for package.json files (#12792)
![截屏2024-06-08 07 56
41](https://github.com/zed-industries/zed/assets/21101490/da97e7d4-458b-4262-ac23-a4704af4f015)

Release Notes:

- Added auto-completion support for `package.json` files.
2024-06-08 13:33:29 +03:00
Arseny Kapoulkine
87845a349d
cpp: Highlight sized type specifiers as keywords (#12751)
Without this, `unsigned` or `unsigned int` is not highlighted properly:
`int` is a primitive_type but `unsigned` is a sized_type_specifier. This
is already handled in C as both are part of @type highlight group.

Before:

![image](https://github.com/zed-industries/zed/assets/1106629/7210b769-9dff-428c-9e4f-55b652f91674)

After:

![image](https://github.com/zed-industries/zed/assets/1106629/8661c412-30f0-4b44-a4a2-1860a0b56a4e)

Release Notes:

- N/A
2024-06-08 13:26:10 +03:00
Kirill Bulatov
953393f6ce
Rename workspace::Restart action into workspace::Reload (#12672)
Closes https://github.com/zed-industries/zed/issues/12609

Instead of adding some ordering mechanism to the actions, rename the
action so that it's not interfering with the `editor: restart language
server` command.

Before:

![image](https://github.com/zed-industries/zed/assets/2690773/b5e86eda-d766-49fc-a25b-f8b9fdb7b521)

![image](https://github.com/zed-industries/zed/assets/2690773/c5edeb56-12aa-496b-bb6f-dc705cbb9ae3)


After:

![image](https://github.com/zed-industries/zed/assets/2690773/ed30c68d-bfdd-4e00-bb5d-0be52fbe4e16)
![Screenshot 2024-06-05 at 09 46
25](https://github.com/zed-industries/zed/assets/2690773/9fe4eb52-0399-4321-85a9-3b07c11395ce)


Release Notes:

- Improved language server restart command ergonomics by renaming
`workspace::Restart` action into `workspace::Reload` to remove any other
"restart"-worded actions in the list
2024-06-08 13:23:59 +03:00
Conrad Irwin
75f8be6a0f
vim: add guu gUU g~~ g/ (#12789)
Release Notes:

- vim: Add `g/` for project search
2024-06-07 16:45:38 -06:00
Max Brunsfeld
e174f16d50
Refactor: Make it possible to share a remote worktree (#12775)
This PR is an internal refactor in preparation for remote editing. It
restructures the public interface of `Worktree`, reducing the number of
call sites that assume that a worktree is local or remote.

* The Project no longer calls `worktree.as_local_mut().unwrap()` in code
paths related to basic file operations
* Fewer code paths in the app rely on the worktree's `LocalSnapshot`
* Worktree-related RPC message handling is more fully encapsulated by
the `Worktree` type.

to do:
* [x] file manipulation operations
* [x] sending worktree updates when sharing

for later
* opening buffers
* updating open buffers upon worktree changes

Release Notes:

- N/A
2024-06-07 12:53:01 -07:00
slowlydev
aa60fc2f19
Use the new assistant icon in the setup instructions (#12787)
This is a PR with just a small visual adjustment, so instructions are
up-to-date with the new icon.
I did not remove the "old" ai.svg as I am not sure if its gonna be used
in the future or if its has been completely replaced by the new "zed
assistant" icon.

Release Notes:

- Fixed the wrong icon being used in the assistant setup instructions.

For open ai

<img width="543" alt="image"
src="https://github.com/zed-industries/zed/assets/61624214/5f18a8f4-6761-4df5-8482-92582545dee5">

and anthropic

<img width="544" alt="image"
src="https://github.com/zed-industries/zed/assets/61624214/6ca3ed23-0f68-4c0d-bc8a-32ab7c607029">

how it looked before (Zed Preview 0.139.3
0c083b7f38):

<img width="526" alt="image"
src="https://github.com/zed-industries/zed/assets/61624214/af9c9fa8-89ed-4f6a-88ca-b285b4c522c3">
2024-06-07 15:12:16 -04:00
Conrad Irwin
5548773b2e
vim: Add gU/gu/g~ (#12782)
Co-Authored-By: ethanmsl@gmail.com

Release Notes:

- vim: Added `gu`/`gU`/`g~` for changing case. (#12565)
2024-06-07 12:38:12 -06:00
Joseph T. Lyons
3eac83eece
Add event for yarn project identification (#12785)
Report a `open yarn project` `app_event` for each worktree where
`yarn.lock` is found and only report it once per session.

Release Notes:

- N/A
2024-06-07 14:30:38 -04:00
Marshall Bowers
243a0e764d
Block publishing of zed_extension_api v0.0.7 (#12784)
This PR adds a temporary block on publishing v0.0.7 of the
`zed_extension_api`.

We have breaking changes to the extension API that are currently staged
on `main` and are still being iterated on, so we don't want to publish
again until we're ready to commit to the new API.

This change is intended to prevent accidental publishing of the crate
before we're ready.

Release Notes:

- N/A
2024-06-07 14:16:21 -04:00
Conrad Irwin
6fa6e0718c
Check validity of new.range too (#12781)
I'm not certain yet how it could be invalid, but we are still seeing
panics here.

Release Notes:

- Fixed a panic when opening the diagnostics view
2024-06-07 11:48:23 -06:00
Marshall Bowers
834089feb1
Handle Wikipedia code blocks in /fetch command (#12780)
This PR extends the `/fetch` command with support for Wikipedia code
blocks.

Release Notes:

- N/A
2024-06-07 12:54:33 -04:00
Marshall Bowers
9174858225
Add basic Wikipedia support to /fetch (#12777)
This PR extends the `/fetch` slash command with the initial support for
Wikipedia's HTML structure.

Release Notes:

- N/A
2024-06-07 12:03:43 -04:00
Piotr Osiewicz
5f5e6b8616
workspace: Fix drag&dropping project panel entries into editor area (#12767)
Fixes #12733 

Release Notes:

- Fixed drag&dropping project panel entries into editor area & tab bar
2024-06-07 10:23:57 +02:00
Stanislav Alekseev
07dbd2bce8
Use rust-analyzer from path if possible (#12418)
Release Notes:

- Added support for looking up the `rust-analyzer` binary in `$PATH`. This allows using such tools as `asdf` and nix to configure per-folder rust installations. To enable this behavior, use the `path_lookup` key when configuring the `rust-analyzer` `binary`: `{"lsp": {"rust-analyzer": {"binary": {"path_lookup": true }}}}`.
2024-06-07 06:56:38 +02:00
Max Brunsfeld
48581167b7
Remove dependencies from the Worktree crate and make it more focused (#12747)
The `worktree` crate mainly provides an in-memory model of a directory
and its git repositories. But because it was originally extracted from
the Project crate, it also contained lingering bits of code that were
outside of that area:
* it had a little bit of logic related to buffers (though most buffer
management lives in `project`)
* it had a *little* bit of logic for storing diagnostics (though the
vast majority of LSP and diagnostic logic lives in `project`)
* it had a little bit of logic for sending RPC message (though the
*receiving* logic for those RPC messages lived in `project`)

In this PR, I've moved those concerns entirely to the project crate
(where they were already dealt with for the most part), so that the
worktree crate can be more focused on its main job, and have fewer
dependencies.

Worktree no longer depends on `client` or `lsp`. It still depends on
`language`, but only because of `impl language::File for
worktree::File`.

Release Notes:

- N/A
2024-06-06 11:16:58 -07:00
Paul Eguisier
2f057785f7
Maintain cursor to upper line in visual mode indent/outdent (#12582)
Release Notes:

- vim: Fix indent via `<` and `>` not being repeatable with `.`.
[#12351](https://github.com/zed-industries/zed/issues/12351)
2024-06-06 17:45:25 +02:00
Panghu
fd39f20842
Prevent folder expansion when all items are closed (#12729)
Release Notes:

- Prevent folder expansion when all items are closed

### Problem
When all items are closed, the next activated file expands (see the
video below).


https://github.com/zed-industries/zed/assets/21101490/a7631cd2-4e97-4954-8b01-d283dd4796be


### Cause
When the currently active item is closed, Zed tries to activate the
previously active item. Activating an item by default expands the
corresponding folder, which can result in folders being expanded when
all files are closed.

### Fixed Video


https://github.com/zed-industries/zed/assets/21101490/d30f05c5-6d86-4e11-b349-337fa75586f3
2024-06-06 17:32:58 +02:00
Nycheporuk Zakhar
3000f6ea22
Use cwd to run package.json script (#12700)
Fixes case when `package.json` is not in root directory. 
Usually in mono repository, where multiple `package.json` may be present

Release Notes:

- Fixed runnable for package.json in monorepos
2024-06-06 15:17:45 +03:00
Piotr Osiewicz
377e24b798
chore: Fix clippy for upcoming 1.79 Rust release (#12727)
1.79 is due for release in a week.
Release Notes:

- N/A
2024-06-06 12:46:53 +02:00
Antonio Scandurra
a0c0f1ebcd
Rename conversations to contexts (#12724)
This just changes nomenclature within the codebase and should have no
external effect.

Release Notes:

- N/A
2024-06-06 11:40:54 +02:00
Antonio Scandurra
70ce06cb95
Improve UX for saved contexts (#12721)
Release Notes:

- Added search for saved contexts.
- Fixed a bug that caused titles generate by the LLM to be longer than
one line.
2024-06-06 10:22:39 +02:00
Thorsten Ball
9a5b97db00
linux/x11: Don't surround selection when XMI composing (#12632)
On X11 I was unable to type ä ü and other umlauts in files with
autoclose enabled, because typing ä requires me to hit

- compose key
- `"`
- `a`

When the `"` was typed, Zed would insert a matching `"` because it had a
selection around the dead-key that was inserted by the compose key.

We ran into a similar issue in #7611, but in the case of the Brazilian
keyboard, the `"` is the compose key so we didn't trigger the matching
`"`, because we didn't have a selection yet.

What this does is it fixes the issue by making the
surround-selection-with-quotes-or-brackets also depend on the autoclose
settings, which is didn't do before. This is a breaking change for users
of a Brazilian keyboard layout in which `"` cannot be used to surround
an existing selection with quotes anymore.

That _might_ be a change that users notice, but I can't think of
scenario for that where the user wants, say, `"` to be NOT autoclosed,
but work with selections. (Example is Markdown, for which autoclose for
`"` is disabled. Do we want that but allow surrounding with quotes?)

So it fixes the issue and makes the behavior slightly more consistent,
in my eyes.

Release Notes:

- Changed the behavior of surrounding selections with brackets/quotes to
also depend on the auto-close settings of the language. This is a
breaking change for users of a Brazilian keyboard layout in which `"`
cannot be used to surround an existing selection with quotes anymore.

Before:

[Screencast from 2024-06-04
11-49-51.webm](https://github.com/zed-industries/zed/assets/1185253/6bf255b5-32e9-4ba7-8b46-1e49ace2ba7c)

After:

[Screencast from 2024-06-04
11-52-19.webm](https://github.com/zed-industries/zed/assets/1185253/3cd196fc-20ba-465f-bb54-e257f7f6d9f3)
2024-06-06 10:01:38 +02:00
Dhairya Nadapara
0b75afd322
chore: added inl to cpp config (#12710)
Screenshot:
<img width="1027" alt="image"
src="https://github.com/zed-industries/zed/assets/19250981/1d35d35c-d31c-4feb-b2ca-a417972fadf6">

Release Notes:

- Added `inl` to cpp config ([12605](https://github.com/zed-industries/zed/issues/12605))
2024-06-06 10:23:36 +03:00
Kirill Bulatov
a574036efd
Update the whitespace docs in the default settings file (#12717) 2024-06-06 08:29:01 +03:00
Nate Butler
611bf2d905
Update prompt library styles (#12689)
- Extend Picker to allow passing a custom editor. This allows creating a
custom styled input.
- Updates various picker styles

Before:

![CleanShot 2024-06-05 at 22 08
36@2x](https://github.com/zed-industries/zed/assets/1714999/96bc62c6-839d-405b-b030-31491aab8710)

After:

![CleanShot 2024-06-05 at 22 09
15@2x](https://github.com/zed-industries/zed/assets/1714999/a4938885-e825-4880-955e-f3f47c81e1e3)

Release Notes:

- N/A
2024-06-05 22:10:02 -04:00
Andrew Lygin
f476a8bc2a
editor: Add ToggleTabBar action (#12499)
This PR adds the `editor: toggle tab bar` action that hides / shows the
tab bar and updates the `tab_bar.show` setting in `settings.json`
accordingly.

First mentioned in
https://github.com/zed-industries/zed/pull/7356#issuecomment-2118445379.

Release Notes:

- Added the `editor: toggle tab bar` action.
2024-06-05 19:50:57 -06:00
Mikayla Maki
d3d0d01571
Adjust IME action buffering to only apply to insert actions (#12702)
Follow up to https://github.com/zed-industries/zed/pull/12678
fixes https://github.com/zed-industries/zed/issues/11829

In this solution, we only buffer Insert Text actions from the macOS IME.
The marked text and unmark actions are eagerly processed, so that the
IME state is synchronized with the editor state during multi step
pre-edit composition.

Release Notes:

- Fixed an issue where the IME pre-edit could desynchronize from the
editor on macOS
([#11829](https://github.com/zed-industries/zed/pull/12651)).

Co-authored-by: Conrad <conrad@zed.dev>
2024-06-05 16:13:03 -07:00
Marshall Bowers
29d29f5a90
assistant: Initialize the UI font in the prompt library window (#12701)
This PR fixes an issue where the prompt library did not properly have
the UI font or rem size set.

Since it is being opened in a new window, we need to re-initialize these
values the same way we do in the main window.

Release Notes:

- N/A
2024-06-05 17:41:03 -04:00
Bennet Bo Fenner
9824e40878
lsp: Handle responses in background thread (#12640)
Release Notes:

- Improved performance when handling large responses from language
servers

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-06-05 23:06:44 +02:00
Conrad Irwin
1ad8d6ab1c
Don't show backtraces in prompts (#12699)
Release Notes:

- N/A
2024-06-05 15:00:23 -06:00
CharlesChen0823
8745719687
vim: Fix g _ not having the expected behavior (#12607)
Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-05 15:00:13 -06:00
kshokhin
c7c19609b3
Search in selections (#10831)
Release Notes:

- Adding [#8617 ](https://github.com/zed-industries/zed/issues/8617)

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-05 13:42:51 -06:00
Conrad Irwin
428c143fbb
Add ability to scroll popovers with vim (#12650)
Co-Authored-By: ahmadraheel@gmail.com



Release Notes:

- vim: allow scrolling the currently open information overlay using
`ctrl-{u,d,e,y}`etc. (#11883)
2024-06-05 13:39:17 -06:00
Marshall Bowers
f3460d440c
html_to_markdown: Move TableHandler out of rustdoc (#12697)
This PR moves the `TableHandler` out of the `rustdoc` module, as it
doesn't contain anything specific to rustdoc.

Release Notes:

- N/A
2024-06-05 15:37:02 -04:00
Joseph T Lyons
a59dd7d06d v0.140.x dev 2024-06-05 12:23:48 -04:00
Conrad Irwin
868284876d
Bump alacritty to fix some file descriptor yuck (#12687)
https://github.com/alacritty/alacritty/pull/7996

Release Notes:

- Fixed a crash caused by bad file descriptor lifetime handling.
2024-06-05 09:12:05 -06:00
Antonio Scandurra
6bbe9a2253
Polish prompt library some more (#12686)
Release Notes:

- N/A
2024-06-05 16:55:37 +02:00
Antonio Scandurra
7a05db6d3d
Cancel inline assist editor on blur if it wasn't confirmed (#12684)
Release Notes:

- N/A
2024-06-05 16:31:45 +02:00
Antonio Scandurra
3587e9726b
Support wrapping and hard newlines in inline assistant (#12683)
Release Notes:

- Improved UX for the inline assistant. It will now automatically wrap
when the text gets too long, and you can insert newlines using
`shift-enter`.
2024-06-05 16:10:56 +02:00
Antonio Scandurra
a96782cc6b
Allow using the inline assistant in prompt library (#12680)
Release Notes:

- N/A
2024-06-05 14:46:33 +02:00
Nicholas Cioli
0289c312c9
editor: Render boundary whitespace (#11954)
![image](https://github.com/zed-industries/zed/assets/1240491/3dd06e45-ae8e-49d5-984d-3d8bdf98d983)

Added support for only rendering whitespace that is on a
boundary, the logic of which is explained below:

- Any tab character
- Whitespace at the start and end of a line
- Whitespace that is directly adjacent to another whitespace


Release Notes:

- Added `boundary` whitespace rendering option
([#4290](https://github.com/zed-industries/zed/issues/4290)).




---------

Co-authored-by: Nicholas Cioli <nicholascioli@users.noreply.github.com>
2024-06-05 14:02:55 +03:00
Kirill Bulatov
63a8095879
Revert "Fix a bug where the IME pre-edit would desync from Zed (#12651)" (#12678)
This reverts commit 1a0708f28c since after
that, default task-related keybindings (alt-t and alt-shift-t) started
to leave `†` and `ˇ` symbols in the text editors before triggering
actions.


Release Notes:

- N/A
2024-06-05 13:54:06 +03:00
Kirill Bulatov
1768c0d996
Do not occlude terminal pane by terminal element (#12677)
Release Notes:

- Fixed file drag and drop not working for terminal

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-06-05 13:43:18 +03:00
Antonio Scandurra
27e9c68988
Autocomplete commands that don't require access to workspace in prompt library (#12674)
This is useful to autocomplete prompts when writing a new one in the
prompt library.

Release Notes:

- N/A
2024-06-05 10:07:43 +02:00
Kirill Bulatov
ad2ddf1200
Omit clickable hunks when git hunks are disabled in the gutter (#12671)
Closes https://github.com/zed-industries/zed/issues/12644 

https://github.com/zed-industries/zed/pull/12425 fixes the issue so that
clicks are never reaching the hunks' hitboxes in such case, this PR
actually removes those hitboxes.
Hunks can still be toggled via the action.

Release Notes:

- N/A
2024-06-05 10:05:53 +03:00
Mikayla Maki
da29e33f50
Auto updater disabler (#12660)
Supersedes https://github.com/zed-industries/zed/pull/12659
Fixes https://github.com/zed-industries/zed/issues/12588

One of Zed's core features is our collaboration software. As such, it is
important that we notify the user when their RPC protocol is out of
date, and how to update it. This PR adds a mechanism to replace the
existing auto updater with a message explaining how to update Zed for
this environment.

Release Notes:

- N/A
2024-06-04 15:56:18 -07:00
Marshall Bowers
3fd118f8e1
html_to_markdown: Remove unused examples (#12658)
This PR removes the unused `examples` from the `html_to_markdown` crate.

I was just using these to dogfood the parsing initially, but now that
it's wired up in the Assistant, the examples are no longer useful.

Release Notes:

- N/A
2024-06-04 18:39:41 -04:00
Conrad Irwin
27beb9e697
Update linux binary expectations (#12622)
Fixes #12585

This changes the expectations for installed binaries on linux based on
work
that @jirutka has done for Alpine.

In particular, we now put the cli in place as `bin/zed` and the zed
binary as
`libexec/zed-editor`, and assume that packagers do the same.

cc @someone13574

Release notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-04 15:31:01 -07:00
Conrad Irwin
c7d56302d2
Always open the project panel for dev server projects (#12654)
Release Notes:

- N/A
2024-06-04 16:07:12 -06:00
Paul Eguisier
8a659b0c60
Implement Indent & Outdent as operators (#12430)
Release Notes:

- Fixes [#9697](https://github.com/zed-industries/zed/issues/9697).

Implements `>` and `<` with motions and text objects.
Works with repeat action `.`
2024-06-04 15:17:01 -06:00
Marshall Bowers
2d9479667f
Make HTML to Markdown conversion more pluggable (#12653)
This PR overhauls the HTML to Markdown conversion functionality in order
to make it more pluggable. This will ultimately allow for supporting a
variety of different HTML input structures (both natively and via
extensions).

As part of this, the `rustdoc_to_markdown` crate has been renamed to
`html_to_markdown`.

The `MarkdownWriter` now accepts a list of trait objects that can be
used to drive the conversion of the HTML into Markdown. Right now we
have some generic handler implementations for going from plain HTML
elements to their Markdown equivalents, as well as some rustdoc-specific
ones.

Release Notes:

- N/A
2024-06-04 16:14:26 -04:00
Conrad Irwin
1c617474fe
Allow restarting remote language servers (#12652)
Release Notes:

- Added the ability to restart the remote language servers when
collaborating
2024-06-04 14:09:01 -06:00
Mikayla Maki
1a0708f28c
Fix a bug where the IME pre-edit would desync from Zed (#12651)
fixes #11829 

In https://github.com/zed-industries/zed/pull/7494, we introduced IME
event buffering, so that we could preempt the IME with a keystroke event
in some cases. However, this caused a desynchronization bug in long
multi-step IME composition, such as the pre-edit used in the Japanese
Romaji keyboard (and other languages). We found that this was due to the
IME issuing actions, and then immediately querying the editor's state
before we had applied those actions. Therefore, this PR removes IME
action buffering.

We have tested all of the cases in the `handle_key_event` documentation
and added a few of our own.

Release Notes:

- Fixed an issue where the IME pre-edit could desynchronize from the
editor on macOS
([#11829](https://github.com/zed-industries/zed/pull/12651))

---------

Co-authored-by: Jan Solanti <jhs@psonet.com>
2024-06-04 12:17:44 -07:00
Piotr Osiewicz
62e790074c
vcs_menu: Fix header taking up too much space (#12646)
We've spotted a regression following
https://github.com/zed-industries/zed/pull/12468


![image](https://github.com/zed-industries/zed/assets/24362066/8e2659c7-50fe-4a09-af9d-d04416a66276)
This PR addresses that.
Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-06-04 19:13:21 +02:00
Antonio Scandurra
c5b22eee2d
Polish prompt library UX (#12647)
This could still use some improvement UI-wise but the user experience
should be a lot better.

- [x] Show in "Window" application menu
- [x] Load prompt as it's selected in the picker
- [x] Refocus picker on `esc`
- [x] When creating a new prompt, if a new prompt already exists and is
unedited, activate it instead
- [x] Add `/default` command
- [x] Evaluate /commands on prompt insertion
- [x] Autocomplete /commands (but don't evaluate) during prompt editing
- [x] Show token count using the settings model, right-aligned in the
editor
- [x] Picker 
- [x] Sorted alpha
- [x] 2 sublists
    - Default
        - Empty state: Star a prompt to add it to your default prompt
        - Otherwise show prompts with star on hover
    - All
        - Move prompts with star on hover

Release Notes:

- N/A
2024-06-04 18:36:54 +02:00
Marshall Bowers
e4bb666eab
assistant: Add /fetch slash command (#12645)
This PR adds a new `/fetch` slash command to the Assistant for fetching
the content of an arbitrary URL as Markdown.

Currently it's just using the same HTML to Markdown conversion that
`/rustdoc` uses, but I'll be working to refine the output to be more
widely useful.

Release Notes:

- N/A
2024-06-04 11:56:23 -04:00
Piotr Osiewicz
8e79609288
editor: Cancel ongoing completion requests more eagerly (#12630)
Previously, we were:
- cancelling previous requests only after the latest one has completed
- always running the debounced documentation resolution to completion,
even when we had no need for it.

In this commit, we drop the ongoing completion requests as soon as the
new one is fired.
Fixes #5166 

Release Notes:

- Improved performance and reliability of completions in large
Typescript projects

Co-authored-by: Bennet Bo <bennet@zed.dev>
2024-06-04 12:22:01 +02:00
Kirill Bulatov
47122a3115
Fix excluded file creation (#12620)
Fixes https://github.com/zed-industries/zed/issues/10890

* removes `unwrap()` that caused panics for text elements with no text,
remaining after edit state is cleared but project entries are not
updated, having the fake, "new entry"
* improves discoverability of the FS errors during file/directory
creation: now those are shown as workspace notifications
* stops printing anyhow backtraces in workspace notifications, printing
the more readable chain of contexts instead
* better indicates when new entries are created as excluded ones


Release Notes:

- Improve excluded entry creation workflow in the project panel
([10890](https://github.com/zed-industries/zed/issues/10890))
2024-06-04 10:31:43 +03:00
Conrad Irwin
edd613062a
linux watcher (#12615)
fixes https://github.com/zed-industries/zed/issues/12297
fixes https://github.com/zed-industries/zed/issues/11345

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-06-03 22:17:10 -06:00
Mikayla Maki
3cd6719b30
Fix issues with Claude in Assistant2 (#12619)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-06-03 16:30:09 -07:00
Marshall Bowers
afc0650a49
Paginate through extensions from the blob store (#12614)
This PR updates the background task used to fetch extensions from the
blob store to account for the possibility that the result set will be
paginated.

Will now paginate through all of the results and collect them up before
proceeding to determining which extensions need to be synced.

Release Notes:

- N/A
2024-06-03 17:17:46 -04:00
Marshall Bowers
14c2fab8ab
assistant: Allow /rustdoc to use local docs (#12613)
This PR updates the `/rustdoc` slash command to use local docs built
with `cargo doc`.

If the docs for a particular crate/module are available locally, those
will be used. Otherwise, it will fall back to retrieving the docs from
`docs.rs`.

The placeholder output for the slash command will indicate which source
was used for the docs:

<img width="289" alt="Screenshot 2024-06-03 at 4 13 42 PM"
src="https://github.com/zed-industries/zed/assets/1486634/729112e4-80ca-4f08-bdb3-88fc950351c3">

Release Notes:

- N/A
2024-06-03 16:23:25 -04:00
Marshall Bowers
2f65c3c6e6
Disable vtsls by default (#12611)
This PR adds default settings to disable `vtsls` by default so that
there aren't multiple TypeScript language servers running.

I also renamed the language server from `vtsls-language-server` to just
`vtsls`, since the `-language-server` suffix was redundant.

Release Notes:

- N/A
2024-06-03 14:30:33 -04:00
apricotbucket28
959f0dcded
Fix terminal key bindings (#12558)
Fixes https://github.com/zed-industries/zed/issues/12556

Only changed the keymap on Linux since I'm not sure if the behaviour is
correct on macOS

Release Notes:

- N/A
2024-06-03 11:25:27 -07:00
Sean Billig
be2df79d5c
gpui: Handle null string pointer in window::insert_text (#12446)
`[NSString UTF8String]` sometimes returns null (it's documented as
such), and when it does, zed crashes in `window::insert_text`. I'm
running into this sometimes when using alt-d to delete forward. It
usually only happens with multiple cursors, but sometimes with a single
cursor. It *might* only happen when using the "Unicode Hex Input"
keyboard 'Input Source' (which I started using to avoid entering weird
characters in zed when using emacs meta keybindings that I haven't
defined in zed).

When using the US English input source, alt-d always results in a call
to `insert_text`. When using the Unicode Hex Input source it usually
doesn't, but when it does `text.UTF8String()` returns null. `text` isn't
null. `[text length]` returns 1. `[text characterAtIndex: 0]` seems to
always return `56797` (an undefined utf-16 codepoint).

Release Notes:

- Fixed crash on mac when deleting with alt-d
2024-06-03 09:36:38 -07:00
apricotbucket28
344e5e1cf2
wayland: Fix window bounds restoration (#12581)
Fixes multiple issues that prevented window bounds restoration to not
work on Wayland.

Note: Since the display uuid depends on the `wl_output.name` field, this
only works properly on KDE 5.26+ or Gnome 44+ ([kwin
commit](330a02d862),
[mutter](7e838b1115)).

Release Notes:

- N/A
2024-06-03 09:27:01 -07:00
apricotbucket28
ed86b86dc7
cosmic_text: Handle variation selectors; fix emoji colors (#12587)
Basically, we detect if a glyph is a variation selector if its `id` is 3
(i.e. a whitespace character) and if it comes from an emoji font (since
variation selectors are only used for emoji glyphs).

- Fixes https://github.com/zed-industries/zed/issues/11703 and
https://github.com/zed-industries/zed/issues/12022

Release Notes:

- N/A
2024-06-03 09:25:44 -07:00
Piotr Osiewicz
b1efea1100
typescript: Add support for VTSLS (#12606)
You can opt into using VTSLS instead of typescript-language-server by
pasting the following snippet into your settings:
```
  "languages": {
    "TSX": {
      "language_servers": [
        "!typescript-language-server",
        "vtsls-language-server"
      ]
    }
  },
```

Related to: #5166 
Release Notes:

- Added support for using [vtsls](https://github.com/yioneko/vtsls)
language server for Typescript/Javascript.
2024-06-03 17:11:28 +02:00
Owen Law
2b21c89e3c
Fix XI2 Scrolling Issue (#12603)
ref #11679
https://github.com/zed-industries/zed/pull/11235#issuecomment-2144727144

Filters leave events to ensure they are in the normal notify leave
events (not grab or ungrab)
([spec](https://www.x.org/releases/X11R7.7/doc/inputproto/XI2proto.txt)).
Confirmed to fix the issue @mrnugget was having.

Release Notes:

- linux: Fixed a regression that caused some X11 input devices being
unable to scroll.
2024-06-03 17:10:14 +02:00
Bennet Bo Fenner
d0fa012bf8
Support formatting unsaved buffers with external formatter (#12597)
Closes #4529


https://github.com/zed-industries/zed/assets/53836821/b84efd5e-89da-4ff7-9a29-2b2f7285d427

Release Notes:

- Added ability to format unsaved buffers with external formatters
([#4529](https://github.com/zed-industries/zed/issues/4529))
2024-06-03 16:32:16 +02:00
Thorsten Ball
338df5de1d
linux/x11: Ignore bounds.origin on resize event (#12604)
This fixes #11236 by ignoring the `bounds.origin` values when the window
is only being resized.

The cause for the issue was that the `ConfigureNotify` event would
contain "wrong" values when the window was being resized (by dragging a
corner).

In my case it would *always* contain x:14/y:49, which is I think might
map to the origin of the top bar in GNOME.

We would then persist these wrong values when serializing the workspace.
On restart, we'd use these values and end up with the window decorations
in the wrong place.

What I still don't know:
1. What exactly the 14/49 map to, because it's not the origin of the top
bar in GNOME. I also tried the X11 TranslateCoordinates call but
couldn't get meaningful results back (even taking scale factor into
account).
2. Why the window decorations end up looking wrong vs. the window being
in the first place. But if you look at my screenshot in #11236, it looks
like the decorations are off exactly by 14/49px.

That being said, I think the solution here is a good one for now: we
don't do an additional X11 call and when we're resizing, we're not
interested in the origin changing.



Release Notes:

- N/A

Proof:

[Screencast from 2024-06-03
15-08-36.webm](https://github.com/zed-industries/zed/assets/1185253/90efccfc-8ec6-42d2-8380-1625eff57805)
2024-06-03 16:25:12 +02:00
Nathan Sobo
5f98b9617a
Start on a database-backed prompt library (#12468)
Using the file system as a database seems like it's easy, but it's
actually a real pain. I'd like to use LMDB to store the prompts locally
so we have more control. We can always add an export option, but I want
the source of truth to be somewhere other than the file system.

So far, I have a PromptStore which is global to the application and can
be initialized on startup. Then there's a `PromptLibrary` which is
intended to be the root of a new kind of Zed window. I haven't actually
seen pixels yet, but I've sketched out the basics needed to create a new
prompt, save, etc.

Still lots to figure out but the foundations of being backed by a DB and
rendering in an independent window are in place.

/cc @iamnbutler @as-cii 

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-06-03 15:58:43 +02:00
Piotr Osiewicz
18e2b43d6d
task: Rebind UseSelectedQuery in modal to F2 (#12601)
Also fix click handler for "Rerun last task".

Fixes #12580
Release Notes:

- Fixed click handler for "rerun last task" in task modal not working.
- Rebound "picker::UseSelectedQuery" from `opt-E` to `F2`.
2024-06-03 12:52:44 +02:00
Piotr Osiewicz
5e3d85c023
json: Fix tsconfig.json schema overriding other schemas (such as keymap) (#12600)
@mrnugget spotted that tsconfig.json schema is getting applied on
current Nightly. I've tracked it down to a misconfiguration of JSON
language server. Mea culpa.

No release note as that change has not went out to the public yet.

Release Notes:

- N/A
2024-06-03 12:16:09 +02:00
Jason Lee
ae55d35f19
windows: Fix project prepare_ssh_shell to support setting PATH on Windows (#12370)
Release Notes:

- N/A

Update to use `std::env::join_paths` to prepare `PATH` env.

Ref
https://github.com/zed-industries/zed/pull/12087#issuecomment-2122852384
@mrnugget

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-06-03 11:57:50 +02:00
Jayden Seric
b218d8778d
Fix TSX and JavaScript shorthand property syntax highlighting (#12512)
This replicates the fix for the TypeScript language for
https://github.com/zed-industries/zed/issues/5239 in
https://github.com/zed-industries/zed/pull/12505 for the TSX and
JavaScript languages, fixing
https://github.com/zed-industries/zed/issues/12510 and fixing
https://github.com/zed-industries/zed/issues/12509 .

See
https://github.com/zed-industries/zed/pull/12505#issuecomment-2141002505
.

Keep in mind I don't have a proper Zed local development environment
setup to test these simple changes.

Release Notes:

- Fixed TSX shorthand property syntax highlighting
([#12510](https://github.com/zed-industries/zed/issues/12510)).
- Fixed JavaScript shorthand property syntax highlighting
([#12509](https://github.com/zed-industries/zed/issues/12509)).
2024-06-03 00:52:16 +02:00
Bennet Bo Fenner
de8ef08143
Disable indent guides for single line editors (#12584)
This PR disables indent guides by default for single line editors. Right
now indent guides show up in the project search editor (which is only a
single line)

<img width="715" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/0b61da71-6f64-424d-9612-6a34eac4686a">


Release Notes:

- Fixed an issue where indent guides would show up in a single line
editor (e.g. project search, buffer search)
2024-06-02 17:57:45 +02:00
Matin Aniss
66b73c2d60
Fix GPUI get_menus documentation (#12571)
Release Notes:

- N/A
2024-06-02 13:06:14 +02:00
Bennet Bo Fenner
ab8d25e0a2
indent guides: Respect language specific settings in multibuffers (#12528)
Indent guides can be configured per language, meaning that in a multi
buffer we can get excerpts where indent guides should be
disabled/enabled/styled differently than other excerpts.

Imagine the following scenario, i have indent guides disabled in my
settings, but want to enable them for JS and Python. I also want to use
a different line width for python files. Something like this is now
supported:

<img width="445" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/0c91411c-145c-4210-a883-4c469d5cb828">

And the relevant settings for the example above:
```json
"indent_guides": {
  "enabled": false
},
"languages": {
  "JavaScript": {
    "indent_guides": {
      "enabled": true
    }
  },
  "Python": {
    "indent_guides": {
      "enabled": true,
      "line_width": 5
    }
  }
}
```



Release Notes:

- Respect language specific settings when showing indent guides in a
multibuffer
- Fixes an issue where indent guide specific settings were not
recognized when specified in local settings
2024-06-01 20:33:32 +02:00
Rayduck
95e360b170
python: Add runnable unittest tasks (#12451)
Add runnable tasks for Python, starting with `unittest` from the
standard library. Both `TestCase`s (classes meant to be a unit of
testing) and individual test functions in a `TestCase` will have
runnable icons. For completeness, I also included a task that will run
`unittest` on the current file.

The implementation follows the `unittest` CLI. The unittest module can
be used from the command line to run tests from modules, classes or even
individual test methods:

```
python -m unittest test_module.TestClass
python -m unittest test_module.TestClass.test_method
```

```python
import unittest

class TestStringMethods(unittest.TestCase):

    def test_upper(self):
        self.assertEqual('foo'.upper(), 'FOO')

    def test_isupper(self):
        self.assertTrue('FOO'.isupper())
        self.assertFalse('Foo'.isupper())

    def test_split(self):
        s = 'hello world'
        self.assertEqual(s.split(), ['hello', 'world'])
        # check that s.split fails when the separator is not a string
        with self.assertRaises(TypeError):
            s.split(2)

if __name__ == '__main__':
    unittest.main()
```

From the snippet provided by `unittest` docs, a user may want to run
test_split independently of the other test functions in the test case.
Hence, I decided to make each test function runnable despite `TestCase`s
being the unit of testing.

## Example of running a `TestCase`
<img width="600" alt="image"
src="https://github.com/zed-industries/zed/assets/16619392/7be38b71-9d51-4b44-9840-f819502d600a">

## Example of running a test function in a `TestCase`
<img width="600" alt="image"
src="https://github.com/zed-industries/zed/assets/16619392/f0b6274c-4fa7-424e-a0f5-1dc723842046">

`unittest` will also run the `setUp` and `tearDown` fixtures.

Eventually, I want to add the more commonly used `pytest` runnables
(perhaps as an extension instead).

Release Notes:

- Added runnable tasks for Python `unittest`.
([#12080](https://github.com/zed-industries/zed/issues/12080)).
2024-06-01 18:46:36 +02:00
Piotr Osiewicz
f0d979576d
collab_ui: remove branch menu popover in favor of opening a modal (#12562)
This commit also removes a bunch of dead code.

Fixes #12544

Release Notes:

- Removed branch popover menu - clicking on the branch name in left-hand
corner now always opens a branch modal
2024-06-01 18:40:25 +02:00
Piotr Osiewicz
fbcc5ccdb9
typescript: Add completions for tsconfig.json properties (#12560)
Release Notes:

- Added completions for tsconfig.json config file.
2024-06-01 17:51:58 +02:00
Remco Smits
29b5253a1d
JavaScript: Add runnable tests (#12118)
https://github.com/zed-industries/zed/assets/62463826/2912c940-bd00-483d-9ce7-df1a2539560a


Release Notes:

- Added runnable tests for JavaScript & Typescript files.
- Added task to run selected javascript code.
2024-06-01 14:28:53 +02:00
Mikayla Maki
94c3101fb0
Fix or promote leftover TODOs and GPUI APIs (#12514)
fixes https://github.com/zed-industries/zed/issues/11966

Release Notes:

- N/A
2024-05-31 18:36:15 -07:00
Max Brunsfeld
d12b8c3945
Simplify and improve concurrency of git status updates (#12513)
The quest for responsiveness in large git repos continues. This is a
follow-up to https://github.com/zed-industries/zed/pull/12444

Release Notes:

- N/A
2024-05-31 09:10:09 -07:00
Marshall Bowers
4c51ee7816
assistant: Allow passing module paths to /rustdoc command (#12536)
This PR updates the `/rustdoc` command to accept module paths in
addition to just a crate name.

This will return the docs.rs page just for that particular module.

### Examples

```
/rustdoc bevy
/rustdoc bevy::ecs
/rustdoc bevy::ecs::component
```

<img width="641" alt="Screenshot 2024-05-31 at 11 18 25 AM"
src="https://github.com/zed-industries/zed/assets/1486634/d88af19f-5ba1-4073-8108-63cccd138db6">

<img width="641" alt="Screenshot 2024-05-31 at 11 18 35 AM"
src="https://github.com/zed-industries/zed/assets/1486634/9c414ab1-0be8-4d79-8c64-b45f19266556">


Release Notes:

- N/A
2024-05-31 11:31:22 -04:00
Vladas Zakrevskis
819bb2663d
Fix recent project index order (#12507)
Fixed bug introduced in:
https://github.com/zed-industries/zed/pull/12502

Filtering before `enumerate` call breaks project order and instead of
hiding current project it hides some other project.

Release Notes:
- N/A
2024-05-31 05:50:03 +03:00
moshyfawn
dc141d0f61
typescript: Fix shorthand property highlight (#12505)
Release Notes:

- Fixed Typescript shorthand property highlight
([#5239](https://github.com/zed-industries/zed/issues/5239)).

Closes: #5239
2024-05-30 18:27:03 -04:00
Bennet Bo Fenner
22cf73acec
indent guides: Use primary buffer language to determine tab size (#12506)
When indent guides were still WIP, I thought it might be a good idea to
detect the tab size for every line individually, so we can handle files
with mixed indentations. However, while optimizing the performance of
indent guides I found that getting the language at a given anchor was
pretty expensive, therefore I only resolved the language for the first
visible row. However, this could lead to some weird flickering, where
the indent guides would use different tab sizes depending on the first
visible row (see #12492). This can be fixed by just using the primary
buffer language size.

So as of right now indent guides cannot handle files with mixed
indentations. Im not sure if anyone actually does/expects this, but one
use case I could imagine is something like this:
User x has a svelte file, where the tab size is set to `4`. However the
svelte code uses typescript inside a script tag, which User x wants to
use a tab size of `2`. The approach used here would not work for this,
but then again I think our formatter does not even support something
like this. Im probably overcomplicating things, so let's stick with the
simple solution for now.

Release Notes:

- Fixed an issue where indent guides would use an incorrect tab size
([#12492](https://github.com/zed-industries/zed/issues/12492)).
2024-05-30 22:55:47 +02:00
Marshall Bowers
1d46a52c62
rustdoc_to_markdown: Don't push blank space after newline (#12504)
This PR fixes a small issue in `rustdoc_to_markdown` where we could push
a blank space after a newline, leading to an unwanted leading space.

Release Notes:

- N/A
2024-05-30 16:38:01 -04:00
Max Brunsfeld
fda975fb76 Re-subscribe to channels after signing back out 2024-05-30 13:32:34 -07:00
Vladas Zakrevskis
0f32145ecb
Skip current project in recent projects (#12502)
Discussion: https://github.com/zed-industries/zed/discussions/12497

Release Notes:

- Removed current project from the recent projects modals
2024-05-30 23:30:34 +03:00
Marshall Bowers
6fe665ab94
rustdoc_to_markdown: Support bold and italics (#12501)
This PR extends `rustdoc_to_markdown` with support for bold and italic
text.

Release Notes:

- N/A
2024-05-30 16:06:21 -04:00
Max Brunsfeld
279c5ab81f
Reduce DB load upon initial connection due to channel loading (#12500)
#### Lazily loading channels

I've added a new RPC message called `SubscribeToChannels` that the
client now sends when it first renders the channels panel. This causes
the server to load the channels for that client and send updates to that
client as channels are updated. Previously, the server did this upon
connection.

For backwards compatibility, the server will inspect clients' version,
and continue to do this work immediately for old clients.

#### Optimizations

Running collab locally, I realized that upon connecting, we were running
two concurrent transactions that *both* queried the `channel_members`
table: one for loading your channels, and one for loading your channel
invites. I've combined these into one query. In addition, we now use a
join to load channels + members, as opposed to two separate queries.
Even though `where id in` is efficient, it adds an extra round trip to
the database, keeping the transaction open for slightly longer.

Release Notes:

- N/A
2024-05-30 13:02:55 -07:00
Marshall Bowers
99901801f4
rustdoc_to_markdown: Improve paragraph handling (#12498)
This PR improves `rustdoc_to_markdown`'s paragraph handling to produce
better output.

Specifically, there should now be fewer instances where a space is
missing between words as the result of line breaks in the source HTML.

Release Notes:

- N/A
2024-05-30 15:14:02 -04:00
Marshall Bowers
4dc98026c4
rustdoc_to_markdown: Add helper methods for checking HTML attributes (#12496)
This PR adds some helper methods to `HtmlElement` to make it easier to
interact with the element's attributes.

This cleans up a bunch of the code by a fair amount.

Release Notes:

- N/A
2024-05-30 14:15:08 -04:00
Marshall Bowers
c83d1c23d7
rustdoc_to_markdown: Handle "stabs" in item name entries (#12494)
This PR extends `rustdoc_to_markdown` with support for rustdoc's
"stabs".

These are used in item name lists to indicate that the construct is
behind a feature flag:

<img width="641" alt="Screenshot 2024-05-30 at 1 34 53 PM"
src="https://github.com/zed-industries/zed/assets/1486634/0216f325-dc4e-4302-b6db-149ace31deea">

We now treat these specially in the Markdown output:

<img width="813" alt="Screenshot 2024-05-30 at 1 35 27 PM"
src="https://github.com/zed-industries/zed/assets/1486634/96396305-123d-40b2-af49-7eed71b62971">

Release Notes:

- N/A
2024-05-30 13:46:14 -04:00
Marshall Bowers
39a2cdb13f
rustdoc_to_markdown: Strip "Copy item path to clipboard" button (#12490)
This PR strips the "Copy item path to clipboard" button from the rustdoc
output.

Release Notes:

- N/A
2024-05-30 12:55:37 -04:00
Max Brunsfeld
8f942bf647
Use repository mutex more sparingly. Don't hold it while running git status. (#12489)
Previously, each git `Repository` object was held inside of a mutex.
This was needed because libgit2's Repository object is (as one would
expect) not thread safe. But now, the two longest-running git operations
that Zed performs, (`status` and `blame`) do not use libgit2 - they
invoke the `git` executable. For these operations, it's not necessary to
hold a lock on the repository.

In this PR, I've moved our mutex usage so that it only wraps the libgit2
calls, not our `git` subprocess spawns. The main user-facing impact of
this is that the UI is much more responsive when initially opening a
project with a very large git repository (e.g. `chromium`, `webkit`,
`linux`).

Release Notes:

- Improved Zed's responsiveness when initially opening a project
containing a very large git repository.
2024-05-30 09:37:11 -07:00
Bennet Bo Fenner
1ecd13ba50
Support copying permalink in multibuffer (#12435)
Closes #11392 

Release Notes:

- Added support for copying permalinks inside multi-buffers
([#11392](https://github.com/zed-industries/zed/issues/11392))
2024-05-30 18:36:24 +02:00
Marshall Bowers
c118012223
rustdoc_to_markdown: Add table support (#12488)
This PR extends `rustdoc_to_markdown` with support for tables:

<img width="1007" alt="Screenshot 2024-05-30 at 12 05 35 PM"
src="https://github.com/zed-industries/zed/assets/1486634/4e9a2a65-8aaa-4df1-98c4-4dd4e7874514">


Release Notes:

- N/A
2024-05-30 12:17:10 -04:00
Marshall Bowers
bf7c6a676a
rustdoc_to_markdown: Recognize code blocks in other languages (#12484)
This PR updates `rustdoc_to_markdown` to be able to recognize code
blocks using non-Rust languages.

Release Notes:

- N/A
2024-05-30 10:50:27 -04:00
Antonio Scandurra
a259042f92
Make slash commands more discoverable (#12480)
<img width="648" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/a63df904-fbbe-4e0a-80b2-c98ebee90690">

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-05-30 16:45:05 +02:00
Antonio Scandurra
55c47305c8
Align the inline assistant correctly (#12478)
Release Notes:

- Fixed the the alignment for the inline assistant.
2024-05-30 14:29:17 +02:00
Antonio Scandurra
6ff01b17ca
Improve model selection in the assistant (#12472)
https://github.com/zed-industries/zed/assets/482957/3b017850-b7b6-457a-9b2f-324d5533442e


Release Notes:

- Improved the UX for selecting a model in the assistant panel. You can
now switch model using just the keyboard by pressing `alt-m`. Also, when
switching models via the UI, settings will now be updated automatically.
2024-05-30 12:36:07 +02:00
Mikayla Maki
5a149b970c
Make tests less noisy (#12463)
When running the tests for linux, I found a lot of benign errors getting
logged. This PR cuts down some of the noise from unnecessary workspace
serialization and SVG renders

Release Notes:

- N/A
2024-05-29 18:06:45 -07:00
Marshall Bowers
bdf627ce07
rustdoc_to_markdown: Fix code blocks (#12460)
This PR fixes an issue in `rustdoc_to_markdown` with code blocks being
trimmed incorrectly.

We were erroneously popping from the current element stack even if we
didn't push an element onto the stack.

Added test coverage for this case as well, so we don't regress.

Release Notes:

- N/A
2024-05-29 19:23:06 -04:00
Marshall Bowers
a5011996fb
rustdoc_to_markdown: Recognize Rust code blocks (#12458)
This PR makes it so Rust code blocks are recognized and
syntax-highlighted when converting from rustdoc to Markdown.

Release Notes:

- N/A
2024-05-29 18:57:20 -04:00
Nathan Sobo
b8d9713b4f
Make prompt library icon in context panel staff-only for now (#12457)
This is still pretty raw, so I'd like to hold off on shipping it to all
users.

Release Notes:

- Hide the prompt library for non-staff until it is in a more complete
state.
2024-05-29 16:53:45 -06:00
Marshall Bowers
abec028e58
rustdoc_to_markdown: Clean up heading spacing (#12456)
This PR cleans up the spacing around the Markdown headings in the output
so that they are consistent.

Release Notes:

- N/A
2024-05-29 18:39:51 -04:00
Marshall Bowers
08881828ce
assistant: Add /rustdoc slash command (#12453)
This PR adds a `/rustdoc` slash command for retrieving and inserting
rustdoc docs into the Assistant.

Right now the command accepts the crate name as an argument and will
return the top-level docs from `docs.rs`.

Release Notes:

- N/A
2024-05-29 18:14:29 -04:00
Max Brunsfeld
dd328efaa7
Compute git statuses using the bundled git executable, not libgit2 (#12444)
I realized that somehow, the `git` executable is able to compute `git
status` much more quickly than libgit2, so I've switched our git status
logic to use `git`. Follow-up to
https://github.com/zed-industries/zed/pull/12266.

Release Notes:

- Improved the performance of git status updated when working in large
git repositories.
2024-05-29 14:31:24 -07:00
Joshua Ferguson
6294a3b80b
Add xdg trash support (#12391)
- Added support for xdg trash when deleting files on linux
- moved ashpd depency to toplevel to use it in both fs and gpui

If I need to add test, or change anything, please let me know. I tested
locally by creating and deleting a file and confirming it showed up in
my trashcan, but that probably a less than ideal method of confirming
correct behavior

Also, I could remove the delete directory function for linux, and change
the one configured for macos to compile for both macos and linux (they
are the same, the version of the function they are calling is
different).

Release Notes:

- N/A
2024-05-29 14:15:29 -07:00
Kirill Bulatov
0f927fa6fb
One less unwrap (#12448)
Fixes
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1717011343884699

Release Notes:

- N/A
2024-05-29 23:44:56 +03:00
Marshall Bowers
5bcb9ed017
Add rustdoc_to_markdown crate (#12445)
This PR adds a new crate for converting rustdoc output to Markdown.

We're leveraging Servo's `html5ever` to parse the Markdown content, and
then walking the DOM nodes to convert it to a Markdown string.

The Markdown output will be continued to be refined, but it's in a place
where it should be reasonable.

Release Notes:

- N/A
2024-05-29 16:05:16 -04:00
Bennet Bo Fenner
a22cd95f9d
Fix deleted hunk offset when zooming (#12442)
Release Notes:

- Fixed an issue where expanded hunks could be rendered at the wrong
position when zooming
- Fixed an issue where expanded hunks could be rendered at the wrong
position when toggling git blame
([#11941](https://github.com/zed-industries/zed/issues/11941))
2024-05-29 20:06:10 +02:00
Dzmitry Malyshau
44c50da94f
blade: Use BufferBelt from blade-utils (#12411)
Release Notes:

- N/A

Follow-up to #12340
Carries https://github.com/kvark/blade/pull/122 and
https://github.com/kvark/blade/pull/119
2024-05-29 09:50:45 -07:00
Joseph T. Lyons
c34d36161d v0.139.x dev 2024-05-29 12:15:12 -04:00
Max Brunsfeld
2772f87198
Make sure not to signal the main thread on fs events in ignored directories (#12436)
Release Notes:

- N/A
2024-05-29 09:11:28 -07:00
Antonio Scandurra
66affa969a
Show recently-opened files when autocompleting /file without arguments (#12434)
<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/ea63b046-64d6-419e-8135-4863748b58fa">


Release Notes:

- N/A
2024-05-29 17:46:18 +02:00
Bennet Bo Fenner
dca5bc5986
Fix editor scrolling when closing tab using middle mouse button (#12429)
#12005 introduced a side effect, that would cause the editor to react to
a scroll event when using the middle mouse button to close a tab

Before:


https://github.com/zed-industries/zed/assets/53836821/46cb2e71-e9d5-477c-b34a-dc9b6bc9b1f1

After:


https://github.com/zed-industries/zed/assets/53836821/6ada7985-97c9-4b52-848f-c7f9461c5216

Release Notes:

- Fixed an issue where the editor would scroll upwards if other tabs
were closed using the middle mouse button
2024-05-29 16:07:59 +02:00
Antonio Scandurra
1db33b5f4e
Always include context when performing inline transformation (#12426)
Release Notes:

- Improved clarity for inline transformations by always including the
active assistant context.
2024-05-29 15:17:01 +02:00
Bennet Bo Fenner
16745542b5
Fix hunk diff hitbox (#12425)
You can see in the video that hunks were getting toggled even when
clicking on the scrollbar.


https://github.com/zed-industries/zed/assets/53836821/11f201e8-c5f1-49c8-a4d2-ac3b3343b5a8

This happened because the hitbox was actually extended to the left of
the hunk indicator, I believe that was done so that "Removed" hunk
indicators rendered correctly (Red triangles)

Fixed:


https://github.com/zed-industries/zed/assets/53836821/7b451b37-da85-4e56-9127-2a5512bd9e7a

Release Notes:

- Fixed hunk indicators getting expanded when clicking near them (but
not on them)
2024-05-29 14:45:27 +02:00
Antonio Scandurra
a0644ac601
Allow specifying a custom limit for /search results (#12423)
<img width="497" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/94e94326-fb3c-4f9b-b4d9-7dd6f6f8d537">


e.g.

```
/search --9 foobar
```

Release Notes:

- N/A
2024-05-29 14:11:05 +02:00
Piotr Osiewicz
f3e6a0beab
project panel: Copy dragged entry when opt is pressed (#12348)
Partially fixes #5119 
TODO:
- [ ] Change cursor style to Copy when dragging an entry with opt
pressed.

Release Notes:

- Drag-and-dropping a project panel entry with opt modifier pressed now
copies the entry instead of moving it.
2024-05-29 12:34:58 +02:00
Antonio Scandurra
4acfab689e
Fix logic errors in RateLimiter (#12421)
This pull request fixes two issues in `RateLimiter` that caused
excessive rate-limiting to take place:

- c19083a35c fixes a mistake that caused
us to load buckets from the database incorrectly and set the
`refill_time_per_token` to equal the `refill_duration`. This was the
primary reason why rate limiting was acting oddly.
- 34b88d14f6 fixes another slight logic
error that caused tokens to be underprovisioned. This was minor compared
to the bug above.

Release Notes:

- N/A
2024-05-29 12:05:40 +02:00
Jason Lee
3c6c850390
task: Add re-run task button to terminal title (#12379)
Release Notes:

- Added re-run task button to terminal title.

Close #12277

## Demo


https://github.com/zed-industries/zed/assets/5518/4cd05fa5-4255-412b-8583-68e22f86561e

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
2024-05-29 11:40:43 +02:00
Piotr Osiewicz
36d0b71f27
project panel: adjust right border and make active entry more prominent when panel is not focused (#12420)
Release Notes:

- N/A
2024-05-29 11:34:59 +02:00
Kirill Bulatov
ef58509797
Show symlink tooltip on icon hover only (#12419)
Small follow-up of https://github.com/zed-industries/zed/pull/12263 

Release Notes:

- N/A
2024-05-29 12:05:53 +03:00
Bennet Bo Fenner
cad3d2d355
inline assistant: Fix overlapping wrap/indent guides (#12417)
Before:

<img width="603" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/08b7566c-4afa-40b6-8e73-4b03d26572b7">

After:

<img width="539" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/ebd69e15-c1e1-485e-9c11-35b4316ede40">


Fixes #9819

Release Notes:

- Fix wrap guides overlapping with the inline assistant
([#9819](https://github.com/zed-industries/zed/issues/9819)).
2024-05-29 10:05:41 +02:00
Nathan Sobo
c03600c55e
Stop silently appending a system prompt for edit formatting (#12407)
We should reintroduce this as part of the prompt library.

Release Notes:

- Removed an over-eager system prompt from the assistant that was
causing misbehavior. Going forward, our intent is to always let you
observe and edit text before we send it.

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-05-28 20:31:58 -06:00
Joseph T. Lyons
30e498a1c1 Fix GitHub Issue-creation commands 2024-05-28 21:51:24 -04:00
Marshall Bowers
82a57a121a
Disable calls.share_on_join by default (#12401)
This PR changes the default value of the `calls.share_on_join` setting
from `true` to `false`.

Nathan mentioned that project sharing should be opt-in so that projects
aren't shared unless you intend for them to be.

Release Notes:

- Changed the default `calls.share_on_join` value to `false`.
2024-05-28 19:28:07 -04:00
Danielle Maywood
7969a10643
Support setting custom background color for syntax highlighting (#12400)
Release Notes:

- Added support for `background_color` in `syntax` map in `theme.json`.

This adds support for setting a `background_color` for styles inside the
`syntax` map for themes defined in `theme.json`. The field is optional
so there should be no backwards compatibility issues.

It is worth noting that the current behaviour for selecting text is that
the background colours will mix/blend (I'm not sure the correct term
here). Changing this behaviour, or making it configurable, looks to be a
far more complex issue and I'm not sure I know how to do it.
2024-05-28 19:25:09 -04:00
Nathan Sobo
bde3056e84
Increase rate limit on LLM requests to 1000/hr (via env var) (#12396)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-05-28 14:20:25 -06:00
Max Brunsfeld
726026a267
Tweak client reconnect timing (#12393)
* Start with a longer duration
* Widen the range used for randomizing the duration between retries
* Increase the maximum duration between retries

Release Notes:

- N/A
2024-05-28 12:42:10 -07:00
Raunak Raj
da70741ece
linux: Implement should_auto_hide_scrollbars (#12366)
Implemented the should_auto_hide_scrollbars method for Linux using
`xdg_desktop_portal` approach

Release Notes:

- N/A
2024-05-28 11:50:14 -07:00
Piotr Osiewicz
ff9d6cc512
project panel: Remove active selection border when project panel is not focused (#12385)
This should make it less attention-grabbing.

Release Notes:

- N/A
2024-05-28 19:12:28 +02:00
Marshall Bowers
01e86881f0
Add placeholder for extension slash commands (#12387)
This PR adds a slightly better placeholder for extension slash commands
than the current "TODO" text.

Right now we display the command name and an arbitrary icon.

<img width="644" alt="Screenshot 2024-05-28 at 12 15 07 PM"
src="https://github.com/zed-industries/zed/assets/1486634/11761797-5ccc-4209-8b00-70b714f10a78">

Release Notes:

- N/A
2024-05-28 12:16:31 -04:00
Antonio Scandurra
ac7aca335d
Fix assistant message header padding (#12386)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-05-28 18:10:35 +02:00
Antonio Scandurra
371abd37f6
Introduce a new /tabs command (#12382)
This inserts the content of the open tabs sorted by recency.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-05-28 17:17:34 +02:00
Antonio Scandurra
b466a8b828
Remove the assistant2 crate (#12380)
Release Notes:

- N/A
2024-05-28 16:26:35 +02:00
Antonio Scandurra
59662fbeb6
Introduce /search command to assistant (#12372)
This pull request introduces semantic search to the assistant using a
slash command:


https://github.com/zed-industries/zed/assets/482957/62f39eae-d7d5-46bf-a356-dd081ff88312

Moreover, this also adds a status to pending slash commands, so that we
can show when a query is running or whether it failed:

<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/e8d85960-6275-4552-a068-85efb74cfde1">

I think this could be better design-wise, but seems like a pretty good
start.

Release Notes:

- N/A
2024-05-28 16:06:09 +02:00