Commit Graph

14560 Commits

Author SHA1 Message Date
Antonio Scandurra
9ab7a22fa8 Fix licensing errors 2024-03-20 15:52:02 +01:00
Antonio Scandurra
f2394c76f5 Fix licensing 2024-03-20 13:03:13 +01:00
Tim Masliuchenko
7855b9e9a8
Allow to handle autoclosed characters differently (#8666)
Adds the `always_treat_brackets_as_autoclosed` setting to control how
the autoclosed characters are handled.

The setting is off by default, meaning the behaviour stays the same
(following how VSCode handles autoclosed characters).
When set to `true`, the autoclosed characters are always skipped over
and auto-removed no matter how they were inserted (following how Sublime
Text/Xcode handle this).


https://github.com/zed-industries/zed/assets/471335/304cd04a-59fe-450f-9c65-cc31b781b0db


https://github.com/zed-industries/zed/assets/471335/0f5b09c2-260f-48d4-8528-23f122dee45f

Release Notes:

- Added the setting `always_treat_brackets_as_autoclosed` (default:
`false`) to always treat brackets as "auto-closed" brackets, i.e.
deleting the pair when deleting start/end, etc.
([#7146](https://github.com/zed-industries/zed/issues/7146)).

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-20 09:35:42 +01:00
Ezekiel Warren
d5e0817fbc
windows: Fix title bar height when maximized (#9449)
screenshots and description incoming

## title bar when window is maximized
| before | after |
| ---    | ---   |
|
![image](https://github.com/zed-industries/zed/assets/1284289/075a943d-54db-4b71-9fa0-15f823255182)
|
![image](https://github.com/zed-industries/zed/assets/1284289/39a1d381-fcfd-4651-aab4-231a8ec3bd99)
|

## ~~caption buttons at 200%~~
~~buttons are now properly responsive at different scales~~
~~closes #9438~~
~~proper scale factor handling in follow up PR (possibly #9440)~~

<details>
  <summary>out of date image</summary>


![scale-factor](https://github.com/zed-industries/zed/assets/1284289/299d37b8-0d2e-4f2e-81db-2fff6fc59a62)
</details>

should be fixed by https://github.com/zed-industries/zed/pull/9456


Release Notes:

- N/A
2024-03-19 20:54:00 -07:00
Remco Smits
3dadfe4787
Channel chat: Add edit message (#9035)
**Summary**:
- Removed reply message from message_menu
- Made render_popover_buttons a bit more reusable
- Fixed issue that you can't close the reply/edit preview when you are
not focusing the message editor
- Notify only the new people that were mentioned inside the edited
message

**Follow up**
- Fix that we update the notification message for the people that we
mentioned already
- Fix that we remove the notification when a message gets deleted.
  - Fix last acknowledge message id is in correct now

**Todo**:
- [x] Add tests
- [x] Change new added bindings to the `Editor::Cancel` event.

Release Notes:

- Added editing of chat messages
([#6707](https://github.com/zed-industries/zed/issues/6707)).

<img width="239" alt="Screenshot 2024-03-09 at 11 55 23"
src="https://github.com/zed-industries/zed/assets/62463826/b0949f0d-0f8b-43e1-ac20-4c6d40ac41e1">
<img width="240" alt="Screenshot 2024-03-13 at 13 34 23"
src="https://github.com/zed-industries/zed/assets/62463826/d0636da2-c5aa-4fed-858e-4bebe5695ba7">

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-19 19:49:04 -06:00
Conrad Irwin
5139aa3811
Fix merge conflict in collab (#9550)
Release Notes:

- N/A
2024-03-19 16:02:33 -06:00
Max Brunsfeld
fd11bd68f2
Perform extension packaging in extension-cli (#9549)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-03-19 17:26:06 -04:00
张小白
85c294da9a
windows: Implement app_version (#9410)
#### Call `app_version`:

![Screenshot 2024-03-16
011821](https://github.com/zed-industries/zed/assets/14981363/9e618e49-fee2-4e7a-b884-6b0be05a0c95)

#### `Zed.exe` info:

![Screenshot 2024-03-16
011856](https://github.com/zed-industries/zed/assets/14981363/2b17a5df-ad38-42d0-8396-53680d77101d)


Release Notes:

- N/A
2024-03-19 12:40:57 -07:00
Luke Jones
cfa0fc96f0
wayland: change some borrow_mut to borrow, reduce borrow scopes, fix two crashes (#9306)
Release Notes:

- N/A
2024-03-19 12:40:09 -07:00
张小白
086f4e63c5
windows: Properly handle DPI (#9456)
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in #8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.

This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.

`Zed` with a scale factor equals 1.5, and change between different scale
factors:



https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b



Release Notes:

- N/A
2024-03-19 12:39:36 -07:00
apricotbucket28
2c36652be2
wayland: fix handling of non-discrete scroll events (#9548)
https://github.com/zed-industries/zed/pull/9103 broke touchpad scrolling
on Wayland
This PR correctly filters the `Axis` to handle all non-discrete scroll
events (see
https://wayland.app/protocols/wayland#wl_pointer:enum:axis_source)

Should fix https://github.com/zed-industries/zed/issues/9525

Release Notes:

- N/A
2024-03-19 12:25:10 -07:00
Nathan Sobo
8ae5a3b61a
Allow AI interactions to be proxied through Zed's server so you don't need an API key (#7367)
Co-authored-by: Antonio <antonio@zed.dev>

Resurrected this from some assistant work I did in Spring of 2023.
- [x] Resurrect streaming responses
- [x] Use streaming responses to enable AI via Zed's servers by default
(but preserve API key option for now)
- [x] Simplify protobuf
- [x] Proxy to OpenAI on zed.dev
- [x] Proxy to Gemini on zed.dev
- [x] Improve UX for switching between openAI and google models
- We current disallow cycling when setting a custom model, but we need a
better solution to keep OpenAI models available while testing the google
ones
- [x] Show remaining tokens correctly for Google models
- [x] Remove semantic index
- [x] Delete `ai` crate
- [x] Cloud front so we can ban abuse
- [x] Rate-limiting
- [x] Fix panic when using inline assistant
- [x] Double check the upgraded `AssistantSettings` are
backwards-compatible
- [x] Add hosted LLM interaction behind a `language-models` feature
flag.

Release Notes:

- We are temporarily removing the semantic index in order to redesign it
from scratch.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-03-19 19:22:26 +01:00
Antonio Scandurra
2ea333fff6
Insert hitbox if div contains tooltip (#9545)
Release Notes:

- Fixed a bug that would cause certain tooltips to not show up
(preview-only).
2024-03-19 19:02:59 +01:00
Ezekiel Warren
ac6c4f3ca8
windows: fix 'space' keystroke keydown event (#9476)
the space key was being reported as key " " which didn't allow it to be
used in keybindings

Release Notes:

- N/A
2024-03-19 10:35:28 -07:00
Mikayla Maki
fd0071f2af
Add an animation to the LSP checking indicator (#9463)
Spinner go spinny.

Extra thanks to @kvark for helping me with the shaders.



https://github.com/zed-industries/zed/assets/2280405/9d5f4f4e-0d43-44d2-a089-5d69939938e9


Release Notes:

- Added a spinning animation to the LSP checking indicator

---------

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2024-03-19 10:16:18 -07:00
Kyle Kelley
56bd96bc64
Image viewer (#9425)
This builds on #9353 by adding an image viewer to Zed. Closes #5251.

Release Notes:

- Added support for rendering image files
([#5251](https://github.com/zed-industries/zed/issues/5251)).

<img width="1840" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/3bccfa8e-aa5c-421f-9dfa-671caa274c3c">

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-19 10:13:10 -07:00
Marshall Bowers
8d515a620f
Update binary name for extension CLI (#9541)
This PR updates the binary name used by the extension CLI from
`extension_cli` to `zed-extension`.

Release Notes:

- N/A
2024-03-19 12:36:53 -04:00
Conrad Irwin
d6b7f14b51
suggested extensions (#9526)
Follow-up from #9138

Release Notes:

- Adds suggested extensions for some filetypes
([#7096](https://github.com/zed-industries/zed/issues/7096)).

---------

Co-authored-by: Felix Zeller <felixazeller@gmail.com>
2024-03-19 10:06:01 -06:00
Niklas Wimmer
7573f35e8e
Simplify and document parts of linux text system code (#9443)
I mainly focused on improving the `font_id` function, see the
description of e286483262 for more
details. The rest are some drive-by changes I could not resist to.

When I am right about af4d6c43ce, someone
with a Mac could change it there as well.

This PR is probably best reviewed commit by commit :)

cc @gabydd @h3mosphere

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-19 08:27:48 -07:00
白山風露
250528d28f
Windows: Auto close HANDLE (#9429)
`HANDLE` is wrapped in a RAII struct.

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-19 08:21:01 -07:00
Max Brunsfeld
868616d62e
Introduce extension-cli binary, for packaging extensions in CI (#9523)
This will be used in the
[extensions](https://github.com/zed-industries/extensions) repository
for packaging the extensions that users submit.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-19 10:50:21 -04:00
Ben Hamment
7ef6600cdd
Improve Ruby language to recognize Guardfiles (#9530)
Release Notes:

- Improved Ruby language to recognize Guardfile.
2024-03-19 10:44:32 -04:00
Tobias Decking
97fbec9b33
Clean up the live_kit_client manifest file (#9532)
Removes some redundant dependency defenitions and updates one
dependency.
2024-03-19 14:31:47 +01:00
Piotr Osiewicz
080e25dd45 chore: Merge zed lib with zed binary.
TL;DR:
- shaves off about 0.5 seconds from most of our debug builds.
- It would've slightly regressed release build due to preventing build pipelining, but as a tradeoff I've bumped up codegen-units for zed.

\# What did you come up with this time Piotr
In our zed repository I've noticed that merely *loading dependencies* in each crate takes non-trivial amount of time (~800ms in case of editor).
That is to say, the moment you \`use editor\`, your build time increases by 800ms - this happens just once in crate though, as it looks like compiler has to load .rlibs of all of the referenced dependencies.
This is visible under rustc's self-profile. Repro steps on twitter: https://twitter.com/PiotrOsiewicz/status/1762845413072101567

\# How does this commit alleviate this?
zed lib + zed bin are on critical path of every build and cumulatively take about 3s to build. This commit bundles all of this up into ~2.2s of bin build time instead.

\# Wait, splitting binary targets is good, no?
Splitting up a binary target into lib + bin is generally considered to be a good practice, as you can then reuse the lib part elsewhere if needed.
It also allows the build to kick off the moment metadata for all of the dependencies is available (thus, you don't need to wait for codegen).

However, we do not really use zed as a lib, so the first benefit is not really a thing for us.
The latter *is* indeed something we lose out on in release mode (in dev codegen phase of leaf-ish crates is insignificant, as we use shared generics - thus we don't spend much time codegening).
That's why I've bumped codegen units for zed crate to 16 in release mode to keep build times in tact.
2024-03-19 10:54:36 +01:00
Hans
79a424f28f
Add Vue language server auto update (#9474)
For #9401

---------

Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
2024-03-19 09:58:07 +01:00
Andrew Lygin
192cd5f2d2
Fix file git status refresh on .gitignore update (#9466)
This PR fixes file name coloring in the project panel and tabs when
.gitignore file is updated. It's intended to fix #7831.

There's another, less vivid, problem with git-aware labels coloring.
It's about files that are both ignored and contained in the git index.
I'll file a separate issue for it to keep this fix focused.

Release Notes:

- Fixed file Git status refreshing on .gitignore update (#7831).
2024-03-18 20:35:38 -06:00
Tobias Decking
1e1fb21c81
Merge prost dependecies (#9522)
This patch puts the prost, prost-build, and prost-types dependencies
together and unifies their version. This improves organization a bit in
addition to improving build time slightly, since a redundant version of
prost is now removed.

The dependencies are _not_ updated to the newest versions, because the
newest versions add a dependency on the `protoc` application, which is
not provided by cargo and thus breaks the building process.
2024-03-18 20:33:20 -06:00
Conrad Irwin
0c82585ea2
Bump collab min version (#9521)
We made a change last week to allow creating files with names. This
means some files have null saved_mtime, which old versions of zed panic
on.

A fix is available in 0.126.3 and above

Release Notes:


- N/A
2024-03-18 16:59:51 -06:00
apricotbucket28
d8e32c3e3c
linux: scrolling improvements (#9103)
This PR adjusts scrolling to be a lot faster on Linux and also makes
terminal scrolling work.

For Wayland, it makes scrolling faster by handling the `AxisValue120`
event (which also allows high-resolution scrolling on supported mice)
On X11, changed the 1 line per scroll to 3.

### Different solutions

I tried replicating Chromium's scrolling behaviour, but it was
inconsistent in X11/Wayland and found it too fast on Wayland. Plus, it
also didn't match VSCode, since it seems that they do something
different.

Release Notes:

- Made scrolling faster on Linux
- Made terminal scroll on Linux
2024-03-18 14:50:29 -07:00
白山風露
c0f8581b29
Windows: implement symlink (#9508)
Since Windows has a distinction between symlinks for directories and
symlinks for files, the implementation is adapted to this distinction.

Release Notes:

- N/A
2024-03-18 14:27:39 -07:00
Conrad Irwin
cd9b865e0a
maintain channel subscriptions in RAM (#9512)
This avoids a giant database query on every leave/join event.

Release Notes:

- N/A
2024-03-18 15:14:16 -06:00
Conrad Irwin
18fa84b17e
Fix panic loading language queries (#9506)
Release Notes:

- Fixed a panic when loading a language with queries but no grammar
2024-03-18 14:25:26 -06:00
Conrad Irwin
f738bfd703
Don't panic on missing mtime (#9513)
This is expected as of zed 0.128 when a new unsaved file is created

Release Notes:

- Fixed a panic when collaborating with newer zed versions
2024-03-18 14:19:33 -06:00
Tobias Decking
df94906508
Make the cli crate depend on workspace clap (#9507)
This fixes an outstanding TODO.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-03-18 20:00:37 +01:00
Mayfield
7c0a0e21ab
Add keyboard shortcut to suppress prompt while deleting files/dirs (#9452)
Completes #7228.
Adds back Backspace as the main delete key binding and makes Linux
bindings consistent with macOS

Release Notes:
- ⌘-Delete/⌘-Backspace will now suppress deletion confirmation prompts
in project panel
([#7228](https://github.com/zed-industries/zed/issues/7228)).
2024-03-18 11:43:43 -07:00
Ezekiel Warren
e22d31b52d
windows: Respect "appears transparent" for title bar (#9454)
now respecting the 'appears transparent' titlebar option which is used
in the storybook crate. created for #9453

# storybook

running

```
cargo run -p storybook components/text
```

| before | after |
| ---    | ---   |
|
![image](https://github.com/zed-industries/zed/assets/1284289/88cd93de-4ca9-40d6-aa53-aa7bc65e1f5c)
|
![image](https://github.com/zed-industries/zed/assets/1284289/b3528775-219b-46b7-9f99-da5b88330fbd)
|

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-18 11:39:46 -07:00
Ezekiel Warren
31aaee9130
windows: Don't propagate window char message (#9470)
we were accidentally calling the input handler even when the keydown
event asked it not to be propagated

Release Notes:

- N/A
2024-03-18 11:02:15 -07:00
Ezekiel Warren
0e83b22583
windows: Dispatch missing foreground tasks (#9469)
Some foreground tasks were being missed causing some unresponsiveness in
Zed. The foreground tasks used to happen but it was changed in #9351
(here:
https://github.com/zed-industries/zed/pull/9351/files#diff-5b5e706f04c15d77efd23989ec5b1b1cf73d36144e2d066a074de165533ecaeaL227)

Release Notes:

- N/A
2024-03-18 11:01:51 -07:00
Antonio Scandurra
3d08e20c72
Fix dispatching global actions from a window (#9502)
Fixes https://github.com/zed-industries/zed/issues/9313

Release Notes:

- Fixed a regression that caused global actions to stop working when
invoked from a window (preview-only)
([#9313](https://github.com/zed-industries/zed/issues/9313)).

Co-authored-by: Conrad <conrad@zed.dev>
2024-03-18 18:31:47 +01:00
Ezekiel Warren
4e17ce3b37
windows: credentials implementation (#9385)
Release Notes:

- N/A
2024-03-18 10:16:29 -07:00
张小白
64ebbb4afc
Update display info when window moved to another monitor (#9360)
Release Notes:

- N/A
2024-03-18 09:49:40 -07:00
Marshall Bowers
c116a7ca5b
Clean up Picker constructor signature (#9500)
This PR cleans up the (internal) `Picker` constructor signature, mainly
to remove the consecutive boolean parameters.

Release Notes:

- N/A
2024-03-18 12:27:51 -04:00
Andrew Lygin
7512c9949c
Allow Picker to be headless (#9099)
At the moment, `Picker` always has an editor at the top, that allows the
user to search list elements by text. Sometimes, the UI doesn't need
such an editor. Like in the [tab
switcher](https://github.com/zed-industries/zed/issues/7653) that will
confirm selection on the modifier keys release, so there will be no
searching capabilities.

This PR adds support for a "headless picker" that doesn't display an
editor. It only has an invisible element to hold input focus for
preventing it from jumping back to the workspace.

At the moment, none of the picker implementations is made headless. It's
for the future implementations. But I'd like to make it a separate PR to
keep it focused on this particular feature.

Release Notes:

- N/A

Related Issues:
- Part of #7653

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-18 11:59:53 -04:00
Robin Pfäffle
ad97c357a5
Add regex syntax highlighting for JS and TS (#7851)
<img width="544" alt="SCR-20240215-pvzy"
src="https://github.com/zed-industries/zed/assets/67913738/e4d463a6-1795-4728-ac24-6c8e03e7ea5b">

Release Notes:

- Added support for regex syntax highlighting in `JS` and `TS`.
2024-03-18 09:49:01 -06:00
Ezekiel Warren
9f96c43ff7
windows: Don't report 'shift' for certain keys (#9479)
allows keybindings for character such as `:`, `?`, etc. (important for
vim mode!)

alternative solution is here: #9478

Release Notes:

- N/A
2024-03-18 09:33:28 -06:00
白山風露
c2d5b33c20
windows: Fix Clippy warnings (#9426)
Just handling clippy warnings

Release Notes:

- N/A
2024-03-18 10:16:03 -04:00
Ezekiel Warren
ee50d22add
windows: Add manifest for storybook (#9453)
allows `cargo run -p storybook` to work on Windows

Release Notes:

- N/A
2024-03-18 10:14:01 -04:00
Piotr Osiewicz
f60774bbdd
chore: Wrap WorkspaceId in newtype (#9492)
Release Notes:

- N/A
2024-03-18 12:39:03 +01:00
Piotr Osiewicz
07dbee8651
task: Add ZED_PACKAGE task variable in Rust files. (#9491)
This variable is experimental, as I expect it to be superseded by
whatever the extensions can provide (once we get them)

Release Notes:

- Added experimental ZED_PACKAGE task variable which contains name of
the current crate in Rust files.

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-03-18 12:18:42 +01:00
Thorsten Ball
a69eddc081
Limit project search to avoid unresponsive app (#9404)
This fixes #[#9135](https://github.com/zed-industries/zed/issues/9135)
by introducing file/results limit to project search.

It does this by changing how project search works in multiple ways.

User-facing changes:

- Number files that are being searched is now limited to 5000
- Number of search results in all files is now limited to 10000
- If a limit is reached, search is stopped and a message is displayed
  to the user

Under the hood, we also reworked `Project::search_local`:

- Code has been refactored so that the concurrency-logic is easier to
  distinguish from the search logic.
- We now limit the number of concurrent `open_buffer` operations, since
  that is being done on the main thread and can lead to beachballs when
  finding a lot of results.

Note for reviewer:

@SomeoneToIgnore since you know this code, can you take a look at this?
The changes might look bigger than they are in certain places because I
only extracted code into functions, but the middle part — the sorting of
file paths — has changed in order to avoid too many tasks opening
buffers at the same time and making app unresponsive.

What's also curious is that I think there was a bug in that we searched
ignored entries _twice_: once in `search_snapshots` and then later in
the dedicated `search_ignored_entry` function. I changed the `entries()`
call in `search_snapshots` so that it's always `false`, but that caused
tests to fail (see `test_search_in_gitignored_dirs`). @bennetbo and I
think that there's some state in the Project that made the tests pass
before, because the last of the 3 assertions in that test only passes
when the other two queries run. So we changed the test to be more
stateless and included the possible fix in `search_snapshots`.

Release Notes:

- Fixed project-wide search leading to unresponsive application when
searching in ignored files, by limiting the number of files that are
searched (to 5000) and the number of overall search results to 10000.
Additional performance improvements have also been made in order to
offload more work onto a background thread.
([#9135](https://github.com/zed-industries/zed/issues/9135)).

---------

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-03-18 10:49:27 +01:00