Compare commits

...

512 Commits

Author SHA1 Message Date
Mikayla Maki
211bcb09b2 Fix clippy 2024-02-28 14:34:45 -08:00
Mikayla Maki
90ab90600c Remove another mutex 2024-02-28 14:27:39 -08:00
Mikayla Maki
a5c96f76b2 fmt 2024-02-28 14:10:01 -08:00
Mikayla Maki
b7d6d5281e Remove unused synchronization
co-authored-by: julia <julia@zed.dev>
2024-02-28 13:40:36 -08:00
Mikayla Maki
2d1602322e Adjust refresh rate based on monitor refresh
co-authored-by: julia <julia@zed.dev>
2024-02-28 13:19:19 -08:00
Mikayla Maki
118e98d371 Implement a calloop based timer system 2024-02-28 13:19:15 -08:00
Mikayla Maki
1a7958e619 WIP: Switch to using expose event for x11 rendering TODO: Make sure we're only redrawing every so often, rather than every expose # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Tue Feb 27 14:51:50 2024 -0800 # # On branch calloop # Changes to be committed: # modified: crates/gpui/src/platform/linux/client.rs # modified: crates/gpui/src/platform/linux/dispatcher.rs # modified: crates/gpui/src/platform/linux/platform.rs # modified: crates/gpui/src/platform/linux/wayland/client.rs # modified: crates/gpui/src/platform/linux/x11/client.rs # modified: crates/gpui/src/platform/linux/x11/window.rs # # Changes not staged for commit: # modified: crates/gpui/src/platform/linux/dispatcher.rs # modified: crates/gpui/src/platform/linux/x11/client.rs # # Untracked files: # .vscode/ # # Next commands to do (2 remaining commands): # reword 52fe5825a xImplement a calloop based timer system # reword 7997396ac Adjust refresh rate based on monitor refresh # You are currently editing a commit while rebasing branch 'calloop' on 'e2c9de0b0'. # # Changes to be committed: # modified: crates/gpui/src/platform/linux/client.rs # modified: crates/gpui/src/platform/linux/dispatcher.rs # modified: crates/gpui/src/platform/linux/platform.rs # modified: crates/gpui/src/platform/linux/wayland/client.rs # modified: crates/gpui/src/platform/linux/x11/client.rs # modified: crates/gpui/src/platform/linux/x11/window.rs # # Untracked files: # .vscode/ # 2024-02-28 13:19:01 -08:00
Mikayla Maki
bdc09e938d Make background multi threaded 2024-02-27 14:52:35 -05:00
witelokk
e2c9de0b03 fix clippy 2024-02-27 21:47:04 +03:00
witelokk
938a965f67 use calloop timer in key repeat 2024-02-27 20:31:35 +03:00
witelokk
7a3833dd96 Merge remote-tracking branch 'upstream/main' into calloop 2024-02-27 20:02:58 +03:00
witelokk
70c09326a3 wayland: fix fractional scaling 2024-02-27 19:34:33 +03:00
witelokk
4618d67870 make x11 work
Co-authored-by: Tadeo Kondrak <me@tadeo.ca>
2024-02-27 18:42:57 +03:00
Thorsten Ball
7acd6879db Fix copying folders into themselves to create copies (#8484)
This fixes #7314 and #7778.

The problem was copying a folder into itself, which is actually quite a
common operation in macOS's `Finder.app`: you select a folder, hit
`cmd-c` and `cmd-v` and have a copy. That's also how it works in VS
Code.

The fix here is to detect when we're copying a folder into itself and
treating it like we're copying a file into itself: we don't want to copy
into the target, we want to copy into the folder one level higher up,
which will then automatically add a ` copy` to the end of the name.

Release Notes:

- Fixed ability to copy folders into themselves by selecting them in
project panel and hitting `copy` and `paste`. Instead of endless
recursion, a copy of the folder is now created.
([#7314](https://github.com/zed-industries/zed/issues/7314)).

Demo:



https://github.com/zed-industries/zed/assets/1185253/2141310a-991d-491d-8498-eb766275a1f5
2024-02-27 14:57:46 +01:00
Antonio Scandurra
7cbdea2ca0 Revert "Add support of auto folded directories" (#8476)
Reverts zed-industries/zed#7674

@ABckh: reverting this as it introduced a significant performance
slowdown, most likely caused by iterating through all the snapshot
entries to determine whether a directory is foldable/unfoldable/omitted.
It would be great if you could open a new PR that reverts this revert
and addresses the performance issues. Thank you!

/cc: @maxbrunsfeld 

Release notes:

- N/A
2024-02-27 11:26:18 +01:00
Thorsten Ball
ddca6a3fb7 Debounce refresh of inlay hints on buffer edits (#8282)
I think this makes it less chaotic to edit text when the inlay hints are
on.

It's for cases where you're editing to the right side of an inlay hint.
Example:

```rust
for name in names.iter().map(|item| item.len()) {
    println!("{:?}", name);
}
```

We display a `usize` inlay hint right next to `name`.

But as soon as you remove that `.` in `names.iter` your cursor jumps
around because the inlay hint has been removed.

With this change we now have a 700ms debounce before we update the inlay
hints.

VS Code seems to have an even longer debounce, I think somewhere around
~1s.

Release Notes:

- Added debouncing to make it easier to edit text when inlay hints are
enabled and to save rendering of inlay hints when scrolling. Both
debounce durations can be configured with `{"inlay_hints":
{"edit_debounce_ms": 700}}` (default) and `{"inlay_hints":
{"scroll_debounce_ms": 50}}`. Set a value to `0` to turn off the
debouncing.


### Before


https://github.com/zed-industries/zed/assets/1185253/3afbe548-dcfb-45a3-ab9f-cce14c04a148



### After



https://github.com/zed-industries/zed/assets/1185253/7ea90e42-bca6-4f6c-995e-83324669ab43

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-02-27 11:18:13 +01:00
Piotr Osiewicz
cbdc07dcd0 project: enable missing project_core/test-support feature when test-support is enabled (#8471)
This fixes collab's test build failure that @ConradIrwin spotted.


Release Notes:

- N/A
2024-02-27 10:07:40 +01:00
Dheeraj
af14bc7a27 Fall back to stdout if log file is inaccessible (#8415)
https://github.com/zed-industries/zed/assets/31967125/644f3524-e680-457c-bf4c-a7f11f3ec8db

Fixes #8209
Defaults to env logger in case of open/access failure.

Release Notes:

- Improved Zed behavior when no log file access is possible ([8209](https://github.com/zed-industries/zed/issues/8209))

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-02-27 09:48:19 +02:00
Conrad Irwin
8fc2431a2a vim: Keep multi-cursor on escape (#8464)
Release Notes:

- vim: Preserve multiple selections when returning to normal mode.

/cc @mrnugget
2024-02-26 22:54:02 -07:00
Hans
f3fa3b910a vim: Add HTML tag support for #4503 (#8175)
a simple code for html tag support, I've only done the basics, and if
it's okay, I'll optimize and organize the code, and adapt other parts
like `is_multiline`, `always_expands_both_ways`, `target_visual_mode`,
etc

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-26 22:48:19 -07:00
riccardofano
a42b987929 Add :tabonly and :only vim commands (#8337)
Release Notes:

- Added
[`:tabo[nly][!]`](https://neovim.io/doc/user/tabpage.html#%3Atabonly),
closes all the tabs except the active one but in the current pane only,
every other split pane remains unaffected.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
- Added [`:on[ly][!]`](https://neovim.io/doc/user/windows.html#%3Aonly),
closes all the tabs *and* panes except the active one.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
Since Zed does not have different splits per tab like in Neovim `:only`
works the same as it does in VscodeVim.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-26 22:15:50 -07:00
Conrad Irwin
c31626717f channel projects (#8456)
Add plumbing for hosted projects. This will currently show them if they
exist
but provides no UX to create/rename/delete them.

Also changed the `ChannelId` type to not auto-cast to u64; this avoids
type
confusion if you have multiple id types.


Release Notes:

- N/A
2024-02-26 22:15:11 -07:00
Conrad Irwin
8cf36ae603 vim: Fix some problems with visual mode testing (#8461)
Release Notes:

- N/A
2024-02-26 20:15:27 -07:00
Marshall Bowers
079c31fcac Update Cargo.lock (#8458)
This PR updates `Cargo.lock`, since it was missed in another PR.

Release Notes:

- N/A
2024-02-26 21:35:13 -05:00
Daniel Banck
bbc4ed9cab Add language server for Terraform (#7657)
* Depends on: https://github.com/zed-industries/zed/pull/7449
* Closes: https://github.com/zed-industries/zed/issues/5098

---

This PR adds support for downloading and running the Terraform language
server for `*.tf` and `*.tfvars` files. I've verified that the code
works for `aarch64` and `x86_64` macOS. Downloading new language server
versions on release also works as expected.

Furthermore this PR adds:
- A short docs page for Terraform
- An icon for `*.tf` and `*.tfvars` files

## UX

### File Icons

![CleanShot 2024-02-10 at 23 10
13@2x](https://github.com/zed-industries/zed/assets/45985/6f7cd4f0-e94c-4cfb-b3e9-64b0e33c8a43)

### Completion

![CleanShot 2024-02-13 at 20 54
15@2x](https://github.com/zed-industries/zed/assets/45985/18fafa3b-cb50-4f51-b071-ca9eee3521a6)

### Hover

![CleanShot 2024-02-13 at 20 53
40@2x](https://github.com/zed-industries/zed/assets/45985/4d215315-e019-4d3d-b23c-2691db1803e3)

### Go to definition

![2024-02-13 20 56
28](https://github.com/zed-industries/zed/assets/45985/c21d562f-eb0b-4df9-9175-c53b9923344e)

### Formatting

![2024-02-13 20 59
06](https://github.com/zed-industries/zed/assets/45985/0cdf4ec5-e231-4c8a-a257-cae30a8edc8b)

and more!

## Known issue(s)

@fdionisi discovered that sometimes completion results are inserted with
the wrong indentation. Or rather, if you look closely, they are inserted
with the correct indentation and then something shifts the closing `}`.
I don't think this is related to LSP support and can be addressed in a
separate PR.

![2024-02-13 20 58
16](https://github.com/zed-industries/zed/assets/45985/94a118dd-95f5-4e38-8f83-75fec7a0dddf)

Release Notes:

- Add language server support for Terraform
([#5098](https://github.com/zed-industries/zed/issues/5098)).

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-02-26 17:08:49 -08:00
Max Brunsfeld
8536ba54c3 Upgrade Tree-sitter and Wasmtime, compile Cranelift with optimizations in debug builds (#8452)
After upgrading to Wasmtime 18, we got crashes when running Zed in debug
mode. While bisecting the Wasmtime commits and trying to identify the
source of the crash, we noticed this Wasmtime PR, which increased the
stack size of background threads in an example. This alerted us to the
possibility that a stack overflow might be happening due to a lot of
stack usage by cranelift.

https://github.com/bytecodealliance/wasmtime/pull/7651

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-26 16:27:57 -08:00
Kirill Bulatov
a0c8debd35 Mention possible run options in the task modal placeholder (#8449)
Release Notes:

- Improved run task modal's placeholder

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-02-27 00:04:56 +02:00
Piotr Osiewicz
009384f948 Extract project_core out of project (#8438)
That's done to unblock work for dynamic tasks (`task` crate has to
access the worktree yet it is a dependency of a `project`).
Release Notes:

- N/A
2024-02-26 22:09:22 +01:00
Piotr Osiewicz
72009de309 chore: Fix warning from 1.77 rustc (#8265)
/cc @maxbrunsfeld , I didn't remove the field outright since I'm not
sure if the intent is to use it eventually in extensions work.
This is the warning we're getting on 1.77 (release date: 03.21.2024) :
```
warning: field `0` is never read
  --> crates/language/src/language_registry.rs:81:12
   |
81 |     Loaded(PathBuf, tree_sitter::Language),
   |     ------ ^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
81 |     Loaded((), tree_sitter::Language),
   |            ~~

warning: field `0` is never read
  --> crates/language/src/language_registry.rs:82:13
   |
82 |     Loading(PathBuf, Vec<oneshot::Sender<Result<tree_sitter::Language>>>),
   |     ------- ^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
82 |     Loading((), Vec<oneshot::Sender<Result<tree_sitter::Language>>>),
   |             ~~
```
Release Notes:

- N/A
2024-02-26 21:51:45 +01:00
Conrad Irwin
bdf59b8f06 fix migration (#8451)
Release Notes:

- N/A
2024-02-26 13:50:26 -07:00
Joseph T. Lyons
e01a606616 Update 2_crash_report.yml 2024-02-26 15:30:35 -05:00
Joseph T. Lyons
510f4328f2 Create 2_crash_report.yml 2024-02-26 15:28:57 -05:00
Joseph T. Lyons
4b7bd03db7 Update bug report issue template 2024-02-26 15:28:33 -05:00
Joseph T. Lyons
935938a27c Format feature request issue template 2024-02-26 15:28:24 -05:00
Julia
d4584a10b6 Tell Wayland compositor we can handle keyboard ver 4 for repeat info (#8446)
Fixes us not getting Wayland key repeat info from the compositor

Release Notes:

- N/A
2024-02-26 15:13:01 -05:00
Igal Tabachnik
3b2e315ead Open a new file on double-clicking the tab bar (#8431)
Fixes #6818

This is a convenience feature that exists in other editors, allowing
quick creation a new tab by double-clicking the empty space on the tab
bar:
![2024-02-26 14 26
16](https://github.com/zed-industries/zed/assets/601206/55d99a84-2e61-494d-b06c-6e5f15071655)

Release Notes:

- Added the ability to open a new buffer when double-clicking on the tab
bar ([#6818](https://github.com/zed-industries/zed/issues/6818)).
2024-02-26 14:07:04 -05:00
Bennet Bo Fenner
43163a0154 Support rendering strikethrough text in markdown (#8287)
Just noticed strikethrough text handling was not implemented for the
following:

Chat

![image](https://github.com/zed-industries/zed/assets/53836821/ddd98272-d4d4-4a94-bd79-77e967f3ca15)

Markdown Preview

![image](https://github.com/zed-industries/zed/assets/53836821/9087635c-5b89-40e6-8e4d-2785a43ef318)

Code Documentation

![image](https://github.com/zed-industries/zed/assets/53836821/5ed55c60-3e5e-4fc2-86c2-a81fac7de038)

It looks like there are three different markdown parsing/rendering
implementations, might be worth to investigate if any of these can be
combined into a single crate (looks like a lot of work though).

Release Notes:

- Added support for rendering strikethrough text in markdown elements
2024-02-26 21:04:48 +02:00
Marshall Bowers
cd8ede542b Fix bootstrap script (#8445)
This PR fixes the bootstrap script, as we had some unintentional changes
committed to it.

Closes #8370.

Release Notes:

- N/A
2024-02-26 13:20:31 -05:00
Ben Hamment
7d0c515be9 Improve Ruby grammar to recognize method parameters (#8284)
Release Notes:

- Improved Ruby Grammar to recognise various method parameters

![image](https://github.com/zed-industries/zed/assets/7274458/45d4ee2e-d174-4835-a461-22eee428a73b)


![image](https://github.com/zed-industries/zed/assets/7274458/c1bbf307-4f6b-4839-81dc-9d982c85bc58)
2024-02-26 10:09:52 -08:00
Yury Abykhodau
011ae8536c Add support of auto folded directories (#7674)
Added support of auto collapsed directories, for example when directory
has only one directory inside we should display it as dir1/dir2 (#6935
). Please feel free to propose better solutions, as I am new in Rust

Demo:
https://streamable.com/seo3n9

Release Notes:

- Added support for auto-collapsing directories.
2024-02-26 10:01:59 -08:00
Sai Gokula Krishnan
fcd0571ab4 Add file icons for Dart, Swift, Kotlin, Java, Fonts (#8404)
Added icons for
- Dart - https://www.svgrepo.com/svg/473578/dart
- Swift - https://www.svgrepo.com/svg/512939/swift-146
- Kotlin - https://www.svgrepo.com/svg/473692/kotlin
- Java - https://www.svgrepo.com/svg/449119/java-filled
- Fonts - https://www.svgrepo.com/svg/532172/font

Extended support for
- .plist as template

<img width="164" alt="Screenshot 2024-02-26 at 12 17 08 AM"
src="https://github.com/zed-industries/zed/assets/25414681/bd438028-af82-44cd-934f-21ab72ac9d0f">

Release Notes:

- Added icons for Dart, Swift, Kotlin, Java, and font files.
- Changed icon for `.plist` files.
2024-02-26 12:33:28 -05:00
Conrad Irwin
f27d59896f unique channel names (#8439)
Before this change duplicate channels were ordered arbitrarily, which
put the
collab channel in an inconsistent state.

Release Notes:

- Fixed duplicate channel names appearing in the collab sidebar.
2024-02-26 10:07:22 -07:00
Dzmitry Malyshau
a44fc24445 Clean up many small dependencies (part 3) (#8425)
Follow-up to #8353

Release Notes:
- N/A
2024-02-26 11:08:57 +02:00
Joseph T. Lyons
f54bb32a7f Point requests for languages to extension repository 2024-02-26 01:04:54 -05:00
Joseph T. Lyons
d8902ca5d6 Rename bug report issue template 2024-02-26 01:04:39 -05:00
Joseph T. Lyons
b575fbb449 Delete 1_language_support.yml 2024-02-26 01:04:15 -05:00
Marshall Bowers
d8276b0f0d Hoist itertools dependency to workspace level (#8417)
This PR hoists the `itertools` dependency to the workspace level.

Release Notes:

- N/A
2024-02-25 20:37:52 -05:00
Marshall Bowers
841e010fa4 Hoist chrono dependency to workspace level (#8414)
This PR hoists the `chrono` dependency to the workspace level.

Release Notes:

- N/A
2024-02-25 18:52:59 -05:00
Marshall Bowers
ffdda588b4 Format JSON files in assets/ (#8405)
This PR formats the JSON files in the `assets/` directory with Prettier.

This should help avoid some of the changes in formatting when these
files are touched by contributors.

Release Notes:

 - N/A
2024-02-25 14:11:38 -05:00
Howins
6c5dfd1061 Add terminal icon for Nu file (#8399)
Nu is a shell language so it should has the `terminal` icon.

Release Notes:

- N/A

<img width="241" alt="Capture d’écran 2024-02-25 à 18 49 43"
src="https://github.com/zed-industries/zed/assets/24520681/0adcd8fd-f5b0-4688-b301-5c49c376c7a0">
2024-02-25 13:47:04 -05:00
Marshall Bowers
6ef32374d6 Add command_palette_hooks crate (#8398)
This PR introduces a new `command_palette_hooks` crate that contains the
types used to hook into the behavior of the command palette.

The `CommandPaletteFilter` was previously extracted to the `copilot`
crate in #7095, solely because that was the earliest ancestor of the
crates that depended on it.

The `CommandPaletteInterceptor` was still defined in `command_palette`
itself.

Both of these types were consumed by other crates wanting to influence
the behavior of the command palette, but required taking a dependency on
the entire `command_palette` crate in order to gain access to these
hooks.

By moving them out into their own crate, we can improve the compile
order and make crates like `vim` able to begin building sooner without
having to wait for `command_palette` to finish compiling.

Here's a comparison of the compilation graph before and after (ignore
the timings):

#### Before

<img width="332" alt="Screenshot 2024-02-25 at 12 42 29 PM"
src="https://github.com/zed-industries/zed/assets/1486634/a57c662e-fbc2-41ab-9e30-cca17afa6c73">

#### After

<img width="362" alt="Screenshot 2024-02-25 at 12 51 15 PM"
src="https://github.com/zed-industries/zed/assets/1486634/c1a6d29c-b607-4604-8f1b-e5d318bf8849">

Release Notes:

- N/A
2024-02-25 13:21:20 -05:00
Marshall Bowers
b29946130e Hoist languages crate's dependencies to the workspace level (#8394)
This PR hoists all of the dependencies of the `languages` crate to the
workspace level.

Release Notes:

- N/A
2024-02-25 12:02:59 -05:00
Marshall Bowers
368fec2822 Format scripts with Prettier (#8393)
This PR does a one-off format of some of our scripts using Prettier.

Release Notes:

- N/A
2024-02-25 11:03:33 -05:00
Bennet Bo Fenner
934af6ad45 recent projects: fix list flashing/empty (#8376)
If the list is large (size > overdraw + available height) the
`all_rendered` check was preventing the list from returning an inferred
size. Theoretically we can now report heights which are actually too
small (because not all items were affected during layout), this can be
manually adjusted using the overdraw parameter. In this case its fine
because the picker is inside a max_height which should never be more
then the overdraw we specify (1000 px), and the list will shrink down
either way when the request_measured_layout callback is called again.

Release Notes:

- Fixed flashing of recent projects list when there were a lot of
projects in the list
([#8364](https://github.com/zed-industries/zed/issues/8364#issuecomment-1962849393)).
2024-02-25 17:22:01 +02:00
Marshall Bowers
053b6cc715 Rework extension filtering to use a ToggleButton (#8387)
This PR reworks the extension filtering to use a `ToggleButton`, since
the filter states are mutually-exclusive.

<img width="1136" alt="Screenshot 2024-02-25 at 10 04 59 AM"
src="https://github.com/zed-industries/zed/assets/1486634/52c621da-201c-42b9-805d-62e3ab66f94b">

Release Notes:

- N/A
2024-02-25 10:17:50 -05:00
Hugo Urías
37a12a366f Fix double menu item separator in "Help" section of app menu (#8351)
I've modified the code at `crates/zed/src/app_menus.rs` as it looks like
there was a typo and instead of one
`MenuItem::separator()` there were two.

It would be something like this:

<img width="1512" alt="Captura de pantalla 2024-02-25 a las 16 12 10"
src="https://github.com/zed-industries/zed/assets/93369643/d35d5b57-247c-4a1f-b65a-a1b68cd302b9">
2024-02-25 10:17:10 -05:00
Joseph T. Lyons
633e31a47f Allow extensions to be filtered on installed and not installed (#8375)
Partially resolves: https://github.com/zed-industries/zed/issues/7785

Right now, we can engage `Only show installed`, but I've been wanting to
be able to filter down to just uninstalled extensions too, so I can
browse things I don't have. I changed this to have 2 checkboxes,
`Installed` and `Not installed` and both are on by default. You deselect
them to filter down.

<img width="1608" alt="SCR-20240225-etyg"
src="https://github.com/zed-industries/zed/assets/19867440/e2267651-ff86-437b-ba59-89f3d338ea02">

Release Notes:

- Allow extensions list to be filtered down to both installed and not
installed.
2024-02-25 05:07:13 -05:00
Kirill Bulatov
882cd6e52f Revert "Bump tree-sitter, wasmtime (#8306)" (#8373)
This reverts commit d4973846c0.

Fixes https://github.com/zed-industries/zed/issues/8360 and
https://github.com/zed-industries/zed/issues/8362


Release Notes:

- N/A
2024-02-25 10:35:19 +02:00
Dzmitry Malyshau
83f493b387 Clean up deps for file_finder, language_selector, task, rpc, storybook (#8353)
Following-up on #8330

Invocation
```bash
cargo-machete --with-metadata --skip-target-dir --fix
````

There is more stuff to fix, but it chokes on `async-lock`:
```
cargo-machete found the following unused dependencies in /x/Code/zed:
rpc -- /x/Code/zed/crates/rpc/Cargo.toml:
        async_lock
        prost_build
        serde_derive
Error: Dependency async_lock not found
```

Release Notes:
- N/A
2024-02-25 10:10:07 +02:00
rmu
dbe1f48f95 ocaml: Small query improvements and fix autoclose brackets (#7769)
Turns out auto-closing words was a bad idea. win**do**w, **struct**ure,
**sig**n and so on

They don't serve any purpose in `config.toml` nor `brackets.scm` at this
point, so I removed them>

Release Notes:
- N/A
2024-02-24 19:06:25 -05:00
Marshall Bowers
401798d9b8 Remove unused plugin crates (#8350)
This PR removes the unused crates for plugin support.

We're currently exploring Wasm-based extensions, and it's unlikely that
we'll be reusing any of this existing work.

Release Notes:

- N/A
2024-02-24 19:05:18 -05:00
Dzmitry Malyshau
35bec9803a Clean up dependencies of call,lsp,project,settings,vim,welcome, and workspace (#8330)
Based on the product of
[cargo-machete](https://blog.benj.me/2022/04/27/cargo-machete/):

[dependencies.txt](https://github.com/zed-industries/zed/files/14392213/dependencies.txt)

Release Notes:
- N/A
2024-02-25 00:41:28 +02:00
Max Brunsfeld
d4973846c0 Bump tree-sitter, wasmtime (#8306)
Fixes
https://github.com/zed-industries/zed/issues/8296#issuecomment-1961957369

Release Notes:

- Fixed a crash that would happen when loading an extension that added a
grammar that was generated using a very old version of Tree-sitter
([#8296](https://github.com/zed-industries/zed/issues/8296)).

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-24 14:24:29 -08:00
Kirill Bulatov
16d826a3f4 Show keybindings instead of the action names in the recent project modal 2024-02-25 00:08:57 +02:00
Kirill Bulatov
c29ea9bdbc Allow using context in the placeholder_text method 2024-02-25 00:08:57 +02:00
Hugo Urías
cf3b875922 Add icon for R files (#8223)
Add an icon from https://www.svgrepo.com/svg/340612/logo-r-script for .r

<img width="1392" alt="307467014-63f68791-9d74-4bd1-8065-3698665f7c15"
src="https://github.com/zed-industries/zed/assets/93369643/ce24615c-6946-479a-8660-663bf83a7dde">

Credits For Image: @moshyfawn

Release Notes:

- Added R logo
2024-02-24 23:01:39 +02:00
Ngô Quốc Đạt
3ddf2f27d3 Add bun file icon (#8322)
Add bun file icon, source from https://bun.sh/press-kit

![Screenshot 2024-02-24 at 12 32
12](https://github.com/zed-industries/zed/assets/56961917/ebc731a6-5c78-481e-99da-f78f03574fad)

Release Notes:

- Added a bun file icon
2024-02-24 22:40:22 +02:00
Chase Bellisime
d1b58601a1 Add plus and dollar sign to terminal paths (#8321)
After fix (file path is now clickable):
<img width="1019" alt="Screenshot 2024-02-23 at 8 59 45 PM"
src="https://github.com/zed-industries/zed/assets/63214891/cbdcb0f5-cd58-436b-9980-f657436f2bc0">

Before fix:
<img width="936" alt="Screenshot 2024-02-23 at 9 15 25 PM"
src="https://github.com/zed-industries/zed/assets/63214891/72d27155-a708-4b8d-a0b6-85d1e9031627">

Release Notes:

- Fixed an issue with terminal paths not allowing links when the path
included `+` or `$` symbols.
([#8256](https://github.com/zed-industries/zed/issues/#8256)).
2024-02-24 21:39:34 +02:00
Roman
7d366cc974 Merge pull request #1 from tadeokondrak/calloop
linux/x11: Move from dedicated thread to fd source for event loop
2024-02-24 12:34:33 +03:00
Dzmitry Malyshau
d895388809 linux: profile text system functions 2024-02-24 00:04:00 -08:00
Dzmitry Malyshau
76196694b7 Fix unused warning in time_format 2024-02-24 00:04:00 -08:00
Tadeo Kondrak
fa769b06cf linux: Call quit callback in the right place 2024-02-24 00:53:22 -07:00
Tadeo Kondrak
42b7dd1f36 linux/x11: Draw only after other events processed 2024-02-24 00:50:29 -07:00
Tadeo Kondrak
c1df03f0ee linux: Remove now-empty LinuxPlatformState 2024-02-24 00:44:28 -07:00
Tadeo Kondrak
1f4f3bfaba linux: Stop event loop directly 2024-02-24 00:43:44 -07:00
Tadeo Kondrak
da917a439c linux: Check for X11 events before event loop sleeps 2024-02-24 00:40:17 -07:00
Tadeo Kondrak
db814546dc linux: Use None instead of Duration::MAX 2024-02-24 00:35:07 -07:00
Tadeo Kondrak
75d8c044ce linux/x11: Move from dedicated thread to fd source for event loop 2024-02-24 00:19:33 -07:00
Marshall Bowers
ba4e1699ae Rename ZedHttpClient for clarity (#8320)
This PR renames the `ZedHttpClient` to `HttpClientWithUrl` to make it
slightly clearer that it still is holding a `dyn HttpClient` as opposed
to being a concrete implementation.

Release Notes:

- N/A
2024-02-24 00:07:24 -05:00
Ivan Buryak
58463b2e97 Add icon for GraphQL files (#8213)
Add an icon from https://graphql.org/brand/ for `.graphql`


![Examples@2x](https://github.com/zed-industries/zed/assets/4057095/9751a509-0dca-4611-b98f-277307c4bfe7)
2024-02-23 22:03:02 -05:00
Marshall Bowers
03b0764df4 Replace time_format license with symlink 2024-02-23 21:54:39 -05:00
Marshall Bowers
c59aab5090 Adjust labels of buttons in extension list based on status (#8319)
This PR makes the labels of the buttons in the extension list adapt to
reflect the current status.

Release Notes:

- Changed the button labels in the extension list to reflect the current
status.
2024-02-23 21:53:14 -05:00
vultix
2e616f8388 Add new argument vim text object (#7791)
This PR adds a new `argument` vim text object, inspired by
[targets.vim](https://github.com/wellle/targets.vim).

As it's the first vim text object to use the syntax tree, it needed to
operate on the `Buffer` level, not the `MultiBuffer` level, then map the
buffer coordinates to `DisplayPoint` as necessary.

This required two main changes:
1. `innermost_enclosing_bracket_ranges` and `enclosing_bracket_ranges`
were moved into `Buffer`. The `MultiBuffer` implementations were updated
to map to/from these.
2. `MultiBuffer::excerpt_containing` was made public, returning a new
`MultiBufferExcerpt` type that contains a reference to the excerpt and
methods for mapping to/from `Buffer` and `MultiBuffer` offsets and
ranges.

Release Notes:
- Added new `argument` vim text object, inspired by
[targets.vim](https://github.com/wellle/targets.vim).
2024-02-23 19:37:13 -07:00
Bennet Bo Fenner
dc7e14f888 Respect user preferences when formatting timestamp (#7994)
This is a follow up to #7945. The current behaviour reads the locale and
infers from that which type of time format should be used (12 hour/24
hour).
However, in macOS you can override this behaviour, e.g. you can use
en_US locale but still use the 24 hour clock format (Can be customized
under Settings > General > Date & Format > 24-hour time). You can even
customize the date format.

This PR uses the macOS specific `CFDateFormatter` API, which outputs
time format strings, that respect those settings.

Partially fixes #7956 (as its not implemented for linux)

Release Notes:

- Added localization support for all macOS specific date and time
configurations in chat
2024-02-23 19:18:06 -07:00
Marshall Bowers
7599933f30 Fix uploads to edit_events table (#8318)
This PR fixes uploads the `edit_events` table.

We were trying to insert into a column that didn't exist:

```
HTTP error 500 Internal Server Error: failed to upload to table 'edit_events'

Caused by:
    bad response: Code: 16. DB::Exception: No such column os_name in table default.edit_events
```

Release Notes:

- N/A
2024-02-23 20:58:45 -05:00
Max
622cae19eb Fix alignment of traffic lights (#8128)
closes #7339
2024-02-23 20:09:14 -05:00
Marshall Bowers
e06ff5f507 Use SystemClock in EventCoalescer (#8317)
This PR updates the `EventCoalescer` to use the `SystemClock` trait to
abstract over the clock.

This allows us to test the advancement of time without relying on the
caller passing in the current time.

Release Notes:

- N/A
2024-02-23 20:07:13 -05:00
Paul Berg
9b44ba9382 linux/text: fix invalid span creation (#8286)
This fixes a crash when showing completions.

Release Notes:

- N/A
2024-02-23 17:03:00 -08:00
白山風露
aef299be3d CI: Enable clippy on Windows (#8240)
Release Notes:

- N/A
2024-02-23 16:23:42 -08:00
Dzmitry Malyshau
885ae2d863 linux/x11: prioritize input in the event loop (#8253)
With this change, interaction with Zed is actually real-time and usable
🚀 🎉

The gist of it is - trying to process all of the input events before
rendering anything.

Release Notes:
- N/A

**Note**: this can be further improved in a follow-up.
Currently, once the input and runnables are processed, we'd try to draw
+ render a frame.
Presentation starts with acquiring a new frame. We currently have FIFO
presentation method, so acquiring a frame is blocking on that swapchain
image to become available. As the result, presentation takes around 16
ms, most of which is just busy wait.
Ideally, we'd be able to process more input in this time frame, instead.

**Note2**: it's a bit laggy in Debug for me, but that's just because of
the extra-long `draw` times, which is unrelated to rendering (or
platform support, for the matter). I'm curious how come on MacOS the
`draw()` times in Debug are more modest.
2024-02-23 16:22:54 -08:00
Mikayla Maki
cab8b5a9a3 Switch LSP prompts to use a non-blocking toast (#8312)
This fixes a major degradation in usability that some users ran into.

Fixes https://github.com/zed-industries/zed/issues/8255 
Fixes https://github.com/zed-industries/zed/issues/8229

Release Notes:

- Switch from using platform prompts to toasts for LSP prompts.
([8255](https://github.com/zed-industries/zed/issues/8255),
[8229](https://github.com/zed-industries/zed/issues/8229))

<img width="583" alt="Screenshot 2024-02-23 at 2 40 05 PM"
src="https://github.com/zed-industries/zed/assets/2280405/1bfc027b-b7a8-4563-88b6-020e47869668">

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 15:18:32 -08:00
witelokk
144d790ee3 rewrite linux event loop using calloop
Co-authored-by: Tadeo Kondrak <me@tadeo.ca>
2024-02-24 01:55:10 +03:00
Wes Morgan
d993dd3b2c Add .cljc, .edn, & .bb to Clojure filename extensions (#8285)
Release Notes:

- Added .cljc, .edn, & .bb to Clojure filename extensions
([#7845](https://github.com/zed-industries/zed/issues/7845)).
2024-02-23 23:46:27 +02:00
Conrad Irwin
351e6a5de2 Expose extensions API from api.zed.dev (#8307)
This avoids the need to pay for bandwidth

Co-Authored-By: Marshall <marshall@zed.dev>



Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 16:08:14 -05:00
Conrad Irwin
41949d7b6c Log HTTP path in http logs (#8305)
Co-Authored-By: Marshall <marshall@zed.dev>


Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 15:50:27 -05:00
Conrad Irwin
0fbd0d6649 collab: Log HTTP requests (#8297)
Co-Authored-By: Marshall <marshall@zed.dev>



Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-23 14:50:06 -05:00
Conrad Irwin
69c7d0e549 oops 2024-02-23 12:38:36 -07:00
Marshall Bowers
d3a38c69cd Only spawn the extensions reconciliation task in the collab service (#8301)
This PR makes it so the background task that reconciles the extensions
database with the blob store only runs on the `collab` service.

This avoids us having multiple of these jobs running at once.

Release Notes:

- N/A
2024-02-23 14:38:16 -05:00
Conrad Irwin
7c514d044f Fix collab (#8298)
Co-Authored-By: Marshall <marshall@zed.dev>

We broke it by deploying two servers simultaneously.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 14:23:15 -05:00
ethan
a11ebe01ff Fix Flashing Hover Popover (#8238)
Release Notes:

- Use an inclusive range for local range containment check to match LSP
behavior & fix popover flashing while the cursor moves over the last
character of a symbol.


https://github.com/zed-industries/zed/assets/17223924/6c3ddc9c-04fb-4414-812f-025ede5ecaf7
2024-02-23 11:38:20 -07:00
Conrad Irwin
c5bb032224 Fix error logging (#8295)
and some more clickhouse type mismatches,

Co-Authored-By: Marshall <marshall@zed.dev>

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 13:36:20 -05:00
Conrad Irwin
58fd84308d Disable swift for now (#8291)
It causes segfaults on load

Release Notes:

- Fixed a segfault opening a Swift file with the Swift extension
installed.
2024-02-23 11:04:48 -07:00
Rom Grk
008d99d206 Wayland: implement key repeat (#8038)
Wayland requires the client to implement key repetition. This PR
implements the functionality as it's supposed to, but I don't see the
`repeat_info` event come in so the feature uses the default values (but
my system is configured for a much smaller `delay` and a much faster
`rate`). But this is good enough for now.

https://wayland-book.com/seat/keyboard.html#key-repeat


[Kooha-2024-02-20-20-42-12.webm](https://github.com/zed-industries/zed/assets/1423607/fb9fc327-efb7-43d1-9b53-1f8a3d9ba608)
2024-02-23 12:48:27 -05:00
Conrad Irwin
3bc7cd66b7 Allow typing space in workspace::SendKeystrokes (#8288)
Fixes #8222

Release Notes:

- N/A
2024-02-23 10:40:12 -07:00
Conrad Irwin
b0872b5b57 Deploy the ZED_CLIENT_CHECKSUM_SEED too (#8289)
Release Notes:

- N/A
2024-02-23 10:40:02 -07:00
Uladzislau Kaminski
602fd58929 Fix for toggles on the Welcome page (#8159)
Release Notes:

The issue is that when welcome page appears settings.json file is not
created yet. So the idea of this fix is to create the file in case it is
not there yet.

- Fixed the toggles on the welcome screen not working if no settings
file exists yet.
([#8153](https://github.com/zed-industries/zed/issues/8153)).

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 18:24:04 +01:00
Thorsten Ball
ed3bb68206 Do not display inlay hints as bold (#8283)
I think bold is the least fitting font weight for inlay hints, which
should be subtle hints and not, well, bold.

If someone feels strongly about this, I can revert, but only if we add
the ability to change this per theme.

Until then: beautiful, thin, subtle inlay hints!

Release Notes:

- Improved styling of inlay hints by not making them bold in the editor.


![screenshot-2024-02-23-17 30
29@2x](https://github.com/zed-industries/zed/assets/1185253/89c2a162-76bb-45cd-8b45-2a5bdf8ca87b)
2024-02-23 18:17:13 +01:00
Marshall Bowers
522176d414 Adjust Kubernetes manifests for deploying API service (#8281)
This PR adjusts our Kubernetes manifests for deploying the new API
service.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-23 12:14:40 -05:00
Conrad Irwin
f19ab464c7 Add telemetry events backend for collab (#8220)
Send telemetry to collab not zed.dev

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-23 11:13:28 -05:00
Thorsten Ball
6d91224882 Debounce language server reinstall attempts (#8277)
I don't think there's value in retrying 4 times as fast as possible,
especially if we might hit the Github API every time to check for the
newest version.

That gets us in rate limit problems quickly.

Release Notes:

- N/A
2024-02-23 17:00:05 +01:00
Conrad Irwin
351c8c9a36 fix vim panics (#8245)
Release Notes:

- vim: Fixed a panic when using H/M/L when scrolled beyond the end of
the buffer
2024-02-23 08:31:41 -07:00
Bennet Bo Fenner
c90065e6ea chat: add copy text entry to message menu (#8271)
As we don't have selection inside the chat right now (which might be
complicated to implement, e.g. cross element selection and markdown
blocks), I think its viable to support copying the whole text of a
message using the message menu:

![image](https://github.com/zed-industries/zed/assets/53836821/6092dfed-0297-457e-9455-ba1e6190e288)

Release Notes:

- Added option to copy the text of a message within the chat
2024-02-23 08:00:20 -07:00
Piotr Osiewicz
0f584cb353 chore: Extract languages from zed crate (#8270)
- Moves languages module from `zed` into a separate crate. That way we
have less of a long pole at the end of compilation.
- Removes moot dependencies on editor/picker. This is totally harmless
and might help in the future if we decide to decouple picker from
editor.

Before:
```
Number of crates that depend on 'picker' but not on 'editor': 1
Total number of crates that depend on 'picker': 13
Total number of crates that depend on 'editor': 30
```
After:
```
Number of crates that depend on 'picker' but not on 'editor': 5
Total number of crates that depend on 'picker': 12
Total number of crates that depend on 'editor': 26
```
The more crates depend on just picker but not editor, the better in that
case.

Release Notes:

- N/A
2024-02-23 15:56:08 +01:00
Thorsten Ball
7cf0696c89 Pick up more home dir shell env when spawning (#8273)
Release Notes:

- Improved how Zed picks up shell environment when spawned.
2024-02-23 15:20:31 +01:00
Robin Pfäffle
576f8d3ef3 Fix svelte injections / outline (#8194)
This PR fixes the buffer symbol search to show `js` and `ts` buffer
symbols when using svelte components with `ts`.

Does also seem to improve `ts` capabilities (probably because there has
been a conflict of `js` and `ts` before).

Unfortunately when changing the script tag from no lang attribute to
`ts` one needs to update the file (input anyting) to get correct buffer
symbol search.

Before:

![SCR-20240222-mthf-2](https://github.com/zed-industries/zed/assets/67913738/980cf4bf-15d5-478d-a217-ed8f2b1f197d)

After:

![SCR-20240222-mvjr](https://github.com/zed-industries/zed/assets/67913738/41069e75-77ef-40fe-92d1-c19912b34770)

Release Notes:

- Fixed svelte outlines for `TS`.
2024-02-23 15:12:28 +01:00
Thorsten Ball
42ac9880c6 Detect and possibly use user-installed gopls / zls language servers (#8188)
After a lot of back-and-forth, this is a small attempt to implement
solutions (1) and (3) in
https://github.com/zed-industries/zed/issues/7902. The goal is to have a
minimal change that helps users get started with Zed, until we have
extensions ready.

Release Notes:

- Added detection of user-installed `gopls` to Go language server
adapter. If a user has `gopls` in `$PATH` when opening a worktree, it
will be used.
- Added detection of user-installed `zls` to Zig language server
adapter. If a user has `zls` in `$PATH` when opening a worktree, it will
be used.

Example:

I don't have `go` installed globally, but I do have `gopls`:

```
~ $ which go
go not found
~ $ which gopls
/Users/thorstenball/code/go/bin/gopls
```

But I do have `go` in a project's directory:

```
~/tmp/go-testing φ which go
/Users/thorstenball/.local/share/mise/installs/go/1.21.5/go/bin/go
~/tmp/go-testing φ which gopls
/Users/thorstenball/code/go/bin/gopls
```

With current Zed when I run `zed ~/tmp/go-testing`, I'd get the dreaded
error:

![screenshot-2024-02-23-11 14
08@2x](https://github.com/zed-industries/zed/assets/1185253/822ea59b-c63e-4102-a50e-75501cc4e0e3)

But with the changes in this PR, it works:

```
[2024-02-23T11:14:42+01:00 INFO  language::language_registry] starting language server "gopls", path: "/Users/thorstenball/tmp/go-testing", id: 1
[2024-02-23T11:14:42+01:00 INFO  language::language_registry] found user-installed language server for Go. path: "/Users/thorstenball/code/go/bin/gopls", arguments: ["-mode=stdio"]
[2024-02-23T11:14:42+01:00 INFO  lsp] starting language server. binary path: "/Users/thorstenball/code/go/bin/gopls", working directory: "/Users/thorstenball/tmp/go-testing", args: ["-mode=stdio"]
```

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-23 13:39:14 +01:00
postsolar
65318cb6ac Re-enable PureScript on Linux and Windows (#8252)
Relevant PRs:
- https://github.com/zed-industries/zed/pull/7543
- https://github.com/zed-industries/zed/pull/7827

Release Notes:

- Fixed build issues with PureScript on Windows and Linux
2024-02-23 13:19:36 +02:00
Kirill Bulatov
71557f3eb3 Adjust "recent projects" modal behavior to allow opening projects in both current and new window (#8267)
![image](https://github.com/zed-industries/zed/assets/2690773/7a0927e8-f32a-4502-8a8a-c7f8e5f325bb)

Fixes https://github.com/zed-industries/zed/issues/7419 by changing the
way "recent projects" modal confirm actions work:
* `menu::Confirm` now reuses the current window when opening a recent
project
* `menu::SecondaryConfirm` now opens a recent project in the new window 
* neither confirm tries to open the current project anymore
* modal's placeholder is adjusted to emphasize this behavior

Release Notes:

- Added a way to open recent projects in the new window
2024-02-23 13:17:31 +02:00
Kirill Bulatov
a588f674db Ensure default prettier installs correctly when certain FS entries are missing (#8261)
Fixes https://github.com/zed-industries/zed/issues/7865

* bind default prettier (re)installation decision to
`prettier_server.js` existence
* ensure the `prettier_server.js` file is created last, after all
default prettier packages installed
* ensure that default prettier directory exists before installing the
packages
* reinstall default prettier if the `prettier_server.js` file is
different from what Zed expects

Release Notes:

- Fixed incorrect default prettier installation process
2024-02-23 12:25:56 +02:00
Dzmitry Malyshau
36da50b8cc blade: defer frame acquisition to after the path rasterization 2024-02-22 23:52:04 -08:00
Dzmitry Malyshau
25a3ad50bb linux/x11: prioritize input in the event loop 2024-02-22 23:48:28 -08:00
Rom Grk
50dd38bd02 Linux: adjust docs for building (#8246)
Improve docs & remove `vulkan-validation-layers` from the dependencies.
2024-02-22 22:56:18 -08:00
Conrad Irwin
caa156ab13 Fix a panic in the assistant panel (#8244)
Release Notes:

- Fixed a panic in the assistant panel when the app is shutting down.
2024-02-22 22:42:32 -07:00
Felipe
a82f4857f4 Add settings to control gutter elements (#7665)
The current gutter was a bit too big for my taste, so I added some
settings to change which visual elements are shown, including being able
to hide the gutter completely.

This should help with the following issues: #4963, #4382, #7422

New settings:
```json5
"gutter": {
    "line_numbers": true, // Whether line numbers are shown
    "buttons": true // Whether the code action/folding buttons are shown
}
```

The existing `git.git_gutter` setting is also taken into account when
calculating the width of the gutter.

We could also separate the display of the code action and folding
buttons into separate settings, let me know if that is desirable.

## Screenshots:

- Everything on (`gutter.line_numbers`, `gutter.buttons`,
`git.git_gutter`):
<img width="434" alt="SCR-20240210-trfb"
src="https://github.com/zed-industries/zed/assets/17355488/bcc55311-6e1d-4c22-8c43-4f364637959b">

- Only line numbers and git gutter (`gutter.line_numbers`,
`git.git_gutter`):
<img width="406" alt="SCR-20240210-trhm"
src="https://github.com/zed-industries/zed/assets/17355488/0a0e074d-64d0-437c-851b-55560d5a6c6b">

- Only git gutter (`git.git_gutter`):
<img width="356" alt="SCR-20240210-trkb"
src="https://github.com/zed-industries/zed/assets/17355488/7ebdb38d-93a5-4e38-b008-beabf355510d">

- Only git gutter and buttons (`git.git_gutter`, `gutter.buttons`):
<img width="356" alt="SCR-20240210-txyo"
src="https://github.com/zed-industries/zed/assets/17355488/e2c92c05-cc30-43bc-9399-09ea5e376e1b">


- Nothing:
<img width="350" alt="SCR-20240210-trne"
src="https://github.com/zed-industries/zed/assets/17355488/e0cd301d-c3e0-4b31-ac69-997515928b5a">



## Release Notes:
- Added settings to control the display of gutter visual elements. `"gutter": {"line_numbers": true,    "code_actions": true,    "folds": true}` ([#8041](https://github.com/zed-industries/zed/issues/8041))  ([#7422](https://github.com/zed-industries/zed/issues/7422))
```

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-22 20:37:13 -07:00
Marshall Bowers
0de8672044 Add SystemClock (#8239)
This PR adds a `SystemClock` trait for abstracting away the system
clock.

This allows us to swap out the real system clock with a
`FakeSystemClock` in the tests, thus allowing the fake passage of time.

We're using this in `Telemetry` to better mock the clock for testing
purposes.

Release Notes:

- N/A
2024-02-22 22:28:08 -05:00
Joseph T. Lyons
cc8e3c2286 Show more extensions (#8234)
This is a bandaid fix for:
https://github.com/zed-industries/zed/issues/8228.

Release Notes:

- N/A
2024-02-22 19:51:03 -05:00
Kristján Oddsson
347f68887f Support ESLint flat configs (#8109)
Not available before the new eslint language server version is released, but prepares the ground for it.

## Further reading

- https://eslint.org/docs/latest/use/configure/configuration-files-new
- https://github.com/microsoft/vscode-eslint?tab=readme-ov-file#settings-options

Release Notes:

- Added ESLint flat config support
([#7271](https://github.com/zed-industries/zed/issues/7271))
2024-02-22 22:22:31 +02:00
Small White
a475d8640f Introduce file_id on Windows (#8130)
Added a function `file_id` to get the file id on windows, which is
similar to inode on unix.

Release Notes:

- N/A
2024-02-22 11:22:12 -08:00
Dzmitry Malyshau
991c9ec441 Integrate profiling into gpui (#8176)
[Profiling](https://crates.io/crates/profiling) crate allows easy
integration with various profiler tools. The best thing is - annotations
compile to nothing unless you request a specific feature.

For example, I used this command to enable Tracy support:
```bash
cargo run --features profiling/profile-with-tracy
```
At the same time I had Tracy tool open and waiting for connection. It
gathered nice stats from the run:

![zed-profiler](https://github.com/zed-industries/zed/assets/107301/5233045d-078c-4ad8-8b00-7ae55cf94ebb)


Release Notes:
- N/A
2024-02-22 10:59:52 -08:00
Conrad Irwin
250df707bf Tidy up indicators in collab panel (#8214)
Move away from columns of icons towards the "changed" info dot we used
for files.

Secondary actions for chat/notes still show up (if you're lucky) on
hover.

Co-Authored-By: Marshall <marshall@zed.dev>



Release Notes:

- Improved design of collab panel

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-22 13:30:43 -05:00
Michael Angerman
ba6b319046 Add an app_menu to Storybook which enables quitting with cmd-q (#8166)
I really think storybook is a cool standalone app but there are some
usability issues that are getting in the way of making this a fun tool
to use.

Currently it is not easy to gracefully exit out of storybook.

In fact even trying to Ctrl-c out of storybook seems currently broken to
me...

So the only real way to exit out of storybook is to kill the process
after a Ctrl-z.

This PR attempts to make this much easier by adding a simple app_menu
with a menu item called quit along with the ability to *Cmd-q* out of
storybook as well...

Both the menu item quit and *Cmd-q* gracefully exit storybook.

There are still a bunch of issues with storybook which I plan on
addressing in future PR's but this is a start and something that to me
is the highest priority to make storybook more functional and easy to
use moving forward.

One of my longer term goals of storybook is to have it be a nice stand
alone application similar to
[Loungy](https://github.com/MatthiasGrandl/Loungy) which can be used as
a nice tutorial application for how to develop a real world *gpui* app.

For that reason I added a *assets/keymaps/storybook.json* file as well.
2024-02-22 12:51:40 -05:00
Rom Grk
bd94a0e921 Wayland: implement focus events (#8170)
Implements keyboard focus in/out events.

This also enables vim mode to work on wayland, which is only activated
when an editor gains focus.
2024-02-22 09:51:09 -08:00
apricotbucket28
40bbd0031d linux: fix reveal_path for files (#8162)
Fixes 'Reveal in Finder' opening files instead of showing them in the
file explorer.
Tested on Fedora KDE 39.

Release Notes:

- N/A
2024-02-22 09:49:36 -08:00
Rom Grk
946f4a312a Wayland: avoid replacing text with empty string (#8103)
Fix an issue where the `ime_key` is sometimes an empty string, and
pressing a keystroke replaces the selected text.

E.g. select some text, press `Escape`: selected text is deleted.
2024-02-22 09:48:15 -08:00
Marshall Bowers
af06063d31 Add checkbox to only show installed extensions (#8208)
This PR adds a checkbox to the extensions view to allow filtering to
just extensions that are installed:

<img width="1408" alt="Screenshot 2024-02-22 at 12 05 40 PM"
src="https://github.com/zed-industries/zed/assets/1486634/b5e82941-53be-432e-bfe5-fec7fd0959c5">

Release Notes:

- Added a checkbox to the extensions view to only show installed
extensions.
2024-02-22 12:16:02 -05:00
Mahdy M. Karam
5c4f3c0cea Add option to either use system clipboard or vim clipboard (#7936)
Release Notes:

- vim: Added a setting to control default clipboard behaviour. `{"vim":
{"use_system_clipboard": "never"}}` disables writing to the clipboard.
`"on_yank"` writes to the system clipboard only on yank, and `"always"`
preserves the current behavior. ([#4390
](https://github.com/zed-industries/zed/issues/4390))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-22 10:12:29 -07:00
Conrad Irwin
c6826a61a0 talkers (#8158)
Release Notes:

- Added an "Unmute" action for guests in calls. This lets them use the
mic, but not edit projects.
2024-02-22 10:07:36 -07:00
Piotr Osiewicz
fa2c92d190 Editor: tweak label for "Go to implementation" tabs (#8201)
No release notes as this is a followup to #7890 
Release Notes:

- N/A
2024-02-22 17:06:25 +01:00
Conrad Irwin
20b10fdca9 Add ./script/symbolicate (#8165)
This lets you get a readable backtrace from an .ips file of a crash
report.

Release Notes:

- N/A
2024-02-22 08:50:39 -07:00
Kirill Bulatov
4f40d3c801 Require prerelease eslint version (#8197)
Fixes https://github.com/zed-industries/zed/issues/7650

Release Notes:

- Fixed eslint diagnostics not showing up due to old eslint version used
2024-02-22 16:33:08 +02:00
Leon Huston
b716035d02 Editor: support go to implementation (#7890)
Release Notes:

- Added "Go to implementation" support in editor.
2024-02-22 14:22:04 +01:00
Piotr Osiewicz
94bc216bbd worktree: Do not scan for .gitignore files beyond project root. (#8189)
This has been fixed and reported before (and got lost in gpui1->gpui2
transition);
https://github.com/zed-industries/zed/issues/5749#issuecomment-1959217319

Release Notes:

- Fixed .gitignore files beyond the first .git directory being respected
by the worktree (zed-industries/zed#5749).
2024-02-22 13:16:19 +01:00
Ngô Quốc Đạt
95d5ea7edc Add "Extensions" item to user menu (#8183)
<img width="274" alt="Screenshot 2024-02-22 at 18 12 52"
src="https://github.com/zed-industries/zed/assets/56961917/9057d1be-bedb-474a-a663-c53d62366f26">

Release Note:

- Add "Extensions" menu item to the UI
2024-02-22 14:01:20 +02:00
Jason Lee
aff858bd00 Added a cmd-backspace keybinding to delete files in the project panel. (#8163)
Fixes #7228

Release Notes:

- Added a `cmd-backspace` keybinding to delete files in the project panel ([7228](https://github.com/zed-industries/zed/issues/7228))
2024-02-22 12:59:01 +02:00
Thorsten Ball
583d85cf66 Do not add empty tasks to inventory (#8180)
I ran into this when trying out which keybindings work and accidentally
added empty tasks. They get then added to the task inventory and
displayed in the picker.

Release Notes:

- Fixed empty tasks being added to the list of tasks when using `task:
spawn`

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-02-22 12:21:19 +02:00
Xinzhao Xu
36586b77ec gpui: use a separate image in the image example and remove unnecessary examples (#8181)
Follow-up of https://github.com/zed-industries/zed/pull/8174#issuecomment-1959031659,
Fixes image example and removes window-less "noop" example.

<img width="1975" alt="Screenshot 2024-02-22 at 17 34 15"
src="https://github.com/zed-industries/zed/assets/9134003/060d8484-63b6-415a-9f06-189542422457">

Release Notes:
- N/A
2024-02-22 11:47:24 +02:00
Robin Pfäffle
587788b9a0 Update docs for inlay hints (#8178)
Follow up of #7943. 
Updates the docs for inlay hints as they are incorrect (for Svelte).

Release Notes:

- N/A
2024-02-22 11:40:49 +02:00
Xinzhao Xu
6f36527bc6 gpui: add example sections in Cargo.toml (#8174)
So that we can run the example simply by `cargo run --example hello_world`

Release Notes:
- N/A
2024-02-22 11:18:34 +02:00
Hans
aa34e306f7 Fix removal of brackets inserted by auto-close when using snippets (#7265)
Release Notes:

- Fixed auto-inserted brackets (or quotes) not being removed when they
were inserted as part of a snippet.
([#4605](https://github.com/zed-industries/issues/4605))

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-02-22 10:09:10 +01:00
Joseph T. Lyons
e5d971f4c7 Add url preview tooltip to repository link in extensions view (#8179)
Because the `repository` url field is defined via the user's
`extension.json` file, a user could insert a malicious link. I want to
be able to preview repository urls before clicking the button.

Release Notes:

- Add url preview tooltip to repository link in extensions view.
2024-02-22 03:46:01 -05:00
Joseph T. Lyons
38c3a93f0c Add action to open release notes locally (#8173)
Fixes: https://github.com/zed-industries/zed/issues/5019

zed.dev PR: https://github.com/zed-industries/zed.dev/pull/562

I've been wanting to be able to open release notes in Zed for awhile,
but was blocked on having a rendered Markdown view. Now that that is
mostly there, I think we can add this. I have not removed the `auto
update: view release notes` action, since the Markdown render view
doesn't support displaying media yet. I've opted to just add a new
action: `auto update: view release notes locally`. I'd imagine that in
the future, once the rendered view supports media, we could remove `view
release notes` and `view release notes locally` could replace it.
Clicking the toast that normally is presented on update
(https://github.com/zed-industries/zed/issues/7597) would show the notes
locally.

The action works for stable and preview as expected; for dev and
nightly, it just pulls the latest stable, for testing purposes.

I changed the way the markdown rendered view works by allowing a tab
description to be passed in.

For files that have a name, it will use `Preview <name>`:

<img width="1496" alt="SCR-20240222-byyz"
src="https://github.com/zed-industries/zed/assets/19867440/a0ef34e5-bd6d-4b0c-a684-9b09d350aec4">

For untitled files, it defaults back to `Markdown preview`:

<img width="1496" alt="SCR-20240222-byip"
src="https://github.com/zed-industries/zed/assets/19867440/2ba3f336-6198-4dce-8867-cf0e45f2c646">

Release Notes:

- Added a `zed: view release notes locally` action
([#5019](https://github.com/zed-industries/zed/issues/5019)).


https://github.com/zed-industries/zed/assets/19867440/af324f9c-e7a4-4434-adff-7fe0f8ccc7ff
2024-02-22 02:20:06 -05:00
Tung Hoang
f930969411 Allow removing workspaces from the "recent projects" modal (#7885)
<img width="492" alt="Screenshot 2024-02-19 at 10 59 01 AM"
src="https://github.com/zed-industries/zed/assets/1823955/922117f6-81c1-409d-938a-131bcec0f24c">

<img width="675" alt="Screenshot 2024-02-19 at 10 59 27 AM"
src="https://github.com/zed-industries/zed/assets/1823955/fefac68b-9a99-43bb-ac0c-724e7c622455">

Release Notes:

- Added a way to remove entries from the recent projects modal
([7426](https://github.com/zed-industries/zed/issues/7426)).
2024-02-22 01:30:02 +02:00
eyecreate
266bb62813 Update linux deps to include opensuse (#8127)
Release Notes:

- Added support for openSuse to Linux dependency installer script.
2024-02-21 15:01:33 -08:00
Conrad Irwin
6e897d9969 buf-version (#8154)
Release Notes:

- N/A
2024-02-21 15:29:11 -07:00
Ferdinand Theil
d90b052162 Update dependencies to include openssl (#8136)
Openssl is required by the `openssl-sys` crate. Trying to build zed on a
Fedora 39 workstation install. This is the error I got from the
compiler.

```
error: failed to run custom build command for `openssl-sys v0.9.93`

Caused by:
  process didn't exit successfully: `/home/dionysus/git/zed/target/debug/build/openssl-sys-9f784a7979d04ba8/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 1
  error: could not find system library 'openssl' required by the 'openssl-sys' crate

  --- stderr
  Package openssl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `openssl.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'openssl', required by 'virtual:world', not found


  --- stderr
  thread 'main' panicked at /home/dionysus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.93/build/find_normal.rs:190:5:


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.93


  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...```

I didn't explicitly test this patch on arch or debian.


Release Notes:

- Added/Fixed/Improved ... ([#8135](https://github.com/zed-industries/zed/issues/8135)).
2024-02-21 13:57:39 -08:00
Bennet Bo Fenner
49a53e7654 titlebar: show placeholder when no project is selected (#8021)
When no project is selected, the recent project dropdown is displaying
an empty string, making the button basically impossible to click. This
PR adds a placeholder value for that case.

Here is what it looks like now:

![image](https://github.com/zed-industries/zed/assets/53836821/c831a1eb-722e-4189-8f8b-8b3039daf8f8)



Release Notes:

- Added placeholder to titlebar when no project is selected
2024-02-21 14:08:20 -07:00
Marshall Bowers
3220986fc9 Format docs with Prettier (#8134)
This PR formats the docs with Prettier.

Release Notes:

- N/A
2024-02-21 13:21:22 -05:00
Dzmitry Malyshau
9fcda5a5ac blade: quad render fast path (#8110)
Ported from #7231

Release Notes:
- N/A
2024-02-21 10:04:24 -08:00
Joseph T. Lyons
5e43290aa1 v0.125.x dev 2024-02-21 12:22:41 -05:00
Kirill Bulatov
f895d66d1c Make language server id more explicit in unhandled message logs (#8131)
Before:
```
[2024-02-21T18:55:55+02:00 INFO  language::language_registry] starting language server "eslint", path: "/Users/someonetoignore/Downloads/eslint-configs-demo", id: 2
[2024-02-21T18:55:56+02:00 INFO  lsp] 2 unhandled notification window/logMessage:
{
  "type": 3,
  "message": "ESLint server running in node v18.15.0"
}
[2024-02-21T18:55:56+02:00 INFO  lsp] 2 unhandled notification eslint/confirmESLintExecution:
{
  "scope": "local",
  "uri": "file:///Users/someonetoignore/Downloads/eslint-configs-demo/index.js",
  "libraryPath": "/Users/someonetoignore/Downloads/eslint-configs-demo/node_modules/eslint/lib/api.js"
}
```

After:
```
[2024-02-21T18:57:31+02:00 INFO  language::language_registry] starting language server "eslint", path: "/Users/someonetoignore/Downloads/eslint-configs-demo", id: 2
[2024-02-21T18:57:32+02:00 INFO  lsp] Language server with id 2 sent unhandled notification window/logMessage:
{
  "type": 3,
  "message": "ESLint server running in node v18.15.0"
}
[2024-02-21T18:57:32+02:00 INFO  project::prettier_support] Fetching default prettier and plugins: [("prettier-plugin-tailwindcss", "0.5.11"), ("prettier", "3.2.5")]
[2024-02-21T18:57:32+02:00 INFO  lsp] Language server with id 2 sent unhandled notification eslint/confirmESLintExecution:
{
  "scope": "local",
  "uri": "file:///Users/someonetoignore/Downloads/eslint-configs-demo/index.js",
  "libraryPath": "/Users/someonetoignore/Downloads/eslint-configs-demo/node_modules/eslint/lib/api.js"
}
```

We have to pass a name there too, but the problem here is that the
unhandled message callback is created very early, along with the binary,
but the server name is received from the LSP initialize response, which
is a totally separate piece of code.
I plan to refactor that code next, but so far, improve the logs at least
slightly.

Release Notes:

- N/A
2024-02-21 19:11:23 +02:00
Ivan Buryak
7bf16f263e Fix a bug when extension loading is failed after it's folder is viewed by MacOS finder (#8111)
Fixes #8096

# Bug description

I was experimenting with adding extensions and almost went crazy trying
to make my demo extension work. It appeared that I was copying files
with Finder that creates hidden `.DS_Store` files which interfered with
Zed's loading logic. It assumes that `languages/` directory contains
only directories and never files and so it crashes when meets
`.DS_Store`. This makes any extension stop working after it has been
viewed via Finder

# Change

Check if path is directory when loading extension languages (so it will
skip .DS_Store files)
2024-02-21 08:46:58 -08:00
Kyber
d3745a3931 Document new theme options (#7899)
Added documentation for
[#4970](https://github.com/zed-industries/zed/issues/4970), a feature
added in the latest update. Will need to modify `Default Settings` to
reflect the new default theme example.

Release Notes:

- N/A
2024-02-21 11:12:10 -05:00
Kirill Bulatov
0c939e5dfc Add task docs and default keybindings (#8123)
Also group task source modules together

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-02-21 16:43:56 +02:00
Piotr Osiewicz
b9151b9506 Runnables: remove version field from the format (#8118)
This changes the format of runnables slightly (the top-level object is
now a sequence, not a map).
The 2nd commit pulls in aliases from .zshrc and co.
Release Notes:

- N/A
2024-02-21 14:30:16 +01:00
Kirill Bulatov
2679457b02 Rename runnables into tasks (#8119)
Release Notes:

- N/A
2024-02-21 14:56:43 +02:00
Thorsten Ball
45e2c01773 Copilot: handle "ok" status message when no user is set (#8116)
In #6954 a user has trouble using copilot. We haven't gotten to the
bottom of the problem, but one problem is that apparently sometimes (I'm
going to find out when) copilot sends an `"OK"` status message without a
username. This is from the user's logs:

2024-02-20T15:28:41-03:00 [ERROR] failed to deserialize response from
language server: missing field `user`. Response from language server:
"{\"status\":\"OK\"}"

The official `copilot.vim` plugin handles this as if the user is not
authenticated (!= authorized):


1a284014d2/autoload/copilot.vim (L574-L579)

So that's what I'm doing here too.

Release Notes:

- Fixed wrong handling of Copilot sign-in status in rare cases.
2024-02-21 11:39:43 +01:00
Thorsten Ball
fd9823898f Tiny change: use consistent casing in log message (#8115)
Release Notes:

- N/A
2024-02-21 10:23:05 +01:00
Thorsten Ball
d5aba2795b Log when starting language servers (#8075)
This should help us debug more failures because we can now see what
exactly was started.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-02-21 10:11:41 +01:00
Joseph T. Lyons
92b2e5608b Fix crash when closing last zed window (#8102)
Fixes: #8100

Release Notes:

- N/A
2024-02-21 00:48:42 -05:00
Joseph T. Lyons
c58d72ea2b Improve automatic indentation in Gleam code files (#8098)
Release Notes:

- Improved automatic indentation in Gleam code files
([#7295](https://github.com/zed-industries/zed/issues/7295)).
2024-02-20 23:55:42 -05:00
Joseph T. Lyons
58a5a1eb8f Automatically indent the cursor when adding a newline after a { in Gleam code files (#8097)
Fixes: https://github.com/zed-industries/zed/issues/7295

Release Notes:

- Fixed a bug where adding a newline after a `{` would not automatically
indent the cursor in Gleam code files
([#7295](https://github.com/zed-industries/zed/issues/7295)).
2024-02-20 23:37:15 -05:00
gmorenz
cd640a87a9 Improve key handling on x11, sharing wayland implementation (#8094)
Makes keyboard shortcuts work on x11.

Release Notes:

- N/A
2024-02-20 16:04:52 -08:00
Kirill Bulatov
c97ecc7326 Add initial CI job for Windows target (#8088)
Clippy is disabled for now, due to many warnings in both `gpui` and
other code, see
https://github.com/zed-industries/zed/actions/runs/7980269779/job/21789529800
for more details.

Also, due to `#!/usr/bin/env bash` shebang in the `script/clippy`, it
starts in Windows CI with `shell: C:\Program Files\Git\bin\bash.EXE
-euxo pipefail {0}`

https://github.com/zed-industries/zed/actions/runs/7980269779/job/21789529800#step:4:3
It seems more appropriate to use PowerShell instead.

See `todo!("windows")` for all stubbed places currently.

Release Notes:

- N/A
2024-02-21 00:35:29 +02:00
Marshall Bowers
48f0f387f8 Update docs for building Zed (#8092)
This PR updates the docs for building Zed to fix the links in the
sidebar after the addition of the Linux-specific docs in #8083.

Release Notes:

- N/A
2024-02-20 17:34:13 -05:00
Piotr Osiewicz
2ec910f772 Runnables: Add oneshot runnables (#8061)
/cc @SomeoneToIgnore 
Fixes #7460 and partially addresses #7108 
Release Notes:

- N/A
2024-02-20 23:13:09 +01:00
N
8a73bc4c7d Vim: enable sending multiple keystrokes from custom keybinding (#7965)
Release Notes:

- Added `workspace::SendKeystrokes` to enable mapping from one key to a
sequence of others
([#7033](https://github.com/zed-industries/zed/issues/7033)).

Improves #7033. Big thank you to @ConradIrwin who did most of the heavy
lifting on this one.

This PR allows the user to send multiple keystrokes via custom
keybinding. For example, the following keybinding would go down four
lines and then right four characters.

```json
[
  {
    "context": "Editor && VimControl && !VimWaiting && !menu",
    "bindings": {
      "g z": [
        "workspace::SendKeystrokes",
        "j j j j l l l l"
      ],
    }
  }
]
```

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-20 15:01:45 -07:00
gmorenz
8f5d7db875 First pass at making a linux keymap (#8082)
Undoubtedly not perfect, but this should be something we can work off
of.

Note that matching keybindings with ctrl in them is currently broken on
linux (or at least x11). This keymap might just manage to be less useful
than using the macos one on linux until that is fixed... the proximate
cause of this is that the `key` field of the `Keystroke` struct looks
like `"\u{e}"` instead of `"n"` when `ctrl-n` is pressed.

Release Notes:

- N/A
2024-02-20 13:51:54 -08:00
Gabriel Dinner-David
389d26d974 Linux(Wayland): translate enter and pageup/down from keysym (#8089)
enter and pagedown/pageup weren't working now they do
Release Notes:
- N/A
2024-02-20 13:48:14 -08:00
Marshall Bowers
e580e2ff0a Update Cargo.lock (#8085)
This PR updates `Cargo.lock`, since it was missed in #8059.

Release Notes:

- N/A
2024-02-20 15:43:48 -05:00
Conrad Irwin
3d9503a454 Fix cx.windows() to return borrowed windows (#8086)
Fixes #8068

Release Notes:

- Fixed an error message when joining a project twice
([#8068](https://github.com/zed-industries/zed/issues/8068)).
2024-02-20 13:42:11 -07:00
Mikayla Maki
5c7cec9f85 Add linux to readme (#8083)
Release Notes:

- N/A
2024-02-20 12:02:51 -08:00
Dzmitry Malyshau
b028231aea linux/x11: disable Vulkan validation in Debug (#8044)
Turns out this validation requirement is confusing new users.

Release Notes:
- N/A
2024-02-20 11:14:13 -08:00
Andrew Lygin
f7d2cb1818 Project search bar layout improvements (#7963)
The PR matches project search layout with the recent changes in the
buffer project layout.

https://github.com/zed-industries/zed/assets/2101250/91b905ea-aed8-4740-9e60-67f3052885e2


Release Notes:

- Improve project search bar layout, match it with the buffer search bar ([7722](https://github.com/zed-industries/zed/issues/7722))
2024-02-20 21:07:01 +02:00
Robin Pfäffle
78dcd72790 Fix display of links in lists (markdown_preview) (#8073)
![markdown_preview](https://github.com/zed-industries/zed/assets/67913738/d8e4800f-d549-42e7-90b4-001d98aa39d2)

Release Notes:

- Fixed display of long links in lists not fully visible in markdown
preview.
2024-02-20 11:30:40 -07:00
Dzmitry Malyshau
d51a0b60be linux/x11: send XCB requests asynchronously (#8045)
With `send_and_check_request` we'd be blocking both the main loop and
the caller. `send_request` is only going to be blocking on the main loop
when processing the request.

Release Notes:
- N/A

Based on a flamegraph from `perf`/`hotspot`, we are spending 40% of time
redrawing, another 40% of time downloading stuff (i.e. rust toolchain),
and the rest on text rendering, layout and such. This is with Vulkan
Validation (see https://github.com/zed-industries/zed/pull/8044).

I'm also wondering if it would be better with #7758, but regardless we
should have no problem rendering at 60-120 fps and processing user
input. More follow-ups are expected here.
2024-02-20 10:20:49 -08:00
Marshall Bowers
8178d347b6 Change default Markdown tab size (#8080)
Following up to #8079, this PR changes the default Markdown tab size to
2 spaces.

This should produce less surprising formatting for lists when using
Prettier.

Release Notes:

- Changed default Markdown tab size to 2 spaces.
2024-02-20 13:18:40 -05:00
Marshall Bowers
33ecb424af Adjust tab size for Markdown (#8079)
This PR sets the `tab_size` for Markdown to 2 spaces.

This should prevent Prettier from adding a bunch of leading whitespace
when formatting Markdown lists.

Release Notes:

- N/A
2024-02-20 13:15:14 -05:00
Darren Schroeder
91b97387b6 bump tree-sitter-nu to latest (#8059)
This PR bumps the tree-sitter-nu commit to the latest supported by the
nushell team. It also includes the latest highlights.scm

Release Notes:

Bumped `nu` tree sitter dependency and highlights.scm
2024-02-20 12:05:09 -05:00
Julia
0a40a21c74 Timeout while waiting for server to shutdown and kill it 2024-02-20 11:47:13 -05:00
Conrad Irwin
b14d576349 Follower simplification (#8026)
Release Notes:

- Improved reliability of following
2024-02-20 09:41:37 -07:00
Philipp Schaffrath
db0eaca2e5 Rename scrollbar_thumb to be consistent with other style properties (#8004)
This small inconsistency was mentioned on the discord. This fixes it.

Release Notes:

- Themes: Renamed `scrollbar_thumb.background` to
`scrollbar.thumb.background` to be consistent with other style
properties.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-20 11:26:09 -05:00
Thorsten Ball
80db468720 go: better logging if go install gopls fails (#8060)
Release Notes:

- Improved logging if installing `gopls` fails
2024-02-20 15:56:52 +01:00
Kirill Bulatov
0d2ad67b27 Add settings to configure terminal scroll limit (#8063)
Fixes https://github.com/zed-industries/zed/issues/7550
Also set maximum allowed to runnables' terminals.


Release Notes:

- Added settings to configure terminal scroll limit
([7550](https://github.com/zed-industries/zed/issues/7550))
2024-02-20 16:14:59 +02:00
Kirill Bulatov
7065d6c46d Use proper template for initial runnables config contents (#8064)
Release Notes:

- N/A
2024-02-20 16:14:50 +02:00
Hourann
6c714c13b3 Fix markdown preview heading overflows no wrap (#8052)
![Kapture 2024-02-20 at 18 27
15](https://github.com/zed-industries/zed/assets/8416130/87d4dcea-e2f0-44ba-88a4-06829dbb0e89)

Release Notes:

- Improved markdown preview wrapping ([#8047](https://github.com/zed-industries/zed/issues/8047)).
2024-02-20 15:18:42 +02:00
Kirill Bulatov
c54d6aff6c Properly ignore missing/empty runnables config 2024-02-20 15:02:35 +02:00
Kirill Bulatov
48a6fb9e84 Fix runnables-related hickups (#8058)
* never error on absent/empty runnables file
* always activate terminal tab on runnable (re)schedule

Release Notes:

- N/A
2024-02-20 14:54:19 +02:00
Ali Servet Donmez
e9f400a8bd rust-analyzer check command is check and not checkOnSave (#8054)
Reference: https://rust-analyzer.github.io/manual.html#configuration

Release Notes:

- N/A
2024-02-20 14:06:07 +02:00
Thorsten Ball
fc101c1fb3 Log when failed to deserialize response from language server (#8046)
This should probably help us debug when language servers don't start up
properly.

Release Notes:

- N/A
2024-02-20 10:16:00 +01:00
bbb651
4616d66e1d Download right language server binary for OS (#8040)
Release Notes:

- Download right language server binary for OS
2024-02-20 09:53:03 +02:00
Bennet Bo Fenner
3ef8a9910d chat: auto detect links (#8028)
@ConradIrwin here's our current implementation for auto detecting links
in the chat.
We also fixed an edge case where the close reply to preview button was
cut off (rendered off screen).

Release Notes:

- Added auto detection for links in the chat panel.

---------

Co-authored-by: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
2024-02-19 21:49:47 -07:00
Ben Hamment
1e44bac418 Add Ruby method visibility in outline view (#7954)
Release Notes:

- Improved ([#7849
](https://github.com/zed-industries/zed/issues/7849)).

<img width="897" alt="image"
src="https://github.com/zed-industries/zed/assets/7274458/a2b0db84-1971-45c0-a5a2-68de651e342b">
2024-02-19 19:26:04 -07:00
Remco Smits
aad7761038 Add an indicator to the channel chat to see all the messages that you missed (#7781)
This pull requests add the following features:
- Show indicator before first unseen message
- Scroll to last unseen message

<img width="241" alt="Screenshot 2024-02-14 at 18 10 35"
src="https://github.com/zed-industries/zed/assets/62463826/ca396daf-7102-4eac-ae50-7d0b5ba9b6d5">


https://github.com/zed-industries/zed/assets/62463826/3a5c4afb-aea7-4e7b-98f6-515c027ef83b

### Questions: 
1. Should we hide the indicator after a couple of seconds? Now the
indicator will hide when you close/reopen the channel chat, because when
the last unseen channel message ID is not smaller than the last message
we will not show it.

Release Notes:
- Added unseen messages indicator for the channel chat.
2024-02-19 19:20:02 -07:00
bbb651
0422d43798 Linux: Add support for MouseButton::Navigate in GPUI (wayland and x11) (#7996)
Release Notes:

- N/A

Based on wgpu implementation (which I wrote).

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-19 18:09:53 -08:00
Dzmitry Malyshau
b00b65b330 linux/x11: implement window focus (#8002)
Release Notes:
- N/A
2024-02-19 17:54:54 -08:00
Janrupf
fddb778e5f Enable server side decorations on wayland (#8037)
This PR enables server side decorations on Wayland if possible. This is
stopgap solution, so that the window can be moved, resized and dragged
on Wayland sessions at all.


![image](https://github.com/zed-industries/zed/assets/25827180/3dc9af53-76c0-4664-8746-ed6a6e5eafe7)

Since Wayland compositors can decide to force either mode (as in,
forcing server or client side decorations), this requires additional
handling in zed. Since zed doesn't provide any of that handling as of
now, as a temporary solution server side decorations are always
requested.
2024-02-19 17:53:31 -08:00
白山風露
77974a4367 Stubbing unix-dependent values on Windows (#8036)
Release Notes:

- N/A
2024-02-19 17:41:35 -08:00
白山風露
0037f0b2fd Avoid dependencies build errors on Windows (#7827)
This is a compilation of fixes for errors that appeared in dependent
crates in Windows.

- wezterm (zed-industries/wezterm#1)
- tree-sitter-svelte (Himujjal/tree-sitter-svelte#54)
- tree-sitter-uiua (shnarazk/tree-sitter-uiua#25)
- tree-sitter-haskell (I sent a PR, but upstream source is regenerated
and no longer errors.)

Release Notes:

- N/A
2024-02-19 16:44:24 -08:00
Kirill Bulatov
37f6a706cc Invalidate Linux build caches more agressively (#8031)
We run Linux CI on regular GitHub Action runners, which have ~30GB of
disk space. This is nothing for Rust builds and, due to Cargo.lock
perturbations, we tend to accumulate enough artifacts to fill the disk
entirely since `restore-keys` alowed to keep the cache for different
lockfiles.

Instead, try to invalidate the cache more aggressively (which will cost
us more frequent ~30min Linux CI runs) to see how this will work in
comparison.

Release Notes:

- N/A
2024-02-19 14:16:39 -08:00
Abdullah Alsigar
f4bafd5899 Dart support (#7220)
This is my first contribution, feedback is welcome.

Release Notes:

- Added Dart language support
([#5343](https://github.com/zed-industries/zed/issues/5343)).
2024-02-19 11:10:08 -08:00
Piotr Osiewicz
b3d3a00a14 chore: Add missing LICENSE-GPL files 2024-02-19 18:40:41 +01:00
Thorsten Ball
0a5df7d597 Fix jk not working in Vim bindings (#8023)
Fixes #8006.

Release Notes:

- Fixed two-character bindings in Vim insert mode (e.g. `j k` or `j j`)
not working.
([#8006](https://github.com/zed-industries/zed/issues/8006))

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-19 10:21:07 -07:00
Conrad Irwin
4d1585b917 Don't drop key bindings (#8019)
Fixes: #7748



Release Notes:

- Fixed a bug where keystrokes could be lost after focus changes
([#7748](https://github.com/zed-industries/zed/issues/7748)).

Co-authored-by: Antonio <as-cii@zed.dev>
2024-02-19 10:20:51 -07:00
Kirill Bulatov
99559f3975 Add another runnables_ui/Cargo.toml field to satisfy license checks 2024-02-19 19:14:00 +02:00
Kirill Bulatov
5783497c21 Add missing license field to runnables_ui 2024-02-19 19:04:40 +02:00
Kirill Bulatov
e27c2fc946 Fix seed-db script by passing it the correct admin file path (#8022)
Release Notes:

- N/A
2024-02-19 18:53:17 +02:00
Piotr Osiewicz
f17d0b5729 Add static Runnables (#8009)
Part of #7108

This PR includes just the static runnables part. We went with **not**
having a dedicated panel for runnables.
This is just a 1st PR out of N, as we want to start exploring the
dynamic runnables front. Still, all that work is going to happen once
this gets merged.

Release Notes:

- Added initial, static Runnables support to Zed. Such runnables are defined in
`runnables.json` file (accessible via `zed: open runnables` action) and
they can be spawned with `runnables: spawn` action.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Pitor <pitor@zed.dev>
Co-authored-by: Beniamin <beniamin@zagan.be>
2024-02-19 18:41:43 +02:00
Antonio Scandurra
ca251babcd Drop Box<dyn PlatformWindow> when the OS closes the native window (#8016)
Closes #7973 

This fixes a leak in GPUI when the user didn't override
`on_should_close_window`.

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-02-19 15:38:50 +01:00
Bennet Bo Fenner
c33efe8cd0 recent projects: cleanup ui (#7528)
As the ui for the file finder was recently changed in #7364, I think it
makes sense to also update the ui of the recent projects overlay.

Before:

![image](https://github.com/zed-industries/zed/assets/53836821/8a0f5bef-9b37-40f3-a974-9dfd7833cc71)

After:

![image](https://github.com/zed-industries/zed/assets/53836821/7e9f934a-1ac3-4716-b7b6-67a7435f3bde)


Release Notes:

- Improved UI of recent project overlay
2024-02-19 14:37:52 +02:00
Tadeo Kondrak
2b56c43f2d Wayland: Keyboard input improvements (#7989)
Release Notes:

- N/A

---

Right now the Wayland backend is using `xkb::State::key_get_utf8` as the
`key`, when it should be used as the `ime_key`. It also manages
pressing/releasing modifiers manually when this should be managed by the
display server.

This allows modifier combinations to work in more cases, making it an
alternative to https://github.com/zed-industries/zed/pull/7975, which
interprets what is now only used as the `ime_key` value as a `key`
value.
2024-02-18 21:25:42 -08:00
Roman
bd137b01ad Wayland fractional scaling (#7961)
This PR adds support for fractional scaling on Wayland.

Release Notes:

- N/A
2024-02-18 21:22:03 -08:00
Dzmitry Malyshau
4e1e26b696 blade: Fix initialization of atlas textures used for path rasterization (#8000)
Generally the BladeAtlas logic has been deferring all the texture
initializations and updates till `begin_frame`. This doesn't work for
path rasterization, since a texture needs to be allocated after
`begin_frame` and used immediately.

Fixed validation error:
> UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout(ERROR / SPEC):
msgNum: 1303270965 - Validation Error: [
UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0:
handle = 0x60ce301b9010, name = main, type =
VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x51820000000007b,
name = atlas, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 |
vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer
VkCommandBuffer 0x60ce301b9010[main] expects VkImage
0x51820000000007b[atlas] (subresource: aspectMask 0x1 array layer 0, mip
level 0) to be in layout VK_IMAGE_LAYOUT_GENERAL--instead, current
layout is VK_IMAGE_LAYOUT_UNDEFINED.
    Objects: 2
        [0] 0x60ce301b9010, type: 6, name: main
        [1] 0x51820000000007b, type: 10, name: atlas

Release Notes:
- N/A
2024-02-18 21:18:59 -08:00
d1y
12b12ba17a Add syntax highlighting and LSP for Dockerfiles(#6905) (#7977)
Release Notes:

- Added Dockerfile syntax highlighting and LSP support

---------

Co-authored-by: Bryce Palmer <bpalmer@redhat.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-02-18 20:44:54 +02:00
d1y
8acd4d122e Fix git_commit grammar name typo (#7982)
Release Notes:

- Fixed git_commit highlights not working
2024-02-18 20:40:56 +02:00
Thorsten Ball
251218954d Add editor::OpenUrl action and bind to gx in Vim mode (#7972)
This adds one feature I've been missing a lot in Vim mode: `gx` to open
the URL under the cursor.

Technically, in Vim, `gx` opens more "paths", not just URLs, but I think
this is a good start.

Release Notes:

- Added `gx` to Vim mode to open the URL under the cursor.

Demo:


https://github.com/zed-industries/zed/assets/1185253/6a19490d-b61d-40b7-93e8-4819599f6977
2024-02-18 18:52:50 +01:00
Victor
3ca6f7572f Add more documentation about base keymaps (#7953)
Release Notes:

- Clarify base keymap settings better in the docs
2024-02-18 17:33:46 +02:00
Marshall Bowers
b91d6da6b6 Remove Beancount as a built-in language (#7934)
This PR removes Beancount as a built-in language, as it is now available
as an [extension](https://github.com/zed-extensions/beancount).

Release Notes:

- Removed built-in support for Beancount, as it is now provided by an
[extension](https://github.com/zed-extensions/beancount).
2024-02-18 09:58:12 -05:00
Aleksei Trifonov
a041e07c99 Hide Inline Assist button if assistant.button is disabled (#7932)
This PR adds check for `assistant.button` setting in quick bar, to hide
it when the setting is set to false. It seems that the setting can be a
separate one, I would be happy to add it if needed.

Release Notes:

- Improved `assistant.button` setting so that `Inline Assist` button in
editor quick bar is also hidden
([#4500](https://github.com/zed-industries/zed/issues/4500)).
2024-02-18 08:14:08 +02:00
Andrew Lygin
6d9b8cc595 Clear search results on invalid query input (#7958)
Fixes a bug in the buffer search bar: Clears results of a previous
successfull search when the user enters invalid search request.

Steps to reproduce the bug:
1. Switch to Regex search mode.
2. Enter a valid search query that produces several matches.
3. Add a symbol to the search query that makes it an invalid regexp.
4. Switch to the editor and walk through the code back and forth.

Expected result: All the match highlightings after step 2 are cleared,
search bar indicates absence of the last search matches.

Actual: The results from the last valid search are highlighted, search
bar indicates presence of matches.

Potentially, the same effect may occur when searching in the simple text
mode, or when clearing the search query in some circumstances, so I made
the fix for all those cases, though I wasn't able to reproduce them
manually.

The bug:


https://github.com/zed-industries/zed/assets/2101250/1c50b98c-ae8e-4a9c-8ff5-1e5c63027ec3

After the fix:


https://github.com/zed-industries/zed/assets/2101250/e3eedf8c-2e3e-41ee-81cc-c2c9d919fba3

Release Notes:
- Clear search results on invalid query input
2024-02-18 08:01:06 +02:00
Conrad Irwin
4c781b6455 vim netrw (#7962)
- Tidy up vim netrw bindings (c.f.
https://github.com/zed-industries/zed/issues/4270,
https://github.com/zed-industries/zed/pull/7757)
- Add vim commands for panels

Release Notes:

- vim: add commands to toggle panels `:E[xplore]`, `:C[ollab]`,
`:Ch[at]`, `:N[otification]`, `:A[I]`, `:te[rm]` (or `:T[erm]`).
2024-02-17 13:36:08 -07:00
vultix
8aa5319210 Add documentation to many core editor types (#7919)
Hopefully this makes it a bit easier for new contributors to dive into
the codebase :)

Release Notes:

- Improved documentation for many core editor types

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-17 09:03:05 -07:00
Jack T
f19378135a Add Lua file icon (#7926)
Release Notes: 

- Added Lua file icon and association ([7925](https://github.com/zed-industries/zed/issues/7925))
2024-02-17 17:59:25 +02:00
Xing Liu
7804be0286 Add missing character "-" for "Go back" in key_bindings.md (#7942)
Release Notes:
- Added "Go back" binding docs in the `key_bindings.md`
2024-02-17 17:51:14 +02:00
evrsen
98ffdca32e Add locale-based time formatting in the chat panel (#7945)
This commit addresses the issue of time formats displayed in the chat
panel. Previously, the time was always displayed in a 12-hour format,
regardless of the user's locale. The `format_timestamp` function has
been updated to check the system locale and format the time accordingly.


Release Notes:
- Fixed time formatting in the chat panel to be locale based.
2024-02-17 08:44:28 -07:00
claytonrcarter
cd4d2f7900 Add Prettier support for Vue, Markdown and PHP (#7904)
Current prettier support w/i Zed leaves out a few languages that are
officially supported by prettier. In particular, Vue and Markdown are
supported by the core prettier project, and PHP is supported via an
official plugin. I didn't see any open issues for this, but I have been
wondering for months why `"formatter": "prettier"` wasn't working on my
PHP files. Now that Zed is open source, I was able to find out why, and
fix it. 😄

I have been using this with PHP files daily for a week+ now, and I have
also used it successfully with Vue and Markdown files, though not as
extensively. I looked around and did not see any tests for specific
prettier language integrations, but if I missed them please let me know
and I'll add some tests.

**Notes**
- I did not add support for Ruby (which has an official prettier plugin)
because it seems to require some external dependencies (notably, Rudy
and some Gems). When those are present on the system and `$PATH`,
prettier will will work just fine on Ruby files if the plugin is set up
similar to how the PHP plugin is set up (I tried it), and I can add that
in here, if desired. The PHP plugin is pure JS (as I recall) and doesn't
have this issue.
- I did *not* add support for languages that have "community" plugins,
though I do note that Zed already ships with prettier support for svelte
enabled, which – if I understand correctly – is powered by a community
plugin. If desired, I could look at adding support/configuration to
enable prettier support for things like elm, erb, glsl, bash, toml.
Bash, in particular, *I* would find useful. 😄

Release Notes:

- Added prettier support for Vue, Markdown and PHP
2024-02-17 11:35:31 +02:00
Robin Pfäffle
43a845cbbf Add default settings to display Svelte inlay hints (#7943)
Fixes: #7913.

Release Notes:

- Added default settings for Svelte language server to display inlay
hints ([#7913](https://github.com/zed-industries/zed/issues/7913)).
2024-02-17 11:33:05 +02:00
Marshall Bowers
3cbc18895a Upgrade toml to v0.8 (#7931)
This PR upgrades our `toml` dependency to v0.8.

I noticed that our current version of `toml` wasn't able to parse
certain kinds of documents involving enums, whereas the newer version
can.

Release Notes:

- N/A
2024-02-16 17:43:40 -05:00
Roman
f82b2741cd Wayland input handling (#7857)
Adds initial keyboard and mouse input for Wayland (thanks to @gabydd and
@kvark for reference).


Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-16 13:49:34 -08:00
Dzmitry Malyshau
9ad1862f2f Enable Blade on MacOS via "macos-blade" feature (#7669)
Depends on https://github.com/zed-industries/font-kit/pull/2 and
https://github.com/kvark/blade/pull/77

This change enables Blade to be also used on MacOS. It will also make it
easier to use it on Windows.

What works: most of the things. Zed loads as fast and appears equally
responsive to the current renderer.
<img width="306" alt="Screenshot 2024-02-11 at 12 09 15 AM"
src="https://github.com/zed-industries/zed/assets/107301/66d82f45-5ea2-4e2b-86c6-5b3ed333c827">

Things missing:
- [x] video streaming. ~~Requires a bit of plumbing on both Blade and
Zed sides, but all fairly straightforward.~~
  -  verified with a local setup
- [x] resize. ~~Not sure where exactly to hook up the reaction on the
window size change. Once we know where, the fix is one line.~~
- [ ] fine-tune CA Layer
- this isn't a blocker for merging the PR, but it would be a blocker if
we wanted to switch to the new path by default
- [ ] rebase on latest, get the dependency merged (need review/merge of
https://github.com/zed-industries/font-kit/pull/2!)

Update: I implemented resize support as well as "surface" rendering on
the Blade path (which will be useful on Linux/Windows later on). I
haven't tested the latter though - not sure how to get something
streaming. Would appreciate some help! I don't think this should be a
blocker to this PR, anyway.

The only little piece that's missing for the Blade on MacOS path to be
full-featured is fine-tuning the CALayer configuration. Zed does a lot
of careful logic in configuring the layer, such as switching the
"present with transaction" on/off intermittently, which Blade path
doesn't have yet.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-16 13:39:40 -08:00
Mikayla Maki
1c361ac579 Remove comment (#7922)
Per https://github.com/zed-industries/zed/pull/7814, this is more
trouble than it's worth. As these functions are never exposed to the
user of GPUI, we can just manually audit and enforce the relevant rules.

Release Notes:

- N/A
2024-02-16 10:39:50 -08:00
Rom Grk
bea36918f4 Linux: file dialogs (#7852)
This PR implements linux file dialogs and open/reveal actions.

| Open folder | Reveal path |
| --- | --- |
| ![Screenshot from 2024-02-15
16-50-49](https://github.com/zed-industries/zed/assets/1423607/b4260574-d841-4ded-821d-521f507916d1)
| ![Screenshot from 2024-02-15
16-51-36](https://github.com/zed-industries/zed/assets/1423607/1f32f451-7def-423a-9d69-de2876285b60)
|

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-16 10:34:54 -08:00
Conrad Irwin
43e8fdbe82 Fix a missing follower update on re-activate (#7918)
This could cause following to get into a bad state temporarily

Release Notes:

- Fixed a bug around following if the follow started while the workspace
was inactive.
2024-02-16 11:33:49 -07:00
Antonio Scandurra
5df1318e75 Don't use stale layout when view cache is invalidated in GPUI (#7914)
When a view is invalidated, we want to participate in Taffy layout with
an accurate style rather than the dummy style we use when a view is
cached. Previously, we only detected invalidation during paint. This
adds logic to layout as well to avoid using the dummy style when dirty.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-16 19:06:11 +01:00
Joseph T. Lyons
577b244b03 Add button link to extension repository (#7880)
Fixes: https://github.com/zed-industries/zed/issues/7873

<img width="1165" alt="image"
src="https://github.com/zed-industries/zed/assets/19867440/2338519c-bd48-4716-9f88-ed155b0dad67">

Release Notes:

- Added a button to link to an extension's repository
2024-02-16 11:49:05 -05:00
Max Brunsfeld
2e0d18ee76 Don't support cloning the extensions view (#7875)
Fixes https://github.com/zed-industries/zed/issues/7840

We could support this later, but for now, I don't think we need to.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-16 11:48:47 -05:00
Marshall Bowers
c5a23faf7c Fall back to One themes if the selected theme doesn't exist (#7911)
This PR makes it so the One themes—One Dark and One Light—are used as a
fallback when trying to reload a theme that no longer exists in the
registry.

This makes it so when an extension providing the current theme is
removed, the active theme will change to either One Dark or One Light
(based on the system appearance) instead of retaining a cached version
of the theme.

Release Notes:

- Changed the behavior when uninstalling a theme to default to One Dark
or One Light (based on system appearance) rather than keeping a cached
version of the old theme.
2024-02-16 11:28:34 -05:00
Marshall Bowers
86f81c4db3 Mention Docker Compose in the collab docs (#7908)
This PR adds a note about using Docker Compose to run the `collab`
dependencies.

Release Notes:

- N/A
2024-02-16 11:02:24 -05:00
Marshall Bowers
07501d9cfa Add LiveKit server to Docker Compose (#7907)
This PR adds the LiveKit server to the Docker Compose setup.

All of the dependencies needed to run the collab server are now
encapsulated within Docker Compose.

Release Notes:

- N/A
2024-02-16 10:49:48 -05:00
Subash Chandra Sapkota
07c7778cff Add cancel button on GitHub Copilot actions (#7850)
Release Notes:

- Added cancel button on Copilot actions
([#6878](https://github.com/zed-industries/zed/issues/6878)).

Here is the screenshot of the UI change:

<img width="545" alt="Screenshot 2024-02-15 at 13 00 53"
src="https://github.com/zed-industries/zed/assets/29421465/7a4e1641-1822-47ad-819e-f3d83bc3cc74">
2024-02-16 10:45:55 -05:00
Antonio Scandurra
aa6926e57a Revert "Upgrade to Taffy 0.4" (#7896)
Reverts zed-industries/zed#7868

@nicoburns: this seems to break text input in the chat panel, so
reverting this for now.

<img width="365" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/fc47eee9-6049-49c2-be2c-fb91f7d35caf">

It would be great to upgrade to Taffy 0.4 though, so we should figure
out why that particular input breaks.

Release notes:

- N/A
2024-02-16 14:30:31 +01:00
Thorsten Ball
ae577c9d5c Highlight escape sequences in TypeScript/JavaScript (#7892)
Ran into this while hacking on TypeScript/React/TSX...

Release Notes:


- N/A

![screenshot-2024-02-16-07 03
56@2x](https://github.com/zed-industries/zed/assets/1185253/e6725a1e-7653-4316-abd0-280ea8818d66)
2024-02-16 09:12:39 +01:00
Marshall Bowers
f4f72a1136 Add blob store to Docker Compose (#7889)
This PR adds the local blob store—backed by
[MinIO](https://github.com/minio/minio)—to the Docker Compose setup.

This allows running the blob store locally all within a container.

Release Notes:

- N/A
2024-02-15 23:19:03 -05:00
Marshall Bowers
4310b0b8de Replace full with size_full (#7888)
This PR removes the `full` style method and replaces it with
`size_full`, as the two do the same thing.

This is the generated code for `size_full`:

```rs
#[doc = "Sets the width and height of the element.\n\n100%"]
fn size_full(mut self) -> Self {
    let style = self.style();
    style.size.width = Some((gpui::relative(1.)).into());
    style.size.height = Some((gpui::relative(1.)).into());
    self
}
```

Release Notes:

- N/A
2024-02-15 22:26:49 -05:00
Marshall Bowers
a161a7d0c9 Format YAML files (#7887)
This PR formats the YAML files in the repo with Prettier.

Release Notes:

- N/A
2024-02-15 22:04:57 -05:00
Marshall Bowers
ab6b9196e1 Fix Cargo.toml formatting (#7886)
This PR disables the formatting for `.toml` files within the Zed repo,
as the formatter provided by the TOML language server messes things up.

Release Notes:

- N/A
2024-02-15 21:54:43 -05:00
Marshall Bowers
ef551cedef Add CheckboxWithLabel component (#7881)
This PR builds on top of #7878 by adding a general-purpose
`CheckboxWithLabel` component to use for checkboxes that have attached
labels.

This component encompasses the functionality of allowing to click on the
label to toggle the value of the checkbox.

There was only one other occurrence of a checkbox with a label—the
"Public" checkbox in the channel management modal—and this has been
updated to use `CheckboxWithLabel`.

Resolves #7794.

Release Notes:

- Added support for clicking the label of the "Public" checkbox in the
channel management modal to toggle the value
([#7794](https://github.com/zed-industries/zed/issues/7794)).
2024-02-15 21:00:30 -05:00
Marshall Bowers
9ef83a2557 Make the labels of the checkboxes on the welcome screen clickable (#7878)
This PR makes the labels of the checkboxes on the welcome screen
clickable.

Release Notes:

- Added support for clicking the labels of the checkboxes on the welcome
screen to toggle the value
([#7794](https://github.com/zed-industries/zed/issues/7794)).
2024-02-15 20:37:31 -05:00
Joseph T. Lyons
32fdff0285 Update issue template configuration (again) 2024-02-15 19:35:23 -05:00
Joseph T. Lyons
4094562321 Update issue template configuration 2024-02-15 18:47:01 -05:00
Marshall Bowers
6869b62af3 Update .mailmap (#7871)
This PR updates the `.mailmap` file to merge some commit authors using
multiple emails.

Release Notes:

- N/A
2024-02-15 18:35:43 -05:00
Joseph T. Lyons
21a7421ee0 Update 1_language_support.yml 2024-02-15 18:25:13 -05:00
Vishal Bhavsar
96dcc385dd vim: Implement Go To Previous Word End (#7505)
Activated by keystrokes g-e.



Release Notes:

- vim: Added `ge` and `gE` for go to Previous Word End.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-15 16:15:31 -07:00
Marshall Bowers
e6766e102e Return descriptions for extensions (#7869)
This PR updates the extensions API to return descriptions for
extensions.

Release Notes:

- N/A
2024-02-15 17:43:47 -05:00
Nico Burns
694e18417e Upgrade to Taffy 0.4 (#7868)
Upgraded Taffy to v0.4.0 from crates.io (previously using prerelease
version from git).

Code changes required were minor as gpui was already using a recent
version of Taffy.

Release Notes:

- N/A
2024-02-15 14:30:39 -08:00
Joey Smith
94426c4393 Better logic for copying themed player colors into registry (#7867)
Release Notes:

- Fixed a potential panic when themes did not contain enough player
colors ([#7733](https://github.com/zed-industries/zed/issues/7733)).

Thanks to @maxdeviant for the code review and improvements!
2024-02-15 17:22:23 -05:00
Marshall Bowers
bf1bcd027c Secondarily sort by extension name instead of ID (#7866)
This PR makes it so extensions are secondarily sorted by their name
(instead of by ID) after we sort them by their download count.

Release Notes:

- N/A
2024-02-15 16:51:41 -05:00
Marshall Bowers
23132b5ab1 Display extension download counts (#7864)
This PR adds the download count for extensions to the extensions view.

Release Notes:

- Added download counts for extensions to the extensions view.
2024-02-15 16:41:54 -05:00
Conrad Irwin
a8d5864524 Fix panic when loading hover state. (#7861)
Release Notes:

- Fixed a panic when hovering over an identifier in the editor
2024-02-15 14:20:10 -07:00
Conrad Irwin
ea322e1d1c Add "code_actions_on_format" (#7860)
This lets Go programmers configure `"code_actions_on_format": {
  "source.organizeImports": true,
}` so that they don't have to manage their imports manually

I landed on `code_actions_on_format` instead of `code_actions_on_save`
(the
VSCode version of this) because I want to run these when I explicitly
format
(and not if `format_on_save` is disabled).

Co-Authored-By: Thorsten <thorsten@zed.dev>

Release Notes:

- Added `"code_actions_on_format"` to control additional formatting
steps on format/save
([#5232](https://github.com/zed-industries/zed/issues/5232)).
- Added a `"code_actions_on_format"` of `"source.organizeImports"` for
Go ([#4886](https://github.com/zed-industries/zed/issues/4886)).

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-02-15 14:19:57 -07:00
Max Brunsfeld
e1ae0d46da Add an extensions API to the collaboration server (#7807)
This PR adds a REST API to the collab server for searching and
downloading extensions. Previously, we had implemented this API in
zed.dev directly, but this implementation is better, because we use the
collab database to store the download counts for extensions.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-02-15 12:53:57 -08:00
Kirill Bulatov
bdc2558eac Add default language server settings to display inlay hints for Go and TypeScript (#7854)
Hints are still disabled by default in Zed, but when those get enabled,
the language server settings allow to display those instantly without
further server configuration, which might be not obvious. Also add the
documentation enties for those settings and their defaults in Zed.

Closes https://github.com/zed-industries/zed/issues/7821

Release Notes:

- Added default settings for TypeScript and Go LSP servers to enable
inlay hints when those are turned on in Zed
([7821](https://github.com/zed-industries/zed/issues/7821))
2024-02-15 22:01:49 +02:00
Dzmitry Malyshau
a41fb29e01 Linux/x11 input handling (#7811)
Implements the basics of keyboard and mouse handling.
Some keys will need special treatment, like Backspace/Delete. In this
PR, all keys are treated as append-only. Leaving this for a follow-up.

I used @gabydd 's branch as a reference (thank you!) as well as
https://github.com/xkbcommon/libxkbcommon/blob/master/doc/quick-guide.md
For future work, I'll also use
https://github.com/xkbcommon/libxkbcommon/blob/master/tools/interactive-x11.c

All commits are separately compileable and reviewable.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-15 11:58:47 -08:00
Andrew Lygin
aa319ccfd0 Fix buffer search invalid regexp indicator (#7795)
This PR fixes the issue with invalid regexp highlighting (red border)
when switching to the simple text searching mode (#7658).

Implementation details:

- `update_matches()` always relied on the caller to reset the
`query_contains_error` flag, which wasn't always the case. Now, it
resets the flag itself.

Release Notes:

- Fix issue with switching between invalid regexp and simple text buffer
search (#7658).

How it works now:


https://github.com/zed-industries/zed/assets/2101250/ac868a5d-5e2f-49a0-90fc-00e62a1d5ee8
2024-02-15 13:33:26 -05:00
Michal Příhoda
f01763a1fa Allow both integer and string request IDs in LSP (#7662)
Zed's LSP support expects request messages to have integer ID, Metals
LSP uses string. According to specification, both is acceptable:

interface RequestMessage extends Message {

	/**
	 * The request id.
	 */
	id: integer | string;

...
This pull requests modifies the types and serialization/deserialization
so that string IDs are accepted.

Release Notes:

- Make Zed LSP request ids compliant to the LSP specification
2024-02-15 20:26:23 +02:00
Thorsten Ball
2dffc5f6e1 Fix case-only renaming of files in project panel (#7835)
This is a follow-up to #7768 but now also fixes #5211.

Explanation is relatively simple: case-only renames previously failed
because while Zed would think that `foobar` and `FOOBAR` are different,
the filesystem would give us an file-already-exists error when renaming.

So what we're doing here is to check whether we're on a case-insensitive
filesystem and if so, we overwrite the old file.

Release Notes:

- Fixed case-only renaming of files in project panel.
([#5211](https://github.com/zed-industries/zed/issues/5211)).

Proof:



https://github.com/zed-industries/zed/assets/1185253/57d5063f-09d9-47b1-a2df-3d7edefca97d
2024-02-15 19:07:10 +01:00
Thorsten Ball
ed791c4fc1 Improve ruby highlighting (#7829)
Release Notes:

- Improved syntax-highlighting of identifiers in Ruby.

Before:

![screenshot-2024-02-15-14 40
19@2x](https://github.com/zed-industries/zed/assets/1185253/29fca0eb-7c0c-4aee-9f31-a8a3c6680cb9)

After:

![screenshot-2024-02-15-14 40
56@2x](https://github.com/zed-industries/zed/assets/1185253/2ce0e0c9-8689-4ff8-9f40-2ea5f6ccc2f6)
2024-02-15 15:12:41 +01:00
Kirill Bulatov
7c6b34cb73 Close modals and menus before dispathing actions (#7830)
Fixes https://github.com/zed-industries/zed/issues/7799 by forcing the
modal to close before dispatching the action.
While not needed specifically for this case, changed the context menus
to do the same, to be uniform — context menu actions seem to work
properly after this change too.

Release Notes:

- Fixed markdown preview action not working
([7799](https://github.com/zed-industries/zed/issues/7799))
2024-02-15 15:57:32 +02:00
Thorsten Ball
3921259b6c Extend Ruby word characters to include valid identifier chars (#7824)
In Ruby `_$=@!:?` can all be part of an identifier. If we don't have
them in this list, autocomplete doesn't work as expected.

See: https://gist.github.com/misfo/1072693

This fixes one part of #7819 but not the whole ticket.

Release Notes:

- Fixed completions in Ruby not working for identifiers that start or
end with special characters (e.g.: `@`)
2024-02-15 14:25:18 +01:00
Manohar_nalluri
e93dca5ec3 Incorrect file icons for .mjs, .mts, .cjs, .cts #7804 (#7815)
Release Notes:

- Added file extensions ([7804](https://github.com/zed-industries/zed/issues/7804))
2024-02-15 15:13:46 +02:00
Antonio Scandurra
c6626627c2 Remove existing gzip files before compressing dSYMs (#7818)
This should fix the build.

Release Notes:

- N/A
2024-02-15 11:32:08 +01:00
Antonio Scandurra
db86f4006e Staple notarization ticket to .dmg and .app bundle (#7775)
This should eliminate a pretty significant (multiple seconds) slowdown
that new users (or users after restarting their OS) have been
experiencing.

Previously, we would just notarize the application, which meant that
every user of the application had to perform an integrity check against
Apple's servers to ensure the app wasn't malicious.

With this commit, we are now using `xcrun stapler staple`, which
attaches the notarization ticket to both the app bundle as well as the
DMG. This should prevent users from needing to reach out to Apple's
notarization service in order to verify the app's integrity.

You can confirm the quarantine status of the application by running `ls
-l@` in `Terminal.app`:

    ls -l@ /Applications/Zed.app/Contents/MacOS/zed

Release Notes:

- Improved startup time when opening Zed for the first time or after
restarting the operating system.

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
Co-authored-by: Martin Palma <m@palma.bz>
Co-authored-by: evrsen <146845123+evrsen@users.noreply.github.com>
2024-02-15 06:47:12 +01:00
Roman
41372a96ed Linux: Fix x11 crash (#7805)
Release Notes:

- N/A
2024-02-14 16:03:03 -08:00
Roman
f62baeda64 gpui: Add Wayland support (#7664)
This PR adds Wayland support to gpui using
[wayland-rs](https://github.com/Smithay/wayland-rs). It is based on
[#7598](https://github.com/zed-industries/zed/pull/7598).

It detects Wayland support at runtime by checking the existence of the
`WAYLAND_DISPLAY` environment variable. If it does not exist or is
empty, the X11 backend will be used. To use the X11 backend in a Wayland
session (for development purposes), you just need to unset
WAYLAND_DISPLAY (`WAYLAND_DISPLAY= cargo run ...`).

At the moment it only creates the window and renders the initial content
provided by `BladeRenderer`, so it can run "Hello world" example.


![image](https://github.com/zed-industries/zed/assets/40907255/1655bc64-4d36-4178-9851-bfe42f03f716)

Todo:
- [x] Add basic Wayland support.
- [x] Add window resizing.
- [x] Add window closing.
- [x] Add window updating.
- [ ] Implement input handling, fractional scaling, and support other
Wayland protocols.
- [ ] Implement all unimplemented todo!(linux).
- [ ] Add window decorations or use custom decorations (like on MacOS).
- [ ] Address other missing functionality.

Release Notes:
- N/A

---------

Co-authored-by: gabydd <gabydinnerdavid@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-14 14:50:11 -08:00
gmorenz
6e6ae0ef21 Ignore 'DROP COLUMN enviroment' in typo checker (#7803)
In dropping a misspelled "enviroment" column in #7742, a new "typo" was
introduced breaking CI. This fixes that.

Release Notes:

- N/A
2024-02-14 15:34:58 -07:00
gmorenz
a3300aed31 Don't reinstall dependencies on arch linux (#7801)
Very minor quality of life update, passing the --needed flag to pacman
to skip reinstalling up to date dependencies.

Release Notes:

- N/A
2024-02-14 14:28:29 -08:00
Conrad Irwin
cbbc8cad84 Try and make collab deploys faster (#7746)
Use github machines and build on host instead of in container

Release Notes:

- N/A
2024-02-14 15:11:57 -07:00
Conrad Irwin
8e52cf1495 Add netrw bindings for vim (#7757)
This is now possible after #7647

Release Notes:

- Added vim bindings for project panel
([#4270](https://github.com/zed-industries/zed/issues/4270)).
2024-02-14 14:38:07 -07:00
Conrad Irwin
65a1938e52 panics (#7793)
Release Notes:

- Fix a panic in rename
([#7509](https://github.com/zed-industries/zed/issues/7509)).

---------

Co-authored-by: Max <max@zed.dev>
2024-02-14 14:36:40 -07:00
Conrad Irwin
855acb948c drop columns (#7742)
Blocked on: #7741

Release Notes:

- N/A
2024-02-14 14:30:48 -07:00
Leon
54f82eb166 Add double quote wrap in activate_python_virtual_environment (#7787)
Added double quote wrap in activate_python_virtual_environment to handle
spaces in path.
Would fail to find venv activate script when spaces exist.


Release Notes:

- Fixed venv_detection activation not finding directory if space is in
the path

![image](https://github.com/zed-industries/zed/assets/52263845/9bf95b92-c6d4-4e2c-9158-d91a41c10216)


- With changes

![image](https://github.com/zed-industries/zed/assets/52263845/93602ae7-d991-494b-89c3-5afcce556888)
2024-02-14 12:42:06 -08:00
Joseph T. Lyons
ac59b9b02f Add a line instructing users to include media screenshots (#7790)
Making media up for release notes / tweets is becoming very time
consuming. I spoke to Max and suggested we ask users to submit media for
their features, to reduce what we need to produce for tweets and such. I
dont know if this is the best way to signal it; I don't like adding more
to the PR template, but I'm not sure of a better way at the moment.


Release Notes:

- N/a
2024-02-14 15:36:56 -05:00
Dzmitry Malyshau
8f7a26f397 X11: Continuous Presentation (#7762)
Alternative to #7758, which doesn't involve adding a new trait method
`request_draw`.
Somehow, my whole screen goes blinking black with this when moving the
window, so not ready for landing.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-14 12:24:12 -08:00
Conrad Irwin
181f556269 Fewer nightlys (#7784)
Remove an extraneous /nightly/ from our dSYM paths

Release Notes:

- N/A
2024-02-14 11:40:02 -07:00
Adrian Garcia Badaracco
a02bdd0a9f Fix link in python.md (#7735) 2024-02-14 10:30:30 -08:00
Joseph T. Lyons
6876ea44ac Remove 0-patch requirement on main in bump-zed-minor-versions 2024-02-14 13:13:44 -05:00
Joseph T. Lyons
16849f48e6 v0.124.x dev 2024-02-14 13:10:07 -05:00
Conrad Irwin
7a6d01e113 debug symbol upload (#7783)
This will let it become slowly eaasier to debug crashes

Release Notes:

- N/A
2024-02-14 10:55:37 -07:00
Marshall Bowers
b14fbd4ddc Fix extension list scrolling and add loading and empty states (#7782)
This PR fixes the scrolling of the extension list, as well as adds
various empty and loading states.

Release Notes:

- N/A
2024-02-14 12:47:58 -05:00
Thorsten Ball
b47aff4c14 go: enable completions with placeholders by default (#7780)
This fixes #7523 by enabling completions with placeholders by default.

This setting controls whether gopls sends back snippets with
placeholders. According to the documentation
(https://github.com/golang/tools/blob/master/gopls/doc/settings.md#useplaceholders-bool)
this only controls whether "placeholders for function parameters or
struct fields" are sent in completion responses.

In practice, though, this seems to also control whether any snippets
with *any* placeholders are being sent back.

Example: for the given Go code

    err := myFunction()
    i^

With the cursor being at `^`, this setting controls whether `gopls`
sends back statement snippets such as `if err != nil { return ... }`
with the `...` being dynamically matched to the return value of the
function.

So I think this setting controls far more than just function params and
struct fields. And since we *do* support placeholders in snippets, I
think this provides a better default experience.

Release Notes:

- Improved default Go experience by enabling snippets-with-placeholders
when initializing `gopls`.
([#7523](https://github.com/zed-industries/zed/issues/7523)).
2024-02-14 18:29:42 +01:00
Marshall Bowers
7ac055627e Reorganize extensions_ui.rs (#7779)
This PR reorganizes `extensions_ui.rs` by moving the `Render` impl down
below the primary `ExtensionsPage` impl.

Release Notes:

- N/A
2024-02-14 11:44:51 -05:00
Marshall Bowers
db0455beb0 Give explicit heights to items in the extension list (#7777)
This PR gives the items in the extension list an explicit height so that
they work properly within the uniform list when descriptions are
missing.

<img width="1235" alt="Screenshot 2024-02-14 at 10 19 14 AM"
src="https://github.com/zed-industries/zed/assets/1486634/01222902-6b05-4e9a-bb5a-bada14b1fd45">

I think we may want to consider using a `list` here instead of a
`uniform_list` to allow them to have variable heights.

Fixes #7756.

Release Notes:

- N/A
2024-02-14 10:43:11 -05:00
Thorsten Ball
017b2db630 Fix case-only renaming of files (#7768)
This fixes #5211 and #7732 by fixing the case-only file renaming.

The fix here works by checking hooking into function that produces the
data to populate the project panel.

It checks whether we're on a case-insensitive file system (default on
macOS, but you can have case-sensitive FS on macOS too) and if so, it
ignores the metadata for files for which the absolute path (returned by
the FS scanner) and canonicalized path do NOT match.

That's the case for (a) symlinks and (b) case-only renames of files.

It only does this check for case-only renames.

Release Notes:

- Fixed case-only renaming of files producing duplicate entries in
project panel.
([#5211](https://github.com/zed-industries/zed/issues/5211)).

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-14 16:00:31 +01:00
Piotr Osiewicz
75eac4783b gpui: patch pathfinder_simd to fix nightly build, bump ahash for the … (#7770)
…same reason

Fixes #7644 

Release Notes:

- N/A
2024-02-14 12:55:31 +01:00
Conrad Irwin
7956a9a547 Don't wait to dispatch commands (#7755)
I added this when porting vim mode to gpui2 to work around life-cycle
problems.
Since #7647, this is no longer needed for vim mode, and causes other
problems (c.f. #7748)

Release Notes:

- Improved command to drop fewer keystrokes
2024-02-13 21:45:46 -07:00
Max Brunsfeld
c357e37dde Reload extensions more robustly when manually modifying installed extensions directory (#7749)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-13 16:15:19 -08:00
Marshall Bowers
c3176392c6 Remove themes from the registry when the extension is uninstalled (#7745)
This PR makes it so uninstalling an extension will remove any themes
provided by that extension from the theme registry.

Release Notes:

- N/A
2024-02-13 16:41:34 -05:00
Conrad Irwin
e9b95fde68 Force upgrade people on nightly (#7744)
Release Notes:

- N/A
2024-02-13 13:34:49 -07:00
Max Brunsfeld
e73e93f333 Unload languages when uninstalling their extension (#7743)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-13 15:25:54 -05:00
Conrad Irwin
a2144faf9c Remove environment guards (#7741)
Release Notes:

- N/A
2024-02-13 13:20:14 -07:00
Conrad Irwin
d744aa896f v0.123.1 2024-02-13 13:13:07 -07:00
Conrad Irwin
2294d99046 revert single channel click (#7738)
- Revert "collab tweaks (#7706)"
- Revert "2112 (#7640)"
- Revert "single click channel (#7596)"
- Reserve protobufs
- Don't revert migrations

Release Notes:

- N/A

**or**

- N/A
2024-02-13 12:53:49 -07:00
Yohann
ecd9b93cb1 Add C-w and C-u keymaps in vim mode (Fix #7691) (#7736)
Release Notes:
- Added C-w and C-u keymaps in vim mode
([#7691](https://github.com/zed-industries/zed/issues/7691))
2024-02-13 12:35:01 -07:00
Carlos Lopez
fecb5a82f1 Add an extensions installation view (#7689)
This PR adds a view for installing extensions within Zed.

My subtasks:

- [X] Page Extensions and assign in App Menu
- [X] List extensions 
- [X] Button to Install/Uninstall
- [x] Search Input to search in extensions registry API
- [x] Get Extensions from API
- [x] Action install to download extension and copy in /extensions
folder
- [x] Action uninstall to remove from /extensions folder
- [x] Filtering
- [x] Better UI Design

Open to collab!

Release Notes:

- Added an extension installation view. Open it using the `zed:
extensions` action in the command palette
([#7096](https://github.com/zed-industries/zed/issues/7096)).

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Carlos <foxkdev@gmail.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
2024-02-13 14:09:02 -05:00
Thorsten Ball
33f713a8ab Optimize construction and insertion of large SumTrees (#7731)
This does two things:

1. It optimizes the constructions of `SumTree`s to not insert nodes
one-by-one, but instead inserts them level-by-level. That makes it more
efficient to construct large `SumTree`s.
2. It adds a `from_par_iter` constructor that parallelizes the
construction of `SumTree`s.

In combination, **loading a 500MB plain text file went from from
~18seconds down to ~2seconds**.

Disclaimer: I didn't write any of this code, lol! It's all @as-cii and
@nathansobo.

Release Notes:

- Improved performance when opening very large files.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Julia <julia@zed.dev>
2024-02-13 16:24:40 +01:00
Thorsten Ball
798c9a7d8b Improve sorting of completion results (#7727)
This is an attempt to fix #5013 by doing two things:

1. Rank "obvious" matches in completions higher (see the code comment)
2. When tied: rank keywords higher than variables

Release Notes:

- Improved sorting of completion results to prefer literal matches.
([#5013](https://github.com/zed-industries/zed/issues/5013)).

### Before

![screenshot-2024-02-13-13 08
13@2x](https://github.com/zed-industries/zed/assets/1185253/77decb0b-5b47-45de-ab69-f7b333072b45)
![screenshot-2024-02-13-13 10
42@2x](https://github.com/zed-industries/zed/assets/1185253/ae33d0fe-06f5-4fc1-84f8-ddf6dbe80ba5)


### After

![screenshot-2024-02-13-13 06
22@2x](https://github.com/zed-industries/zed/assets/1185253/3c526bab-6392-4eeb-a2f2-dd73ccf228e8)
![screenshot-2024-02-13-13 06
50@2x](https://github.com/zed-industries/zed/assets/1185253/b5b9d513-766d-4a53-94de-b46271f5978c)

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
2024-02-13 14:08:03 +01:00
Andrew Lygin
98fff014da Fix minor buffer search bar design issues (#7715)
This PR fixes the buffer search bar design issues mentioned in #7703.

It doesn't affect the project search bar.

Changes:

<img width="943" alt="zed-search-bar-design-issues"
src="https://github.com/zed-industries/zed/assets/2101250/af3bd0da-36cb-46ee-9af6-6b69911863d0">

Release Notes:

- N/A
2024-02-13 09:45:24 +01:00
Conrad Irwin
ea51536e0f Disable vim in the feedback modal (#7716)
Fixes #7000 by disabling vim in this context

Release Notes:

- Fixed feedback modal in vim mode
([#7000](https://github.com/zed-industries/zed/issues/7000)).

**or**

- N/A
2024-02-12 22:28:36 -07:00
Conrad Irwin
a1899bac4e vim: Fix renaming (#7714)
This was broken by #7647

Release Notes:

- N/A
2024-02-12 22:28:26 -07:00
Derrick Laird
04fc0dde1a languages: go.mod/go.work fix highlighting no longer working (#7705)
At some point go.mod and go.work syntax highlighting quit working. Looks
like the grammars weren't matching for some reason and I'm not sure how
they were working originally.

Not sure if we could write a test to make sure the tree-sitter queries
are being loaded for the grammars or not but seems like something that
could be useful to avoid something like this in the future.
2024-02-12 21:01:08 -07:00
Conrad Irwin
b800fe96d2 Fix dealloc of MacWindow (#7708)
We see some panics in the Drop handler for MacWindow

Looking into this, I noticed that our drop implementation was not
correctly
cleaning up the window state.

Release Notes:

- N/A
2024-02-12 20:01:09 -07:00
Conrad Irwin
21d2b5fe50 collab tweaks (#7706)
- Don't leave call when clicking on channel
- Don't prompt to leave a call you're not in

Release Notes:

- N/A
2024-02-12 16:08:35 -07:00
Conrad Irwin
d13a731cd6 Crash sooner on invalid background highlights (#7702)
Release Notes:

- N/A
2024-02-12 14:44:10 -07:00
Max Brunsfeld
ede9600ab4 Improve panic message for invalid anchors (#7700)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-12 12:58:30 -08:00
Greg Morenz
48a4cbad37 Don't move traffic lights while fullscreen
Fixes #4712, or at least works around it. As discussed in the issue,
setting the buttons frames while fullscreen can cause them to render
in the wrong location. This fixes that by simply not moving them when
fullscreen.
2024-02-12 14:17:10 -05:00
Roman
266988adea gpui: Decouple X11 logic from LinuxPlatform (#7598)
Release Notes:

- Separated Linux platform and X11-specific code, so that we can add
Wayland support now.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-12 10:44:34 -08:00
Alvaro Gaona
2e7db57e16 Add Astro Support (#6896)
Attempt to add `@astrojs/language-server` and
[virchau13/tree-sitter-astro](https://github.com/virchau13/tree-sitter-astro).

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2024-02-12 10:10:40 -08:00
Andrew Lygin
1c2081c10c Search bar UI enhancements (#7675)
This PR introduces several enhancements (along with fixing a couple of
bugs) in the search bar UI (copied from [this
comment](https://github.com/zed-industries/zed/issues/7663#issuecomment-1937659091)):

- Moving the Replace field under the Search field makes it easier to
compare texts and avoid typos. Also, less eyes movements.
- Use red (error) color to indicate that nothing matched. VSCode, IDEA
do this. Again, it helps to get a quicker feedback on typos without
moving your eyes.
- Much less moving parts and no place for flickering.
- Better fits to narrow panes.
- The Close button that allows to close the search bar with the mouse.
- Better keyboard handling (tab, shift+tab in the replacement mode),
autofocus on the Replace field.

How it looks:


https://github.com/zed-industries/zed/assets/2101250/93b0edb4-4311-4a7f-9f43-b30c4d1aede5

Implementation details:

- Using `Self::on_query_editor_event` looked suspicious
[here](2880135037/crates/search/src/buffer_search.rs (L491))
because it triggered searching on the replacement text changes. I've
created a separate method for the replacement editor.
- These changes don't affect the project search bar. If the PR is
accepted, the same changes may be implemented there.

Fixed issues:

- #7661
- #7663

Release Notes:

- Buffer search bar UI enhancements.
2024-02-12 10:01:57 -08:00
Robin Pfäffle
a23313928b Add JSX and TSX syntax highlighting (#7686)
This PR fixes / adds support for syntax highlighting in JSX and TSX.

Previously to this PR the syntax highlighting was not really working.
HTML tags have not been displayed as such.

<img width="1127" alt="SCR-20240212-ihne"
src="https://github.com/zed-industries/zed/assets/67913738/793c778f-aa11-4574-883f-6d336247bd9e">

After:

<img width="1225" alt="SCR-20240212-jqvv"
src="https://github.com/zed-industries/zed/assets/67913738/f4d96b1d-6063-41ac-bd46-76ce1fc0a131">

Release Notes:

- Added support for JSX and TSX syntax highlighting
2024-02-12 09:59:19 -08:00
Yesterday17
9e17018416 Allow OpenAI API URL to be configured via assistant.openai_api_url (#7552)
Partially fixes #4321, since Azure OpenAI API can be converted to OpenAI
API.

Release Notes:

- Added `assistant.openai_api_url` setting to allow OpenAI API URL to be
configured.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-12 11:37:27 -05:00
Julia
d959719f3e Use local player selection color, not cursor, for terminal selection 2024-02-12 10:52:44 -05:00
Valentine Briese
0fb6b32bc3 Correct typo in bundle script comment (#7682)
Release Notes:

- N/A
2024-02-12 10:30:38 +02:00
白山風露
2880135037 Use try_from_bytes in handle_file_urls (#7652)
Reduce build error on Windows.

Release Notes:

- N/A
2024-02-10 23:05:52 -07:00
Dzmitry Malyshau
664a195721 linux: switch to srgb color space output (#7666)
This matches the behavior of the existing Metal backend.

Picks up https://github.com/kvark/blade/pull/76

Release Notes:
- N/A
2024-02-10 20:19:00 -08:00
Conrad Irwin
bd882c66d6 vim lifecycle (#7647)
Release Notes:

- Fixed :0 and :% in vim mode
([#4303](https://github.com/zed-industries/zed/issues/4303)).
- Improved keymap loading to not load vim key bindings unless vim is
enabled

**or**

- N/A
2024-02-10 16:21:13 -07:00
Paulo Roberto de Oliveira Castro
a159183f52 Add Clojure language support with tree-sitter and LSP (#6988)
Current limitations:
* Not able to navigate into JAR files 

Release Notes:

- Added Clojure language support

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-02-10 13:28:48 -08:00
N8th8n8el
b4b59f8706 terminal: Fix non regex search to actually be non regex (#7330)
Alacritty seems to support only regex search out of the box.
This PR just escapes all special regex chars to make non regex search
work as expected.
Disclaimer: New to Rust.

Release Notes:

-Fixed text search not working correctly in terminal ([#4880](https://github.com/zed-industries/zed/issues/4880))
2024-02-10 21:34:41 +02:00
N8th8n8el
4f5fea5dba terminal: Fix supported search options (regex: true) (#7659)
Release Notes:

- Fixes [#7327](https://github.com/zed-industries/zed/issues/7327).
2024-02-10 21:29:06 +02:00
Matthew Gramigna
67839a967b Add Prisma language support (#7267)
Fixes #4832

Adds tree-sitter grammar and LSP adapter for Prisma



https://github.com/zed-industries/zed/assets/16297930/0f288ab1-ce5c-4e31-ad7f-6bb9655863c1
2024-02-10 10:26:39 -08:00
Jun
2f3ad9da4c Use integer font size value in default settings (#7649)
Release Notes:

Fixed : default settings for terminal not containing a proper value for font size ([7469](https://github.com/zed-industries/zed/issues/7469))
2024-02-10 10:48:21 +02:00
Conrad Irwin
68893c2ae6 Fix notes unread status (#7643)
1. The client-side comparison was wrong
2. The server never told the client about the version it remembered
3. The server generated broken timestamps in some cases

Release Notes:

- Fixed the notes/chat appearing as unread too often

**or**

- N/A
2024-02-09 23:12:26 -07:00
Colin Cai
e2a3e89318 Stop unnecessary repeat cursor movements in Vim mode (#7641)
Fixes: #7605

When repeating some cursor movements in Vim mode (e.g. `99999999 w`),
Zed tries to repeat the movement that many times, even if further
actions don't have any effect. This causes Zed to hang.

This commit makes those movements like other actions (like moving the
cursor left/right), stopping the repeat movement if a boundary of the
text is reached/the cursor can't move anymore.

Release Notes:

- Fixed [#7605](https://github.com/zed-industries/zed/issues/7605).
2024-02-09 22:50:38 -07:00
Conrad Irwin
0304edd8ab 2112 (#7640)
It's still slow, but should now work reliably

Release Notes:

- N/A
2024-02-09 18:33:28 -07:00
Max Brunsfeld
36b89571e9 Add binary for exporting JSON schemas for validating extensions (#7639)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-09 18:50:41 -05:00
Conrad Irwin
3635d2dced Highlight selections on vim yank (#7638)
Fixes: #7311

Co-Authored-By: WindSoilder <WindSoilder@outlook.com>

Release Notes:

- Added a highlight on yanked text in vim normal mode

**or**

- N/A

Co-authored-by: WindSoilder <WindSoilder@outlook.com>
2024-02-09 16:18:09 -07:00
Conrad Irwin
efe23ebfcd single click channel (#7596)
- Open channel notes and chat on channel click
- WIP
- Fix compile error
- Don't join live kit until requested
- Track in_call state separately from in_room



Release Notes:

- Improved channels: you can now be in a channel without joining the
audio call automatically

**or**

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-09 14:18:27 -07:00
Matt Bond
2b39a9512a Canonicalize settings to avoid overwriting symlinks (#7632)
Release Notes:

- Fixed theme selector overwriting settings file symlinks
([#4469](https://github.com/zed-industries/zed/issues/4469)).
2024-02-09 22:31:14 +02:00
Dzmitry Malyshau
2b383b854a linux: fix getting the initial content size (#7604)
Fix found by @h3mosphere (thanks!)

Solves the Vulkan validation on start on some platforms about the
mismatched surface size, e.g.
```
VUID-VkSwapchainCreateInfoKHR-imageExtent-01274(ERROR / SPEC): msgNum: 2094043421 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x55dff99554c0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1920,1080), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (1920,1016), minImageExtent = (1920,1016), maxImageExtent = (1920,1016). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
```

Release Notes:
- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-09 10:34:00 -08:00
Christian Bergschneider
862a9512b5 gpui: Activate window on Linux (#7617)
Release Notes:
- N/A

Hello everyone,
it's me again! This is another todo!(linux) thing in gpui.

Best Regards,
Christian Bergschneider
2024-02-09 10:15:00 -08:00
Kirill Bulatov
5175c8963a Actually fail on clippy failures (#7619)
Before the change to `script/clippy`, bash ignored first `clippy`
invocation failure and CI moved on with Linux errors and warnings
emitted.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-09 10:13:00 -08:00
Etienne Lacoursiere
eee00c3fef Update configuring_zed.md with auto close section (#7625)
Adds a section for the `auto_close` feature  in `configuring_zed.md`

Release Notes:

- N/A
2024-02-09 19:59:09 +02:00
Federico Dionisi
2651037472 Read LSP message headers at once (#7449)
The current LSP headers reader implementation assumes a specific order
(i.e., `Content-Length` first, and then `Content-Type`). Unfortunately,
this assumption is not always valid, as no specification enforces the
rule. @caius and I encountered this issue while implementing the
Terraform LSP, where `Content-Type` comes first, breaking the
implementation in #6929.

This PR introduces a `read_headers` function, which asynchronously reads
the incoming pipe until the headers' delimiter (i.e., '\r\n\r\n'),
adding it to the message buffer, and returning an error when delimiter's
not found.

I added a few tests but only considered scenarios where headers are
delivered at once (which should be the case?). I'm unsure if this
suffices or if I should consider more scenarios; I would love to hear
others' opinions.


Release Notes:

- N/A

---------

Co-authored-by: Caius <caius@caius.name>
2024-02-09 09:40:50 -08:00
Antonio Scandurra
93ceb89c0c Never show whitespace-only Copilot suggestions (#7623)
Fixes https://github.com/zed-industries/zed/issues/7582

Release Notes:

- Fixed a bug that caused Copilot to suggest leading indentation even
after the user accepted/discarded a suggestion
([#7582](https://github.com/zed-industries/zed/issues/7582))

Co-authored-by: Thorsten Ball <thorsten@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-02-09 18:05:14 +01:00
Thorsten Ball
ad97e447f5 Load worktree settings when loading options for language servers (#7615)
Previously we only looked at the global settings, this changes that to
start looking in local settings first and then fall back to global ones.

Fixes #4279.

Release Notes:

- Fixed language server configurations not being picked up from local,
worktree-specific settings.
([#4279](https://github.com/zed-industries/zed/issues/4279)).

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-02-09 16:06:29 +01:00
Kirill Bulatov
f3bfa11148 Show better errors when failing to start golps (#7614)
Part of
https://github.com/zed-industries/zed/issues/4471#issuecomment-1936008584

Improves gopls error logging to actually see what is wrong with the
output we failed to match against the version regex.

Release Notes:

- N/A
2024-02-09 16:44:13 +02:00
Thorsten Ball
775bce3e1a Handle autoclose when composing text (#7611)
This fixes two annoyances when composing text and autoclose is enabled.

Example: use a Brazilian keyboard and type `"`, which triggers a
dead-key state.

Previously when a user would type `"<space>` to get a quote, we'd end up
with 4 quotes.

When text was selected and a user then typed `"<space>` the selected
text would be deleted.

This commit fixes both of these issues.

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

Release Notes:

- Fixed autoclose behavior not working when composing text via IME (e.g.
using quotes on a Brazilian keyboard)
([#4298](https://github.com/zed-industries/zed/issues/4298)).

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
2024-02-09 15:36:39 +01:00
Kirill Bulatov
25c4cfe1d0 Bump action runners versions 2024-02-09 15:25:16 +02:00
Kirill Bulatov
702393af59 Use proper key for Linux rust cache 2024-02-09 15:25:16 +02:00
Robert Clover
901279a044 Implement terminal text dimming (#7600)
Dims text by a certain factor - this respects theme opacity. The amount
is documented in the code. As far as I can tell, all other terminals
also dim text using this same method. Dim only affects the foreground.

<img width="755" alt="SCR-20240209-mfls"
src="https://github.com/zed-industries/zed/assets/52195359/c32f2aff-1142-4333-a05d-6aca425cb235">

Release Notes:

- Added terminal text dimming (fixes #7497)
2024-02-09 13:42:30 +01:00
Antonio Scandurra
0cebf68306 Introduce a new ToggleGraphicsProfiler command (#7607)
On macOS, this will enable or disable the Metal HUD at runtime. Note
that this only works when Zed is bundled because it requires to set the
`MetalHudEnabled` key in the Info.plist.

Release Notes:

- Added a new `ToggleGraphicsProfiler` command that can be used as an
action (or via the `Help -> Toggle Graphics Profiler` menu) to
investigate graphics performance.
2024-02-09 13:29:40 +01:00
Thorsten Ball
04e1641a29 Properly handle backspace when in dead key state (#7494)
Previously we wouldn't handle Backspace in dead key state correctly:
instead of removing what was typed, we'd insert the text that was in the
dead key state.

Example: on a US English layout, press `opt-u` to end up in a dead key
state with `¨` waiting for the next character to be typed. Type
`backspace`. The `¨` should be removed, but it's not.

With this change, the `backspace` is interpreted instead of being
ignored.

Release Notes:

- Fixed backspace not working for dead keys (i.e. when typing accents or
umlauts)

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-02-09 12:22:12 +01:00
Piotr Osiewicz
f4d7b3e3b1 chore: Bump Rust version to 1.76 (#7592)
Release Notes:

- N/A
2024-02-09 10:45:39 +02:00
h3mosphere
67d280b8cb Linux: Experiment with CosmicText based Text System (#7539)
This is a rebase of @gabydds text_system updates. with some small
cleanups.

Currently cannot test this as build is not working in linux. Im just
putting it up here before I forget about it.

---------

Co-authored-by: gabydd <gabydinnerdavid@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-08 22:49:03 -08:00
Dzmitry Malyshau
0ab1094f0c linux: quit after the last window is closed (#7602)
Release Notes:
- N/A
2024-02-08 21:41:15 -08:00
Conrad Irwin
91c699aeaa Revert "Debug build (#7176)" (#7577)
This reverts commit aaba98d8ec.

Release Notes:

- N/A
2024-02-08 20:04:55 -07:00
Christian Bergschneider
07891b4978 gpui: Set window title on Linux (#7589)
Release Notes:
- N/A


Hello everyone,
glad to be contributing to this awesome project! This just fixes a
simple todo!(linux) in gpui.

I also considered setting the window title in the hello world example,
let me know if I should add it in this PR as well.

Best Regards,
Christian Bergschneider
2024-02-08 14:31:14 -08:00
Max Brunsfeld
ed54665711 Cleanup logic for registering languages and grammars (#7593)
This is a refactor, follow-up to the work we've been doing on loading
WASM language extensions.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-08 16:24:49 -05:00
Conrad Irwin
1da5241ef7 Try to buf harder (#7591)
Release Notes:

- N/A
2024-02-08 13:59:15 -07:00
Mikayla Maki
ad88e9754e Add Linux build CI (#7581)
Release Notes:

- N/A
2024-02-08 12:56:29 -08:00
Jason Lee
e7fcddff69 Parse version from GitHub tag name instead of release name (#7423)
If we not change this, some release will parse error.

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28

```json
{
  "name": {
    "type": [
      "string",
      "null"
    ]
  }
}
```

<img width="1188" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/bd53dbc4-ae2c-4f19-afd7-58e70b4f87d8">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-08 15:28:51 -05:00
Marshall Bowers
bde509fa74 Expose Python docstrings for syntax highlighting (#7587)
This PR extends our Tree-sitter highlights for Python to allow
highlighting docstrings differently from other strings.

Docstrings in Python will now use `string.doc` instead of just `string`,
which will allow for them to be styled independently of other strings.
If no `string.doc` is present in the theme, then it will fall back to
using the `string` styles.

<img width="272" alt="Screenshot 2024-02-08 at 1 52 21 PM"
src="https://github.com/zed-industries/zed/assets/1486634/034cffa0-91c0-4924-8ccc-3a385cf31126">

This is slightly different than the approach I took in #7585 in that we
are still treating docstrings as strings by default (which appears to be
the more common behavior), but allowing theme authors to hook in and
style them separately, if desired.

Release Notes:

- Added ability add custom styles for Python docstrings using
`string.doc`
([#7346](https://github.com/zed-industries/zed/issues/7346)).
2024-02-08 14:20:21 -05:00
Antonio Scandurra
67b96b2b40 Replace CADisplayLink with CVDisplayLink (#7583)
Release Notes:

- Fixed a bug that caused Zed to render at 60fps even on ProMotion
displays.
- Fixed a bug that could saturate the main thread event loop in certain
circumstances.

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-02-08 13:47:12 -05:00
Daniel Banck
9e538e7916 Support Terraform Variable Definitions as separate language (#7524)
With https://github.com/zed-industries/zed/pull/6882 basic syntax
highlighting support for Terraform has arrived in Zed. To fully support
all features of the language server (when it lands), it's necessary to
handle `*.tfvars` slightly differently.

TL;DR: [terraform-ls](https://github.com/hashicorp/terraform-ls) expects
`terraform` as language id for `*.tf` files and `terraform-vars` as
language id for `*.tfvars` files because the allowed configuration
inside the files is different. Duplicating the Terraform language
configuration was the only way I could see to achieve this.

---

In the
[LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem),
text documents have a language identifier to identify a document on the
server side to avoid reinterpreting the file extension.

The Terraform language server currently uses two different language
identifiers:
* `terraform` - for `*.tf` files
* `terraform-vars` - for `*.tfvars` files

Both file types contain HCL and can be highlighted using the same
grammar and tree-sitter configuration files. The difference in the file
content is that `*.tfvars` files only allow top-level attributes and no
blocks. [_So you could argue that `*.tfvars` can use a stripped down
version of the grammar_]. To set the right context (which affects
completion, hover, validation...) for each file, we need to send a
different language id.

The only way I could see to achieve this with the current architecture
was to copy the Terraform language configuration with a different `name`
and different `path_suffixes`. Everything else is the same.

A Terraform LSP adapter implementation would then map the language
configurations to their specific language ids:

```rust
fn language_ids(&self) -> HashMap<String, String> {
    HashMap::from_iter([
        ("Terraform".into(), "terraform".into()),
        ("Terraform Vars".into(), "terraform-vars".into()),
    ])
}
```

I think it might be helpful in the future to have another way to map
file extensions to specific language ids without having to create a new
language configuration.

### UX Before

![CleanShot 2024-02-07 at 23 00
56@2x](https://github.com/zed-industries/zed/assets/45985/2c40f477-99a2-4dc1-86de-221acccfcedb)

### UX After

![CleanShot 2024-02-07 at 22 58
40@2x](https://github.com/zed-industries/zed/assets/45985/704c9cca-ae14-413a-be1f-d2439ae1ae22)

Release Notes:

- N/A

---

* Part of https://github.com/zed-industries/zed/issues/5098
2024-02-08 13:12:12 -05:00
Mikayla Maki
d4be15b2b2 Suppress related warnings, fix nanoid, and get the build green (#7579)
This is in preparation for adding a Linux build step to our CI.

Release Notes:

- N/A
2024-02-08 09:32:53 -08:00
Robert Clover
8f7d7863d6 Fix text in terminal showing as bold when dimmed (#7491)
Fixes text in the terminal displaying as bold when it's actually just
dim. I think it was just a simple oversight because the original code
`|`'s together the BOLD and DIM_BOLD flags, which is the same as
DIM_BOLD, which is wrong because it should only be BOLD :p

Release Notes:

- Fixed #4464

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-08 09:12:45 -08:00
Marshall Bowers
1ba42f69ee Update .mailmap (#7578)
This PR updates the `.mailmap` file to merge some commit authors using
multiple emails.

Release Notes:

- N/A
2024-02-08 12:08:37 -05:00
Marshall Bowers
b77d452b90 Remove unneeded maybe! (#7576)
This PR removes an unneeded `maybe!` from `get_permalink_to_line`.

As this is a `Result`-returning function, we don't need the inner level
of wrapping.

Release Notes:

- N/A
2024-02-08 11:52:18 -05:00
Daniel Schmidt
b25044393e Add open permalink to line action (#7562)
Release Notes:

- Added `open permalink to line` action.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-08 11:40:38 -05:00
gmorenz
17c203fef9 Translate notify::Event to fsevent::Event on linux (#7545)
This isn't exactly a great solution, but it's a step in the right
direction, and it's simple allowing us to quickly unblock linux. Without
this (or an equivalent) PR linux builds are broken.

I spent a bunch of time investigating using notify on macos, and have a
branch with that working and FakeFs updated to use notify events.
unfortunately I think this would come with some drawbacks. Primarily
that files that don't yet exist yet aren't handled as well as with using
events directly leading to some less than ideal tradeoffs.

This PR is very much a placeholder for a better cross platform solution.
Most problematically, it only fills in the portion of fsevent::Event
that is currently used, despite there being a lot more information in
the ones collected from macos. At the very least a followup PR should
hide those implementation details behind a cross platform Event type so
that if people try and access data that hasn't been translated, they
find out about it.

Release Notes:

- N/A
2024-02-08 08:35:37 -08:00
h3mosphere
006e7a77d5 Linux: Fix some crashes from new functions having unimplemented!() (#7567)
Release Notes:

- N/A
2024-02-08 10:53:39 -05:00
h3mosphere
4048dbfafd Linux: Disable PureScript grammar to avoid linking error (#7543)
Release Notes:

- N/A
2024-02-08 10:40:26 -05:00
Marshall Bowers
9f4ce7fba5 Remove unneeded type annotations where inference will do (#7573)
This PR removes some unneeded type annotations where we're able to infer
the type accurately.

Release Notes:

- N/A
2024-02-08 10:32:08 -05:00
White Choco
bd390aabf4 Fix mis-description in default settings (#7564)
Change word from "Stable" to "Dev" of option `dev`



Release Notes:

- N/A
2024-02-08 10:19:18 -05:00
dalton-oliveira
a0b2614d57 Add unique lines command (#7526)
Changes `Editor::manipulate_lines` to allow line adding and removal
through callback function.

- Added `editor::UniqueLinesCaseSensitive` and `editor::UniqueLinesCaseInsensitive` commands
([#4831](https://github.com/zed-industries/zed/issues/4831))
2024-02-08 17:13:15 +02:00
Kirill Bulatov
89b1e76003 Fix gopls langserver downloads (#7571)
Fixes https://github.com/zed-industries/zed/issues/7534 by not requiring
assets for gopls and vscode-eslint langservers — those two are the only
ones in Zed that do not use assets directly when determining langserver
version and retrieving those.
All other servers deal with assets, hence require those to be present.

The problem with https://github.com/tamasfe/taplo/releases is that they
host multiple binary releases in the same release list, so for now the
code works because only the langserver has assets — but as soon as
another release there gets assets, it will break again.
We could filter out those by names also, but they also tend to change
(and can be edited manually), so keeping it as is for now.

Release Notes:

- Fixed gopls language server downloads
([7534](https://github.com/zed-industries/zed/issues/7534))
2024-02-08 16:17:47 +02:00
Kirill Bulatov
f734365b7b Avoid another confirmation when submitting/discarding feedback (#7569)
Fixes https://github.com/zed-industries/zed/issues/7515

Release Notes:

- Fixed feedback modal spawning extra confirmations on cancel and submit
([7515](https://github.com/zed-industries/zed/issues/7515))
2024-02-08 16:13:54 +02:00
Dzmitry Malyshau
d457eef099 blade: fix path rasterization (#7546)
There were mistakes in the blending mode, primitive topology, and the
equation.

![gpui-text-selection](https://github.com/zed-industries/zed/assets/107301/13f1285e-1338-4c87-b1bb-7e426606f939)



Release Notes:
- N/A
2024-02-08 09:08:04 -05:00
Dzmitry Malyshau
00024b791b Uprev blade to 26bc5e8 (#7556)
Picks up https://github.com/kvark/blade/pull/73 to make it possible to
start experimenting with GLES backend.

Release Notes:
- N/A
2024-02-08 08:41:55 -05:00
Gianni Rosato
73498f388a Recognize More Multimedia Filetypes (#7557)
This PR recognizes the following filetypes and provides them with
appropriate icons: `.avi .heic .j2k .jfif .jp2 .jxl .m4a .m4v .mkv .mka
.mov .opus .qoi .wma .wmv .wv`.

It also corrects `.ogg` to display an audio icon, not a video icon.
Though the container supports video, `.ogg` files are most commonly
found containing audio-only bitstreams likely due to the popularity of
the Vorbis audio codec. VSCode recognizes OGG files as audio.

Here is an exhaustive list of the file formats this PR aims to
recognize, with a subjective commonality rating attached to each:

- `.avi`: Audio Video Interleave. Multimedia container format for video
and audio data. **Rating: 7/10**
- `.heic`: High Efficiency Image Format. The same thing as `.heif`,
which is currently recognized. **Rating: 6/10**
- `.j2k`: JPEG 2000. Bitmap image format for lossy or lossless
compression. **Rating: 3/10**
- `.jfif`: JPEG File Interchange Format. Alternative JPEG extension that
sometimes pops up on the Web. **Rating: 5/10**
- `.jp2`: JPEG 2000 again, same rating.
- `.jxl`: JPEG XL. Modern, versatile image format growing in popularity.
**Rating: 5/10**
- `.m4a`: MPEG-4 Audio. Audio file format using AAC (lossy) or ALAC
(lossless) codecs. **Rating: 8/10**
- `.m4v`: MPEG-4 Video. Video container format developed by Apple
similar to MP4. **Rating: 4/10**
- `.mkv`: Matroska Video. Multimedia container format for video, audio,
and subtitle tracks. **Rating: 8/10**
- `.mka`: Matroska Audio. Audio file format supporting several types of
audio compression algorithms. **Rating: 3/10**
- `.mov`: QuickTime Movie. Multimedia container format developed by
Apple. **Rating: 8/10**
- `.opus`: Opus Audio. Audio coding format for efficient real-time audio
streaming. **Rating: 7/10**
- `.qoi`: Quite OK Image. Modern lossless image format for fast encoding
& decoding. **Rating: 1/10**
- `.wma`: Windows Media Audio. Audio file format developed by Microsoft.
**Rating: 6/10**
- `.wmv`: Windows Media Video. Video file format developed by Microsoft.
**Rating: 7/10**
- `.wv`: WavPack. Free, open-source lossless audio compression format
similar to FLAC. **Rating: 2/10**

Again note that the commonality rating is subjective and may vary based
on the specific use cases users have for Zed and their software
environments. I hope some of these will be considered, as having
flexible filetype recognition greatly adds to the feeling of
completeness in an editor at what appears to be very little cost. Thank
you!

Release Notes:

- Adds icon associations for more multimedia types [#7551](https://github.com/zed-industries/zed/issues/7551).
2024-02-08 11:25:54 +02:00
Kieran Gill
61b8d3639f markdown_preview: Improved markdown rendering support (#7345)
This PR improves support for rendering markdown documents.

## After the updates


https://github.com/zed-industries/zed/assets/18583882/48315901-563d-44c6-8265-8390e8eed942

## Before the updates


https://github.com/zed-industries/zed/assets/18583882/6d7ddb55-41f7-492e-af12-6ab54559f612

## New features

- @SomeoneToIgnore's [scrolling feature
request](https://github.com/zed-industries/zed/pull/6958#pullrequestreview-1850458632).
- Checkboxes (`- [ ]` and `- [x]`)
- Inline code blocks.
- Ordered and unordered lists at an arbitrary depth.
- Block quotes that render nested content, like code blocks.
- Lists that render nested content, like code blocks.
- Block quotes that support variable heading sizes and the other
markdown features added
[here](https://github.com/zed-industries/zed/pull/6958).
- Users can see and click internal links (`[See the docs](./docs.md)`).

## Notable changes

- Removed dependency on `rich_text`.
- Added a new method for parsing markdown into renderable structs. This
method uses recursive descent so it can easily support more complex
markdown documents.
- Parsing does not happen for every call to
`MarkdownPreviewView::render` anymore.

## TODO

- [ ] Typing should move the markdown preview cursor.

## Future work under consideration

- If a title exists for a link, show it on hover.
- Images. 
- Since this PR brings the most support for markdown, we can consolidate
`languages/markdown` and `rich_text` to use this new renderer. Note that
the updated inline text rendering method in this PR originated from
`langauges/markdown`.
- Syntax highlighting in code blocks.
- Footnote references.
- Inline HTML.
- Strikethrough support.
- Scrolling improvements:
- Handle automatic preview scrolling when multiple cursors are used in
the editor.
- > great to see that the render now respects editor's scrolls, but can
we also support the vice-versa (as syntax tree does it in Zed) — when
scrolling the render, it would be good to scroll the editor too
- > sometimes it's hard to understand where the "caret" on the render
is, so I wonder if we could go even further with its placement and place
it inside the text, as a regular caret? Maybe even support the
selections?
- > switching to another markdown tab does not change the rendered
contents and when I call the render command again, the screen gets
another split — I would rather prefer to have Zed's syntax tree
behavior: there's always a single panel that renders things for whatever
tab is active now. At least we should not split if there's already a
split, rather adding the new rendered tab there.
- > plaintext URLs could get a highlight and the click action

## Release Notes

- Improved support for markdown rendering.
2024-02-08 11:19:31 +02:00
Robert Clover
cbe7a12e65 Add information to Copilot sign-in UI when disabled (#7496)
I'd love to take on fixing this but:

1. I don't think this is the right solution - it would be really nice to
have something actionable that I could do when presented with this
message.
2. Should signing in to Copilot be independent from whether it's
enabled? You can only access the sign-in modal when `features.copilot`
isn't disabled, but when `show_copilot_suggestions` is `false` the
server is disabled but you can't sign in. So I guess another solution
might be to just not show the UI if copilot suggestions are disabled?
3. I don't know what other circumstances could trigger the empty modal.
I see `Status::Error` and that seems like it might be important to
surface gracefully?

Would love some thoughts on this

Release Notes:

- Improved UX for enabling Copilot when it's disabled in settings
2024-02-07 22:28:02 -07:00
Marshall Bowers
ccc6d76708 Clean up util::paths (#7536)
This PR cleans up the path definitions in `util::paths` following the
Linux merge.

We were using a bunch of target-specific compilation that made these
declarations kind of messy, when really we can limit the conditional
compilation to just the base directories that we use as the basis for
the other directories.

Release Notes:

- N/A
2024-02-07 21:01:45 -05:00
Max Brunsfeld
7b03e977e4 Reload grammars in extensions when they are updated on disk (#7531)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-07 16:39:11 -08:00
Marshall Bowers
f2a4dbaf7f Fix typo in mark_language_loaded doc comment (#7533)
This PR fixes a small typo in the `mark_language_loaded` doc comment.

Release Notes:

- N/A
2024-02-07 18:50:11 -05:00
Antar
219ec91748 Fix compile errors on Linux (#7527)
Added some missing trait functions and `unimplemented` markings

Release Notes:

- N/A
2024-02-07 18:46:24 -05:00
Bennet Bo Fenner
6cdd7796c3 terminal: strikethrough text (#7507)
#7363 added support for rendering strikethrough text, so now we can
handle this case in the terminal.

Should close: #7434

Before:

![image](https://github.com/zed-industries/zed/assets/53836821/cb7a4eae-5bc9-425c-974d-07a9f089917a)

After:

![image](https://github.com/zed-industries/zed/assets/53836821/5aaacee2-95bc-4039-972d-96bd7c01ea59)

Release Notes:

- Fixed rendering strikethrough text inside the terminal #7434
2024-02-07 16:36:30 -07:00
Conrad Irwin
f55aba51ec Fix panic! caused by bad utf16 clipping (#7530)
Release Notes:

- Fixed a panic in diagnostics with emojis

**or**

- N/A
2024-02-07 16:35:30 -07:00
Marshall Bowers
374c8a4c8c Reload theme using ThemeSettings::reload_current_theme (#7522)
This PR updates the various spots where we reload the theme to use
`ThemeSettings::reload_current_theme` instead of duplicating the code
each time.

Release Notes:

- N/A
2024-02-07 16:56:24 -05:00
d1y
45cf36e870 theme_importer: Add --output flag for outputting the theme to a file (#7486)
```bash
cargo run -p theme_importer -- dark-plus-syntax-color-theme.json --output output.json
```

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-07 16:23:36 -05:00
Joseph T. Lyons
e6dad23154 chat: closing reply preview with action (#7517)
This is a follow up to #7170. Closing the reply to preview overlay is
now configurable with an action (keybinding set escape in the default
keymap).


https://github.com/zed-industries/zed/assets/53836821/d679e734-f90b-4490-8e79-7dfe5407988a


Release Notes:
- N/A
2024-02-07 16:12:33 -05:00
Marshall Bowers
2f4bb79553 Reload themes defined in extensions (#7520)
This PR extends the extension directory watcher to also watch and reload
themes defined in extensions.

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-02-07 16:11:24 -05:00
Daniel Banck
31d9edfaaa Fix Terraform syntax highlighting (#7518)
https://github.com/zed-industries/zed/pull/7467 introduced a new
`grammar` field in the language configuration files.
The underlying tree-sitter grammar for Terraform should be `hcl` instead
of `terraform`. This PR fixes that typo.

Release Notes:

- N/A
2024-02-07 16:06:13 -05:00
Conrad Irwin
eaadf56db9 Testing buf breaking (#7475)
Release Notes:

- N/A
2024-02-07 13:55:36 -07:00
Mikayla Maki
5ded86543b [official] Linux port via Blade (#7343)
## Motivation

I ❤️ Zed! It's lightning fast and has great UX. I want it to run as
well on all major platforms. I'm currently using Linux most actively.
[Blade](https://github.com/kvark/blade) is a good candidate for
providing GPU access: it supports Vulkan, Metal, and GLES/WebGL. Its
abstraction is extremely thin, while having one of the nicest GPU APIs.
Codebase is also tiny. Checkout [the meetup
recording](https://www.youtube.com/watch?v=63dnzjw4azI&t=623s) from a
year ago.
I believe these projects make a good match 🚀 !

### Why this is a bad idea

If Zed team wants to use off-the-shelf components from Rust ecosystem,
then Blade is certainly at disadvantage here, since it's not widely
used. It would rely on Zed team adding necessary features in a branch,
then maybe upstreaming some of them. That is to say, it's unclear if
this can be avoided with more popular alternatives - being flexible with
any local changes is a good ability.

### Why it's not too bad

Blade uses [WGSL](https://www.w3.org/TR/WGSL) shaders, similar to `wgpu`
and `arcana`, but without the binding decorations. So this aspect of the
product is nicely portable.

## Progress

- [ ] Platforms
  - [x] X11 (via xcb)
    - [ ] input handling
    - [ ] get proper content size
  - [ ] Windows
  - [ ] Replace the existing Metal backend
- [ ] Text System
  - [ ] shaping
  - [ ] glyph rasterization
- [x] Texture atlas
- [ ] Rendering
  - [x] basic primitives
  - [x] path rendering
  - [x] sprite rendering
- [ ] media surfaces
- [ ] CI

## Current status
Zed starts up but crashes on text-system related checks.

![zed-linux-1](https://github.com/zed-industries/zed/assets/107301/ba536218-4d2c-43c9-ae6c-bef69b54bd0c)
2024-02-07 12:40:22 -08:00
Mikayla
3a53db6502 Merge branch 'main' into kvark-linux 2024-02-07 12:30:36 -08:00
Max Brunsfeld
6edeea7c8a Add logic for managing language and theme extensions (#7467)
This PR adds the initial support for loading extensions in Zed.

### Extensions Directory

Extensions are loaded from the extensions directory.

The extensions directory has the following structure:

```
extensions/
  installed/
    extension-a/
      grammars/
      languages/
    extension-b/
      themes/
  manifest.json
```

The `manifest.json` file is used internally by Zed to keep track of
which extensions are installed. This file should be maintained
automatically, and shouldn't require any direct interaction with it.

Extensions can provide Tree-sitter grammars, languages, and themes.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-07 15:14:50 -05:00
Bennet Bo Fenner
ef8cab65b0 allow closing reply to preview with action
Co-Authored-By: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
2024-02-07 21:14:36 +01:00
Mikayla
be455f7f28 Restore nanoid dependency 2024-02-07 12:04:29 -08:00
Mikayla
f507698c62 Fix a few out of date warnings 2024-02-07 11:59:52 -08:00
Mikayla
67555ee5b4 Merge branch 'main' into kvark-linux 2024-02-07 11:52:44 -08:00
Bennet Bo Fenner
6b598a07d9 chat: fix autocompletion for usernames with dash (#7514)
Github usernames are allowed to contain `-`, but the autocompletion was
not working correctly.
We added `-` as an allowed character for markdown files. We are not
aware of any completions for markdown files, so this should be fine to
add.


Before:

![image](https://github.com/zed-industries/zed/assets/53836821/5b456ed6-3098-48e8-90db-f5f42b4aa535)

After:

![image](https://github.com/zed-industries/zed/assets/53836821/a544f465-0b68-46f5-9a15-83b4c755c3c0)


Release Notes:

- Fixed autocompletion for usernames with dash character in the chat
message editor

Co-authored-by: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
2024-02-07 12:48:33 -07:00
Mikayla
3734a390b2 Mark TODOs and prep for merging main 2024-02-07 11:39:26 -08:00
Rashid Almheiri
c1ada087b4 docs: Update OPAM installation instructions (#7510)
Use the new installation procedures located at
https://ocaml.org/install.

Release Notes:
- N/A
2024-02-07 14:12:53 -05:00
Antonio Scandurra
07fce7aae1 Stop display link when window is occluded (#7511)
Release Notes:

- Fixed a bug that caused the window to become unresponsive after
foregrounding.

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-07 11:45:30 -07:00
Joseph T. Lyons
114889b8bb v0.123.x dev 2024-02-07 12:19:41 -05:00
Kirill Bulatov
83cffdde1f Use collections::{HashMap, HashSet} instead of its std:: counterpart (#7502) 2024-02-07 19:06:03 +02:00
Marshall Bowers
c322179bb9 Initialize the SystemAppearance using the app's global window appearance (#7508)
This PR changes our approach to initializing the `SystemAppearance` so
that we can do it earlier in the startup process.

Previously we were using the appearance from the window, meaning that we
couldn't initialize the value until we first opened the window.

Now we read the `window_appearance` from the `AppContext`. On macOS this
is backed by the
[`effectiveAppearance`](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance)
on the `NSApplication`.

We currently still watch for changes to the appearance at the window
level, as the only hook I could find in the documentation is
[`viewDidChangeEffectiveAppearance`](https://developer.apple.com/documentation/appkit/nsview/2977088-viewdidchangeeffectiveappearance),
which is at the `NSView` level.

In my testing this makes it so Zed appropriately chooses the correct
light/dark theme on startup.

Release Notes:

- N/A
2024-02-07 11:51:18 -05:00
Conrad Irwin
b59e110c59 Attempt to fix random lag (#7506)
Co-Authored-By: Antonio <antonio@zed.dev>
Co-Authored-By: Thorsten <thorsten@zed.dev>
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- N/A

**or**

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-07 09:45:49 -07:00
白山風露
42a5081aff Use try_from_bytes for windows build (#7500)
Reduce windows build error.

Release Notes:

- N/A
2024-02-07 11:27:26 -05:00
d1y
c7b022144f theme_importer: Read theme name from VS Code theme (#7489)
apply theme_name(fallback use "")

Release Notes:

- N/A
2024-02-07 10:13:46 -05:00
Kieran Gill
ad3940c66f text rendering: support strikethroughs (#7363)
<img width="1269" alt="image"
src="https://github.com/zed-industries/zed/assets/18583882/d4c93033-b2ac-4ae0-8e12-457f256ee869">

Release Notes:

- Added support for styling text with strikethrough.

Related: 
- https://github.com/zed-industries/zed/issues/5364
- https://github.com/zed-industries/zed/pull/7345
2024-02-07 16:51:27 +02:00
Antonio Scandurra
55129d4d6c Revert "Use Fx* variants of HashMap and HashSet everywhere in Zed" (#7492)
Reverts zed-industries/zed#7481

This would regress performance because we'd be using the standard
library's hash maps everywhere, so reverting for now.
2024-02-07 13:16:22 +01:00
Thorsten Ball
5c8073d344 Underline text if in dead key state (#7488)
This highlights dead keys. Example: when in Brazilian keyboard layout
and typing `"` it's now underlined.



https://github.com/zed-industries/zed/assets/1185253/a6b65f7b-1007-473d-ab0f-5d658faa191b



Release Notes:

- Fixed dead keys not being underlined.

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-07 12:52:49 +01:00
Thorsten Ball
db39b9dadc Add ability to bind to pane::RevealInProjectPanel (#7487)
Previously it wasn't possible to create a keybinding for this action
because it required an argument.

Now the action takes the active item of the pane and if it's a
multi-buffer the first one.

This also adds a default keybinding for Vim mode: `-` will reveal the
file in the project panel.

Fixes #7485.

Release Notes:

- Added `pane::RevealInProjectPanel` as an action in the command
palette. ([#7485](https://github.com/zed-industries/zed/issues/7485)).

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-07 12:50:22 +01:00
Todsaporn Banjerdkit
2aa8ccd6b1 fix: use OPEN_AI_API_URL (#7484)
Release Notes:

- N/A
2024-02-07 10:13:52 +01:00
Dzmitry Malyshau
e3ae7c4fe0 linux: query window geometry for determining the surface extents 2024-02-07 00:33:40 -08:00
Kirill Bulatov
eb236302c2 Use Fx* variants of HashMap and HashSet everywhere in Zed (#7481)
Release Notes:

- N/A
2024-02-07 09:45:37 +02:00
James Gee
7939673a7d Jetbrains keymap - Movement between panes (#7464)
Release Notes:

- Improved Jetbrains keybindings to include cmd+alt+left/right to go
back and forwards between panes rather than the default previous / next
pane

Signed-off-by: James Gee <1285296+geemanjs@users.noreply.github.com>
2024-02-07 09:12:34 +02:00
Amin Yahyaabadi
d3562d4c9c Fixes for file-watching, user assets, and system dependencies (#2)
* fix: avoid panics in case of non-existing path for watching

* fix: copy the themes and plugins

* Revert "add a few more libraries to the linux script"

This reverts commit 7509677003.

* fix: add vulkan validation layers to the system deps

* fix: fix the themes paths
2024-02-06 22:54:40 -08:00
Conrad Irwin
9fd221271a Go back to an alacritty release (#7474)
Release Notes:

- N/A
2024-02-06 20:58:38 -07:00
Andrew Marek
3aa4e0c90b Fix Vim 'e' Behavior When Boundary Is Last Point on Line (#7424)
This was originally just to fix
https://github.com/zed-industries/zed/issues/4354, which I did by just
returning the previous offset in `find_boundary`.. but `find_boundary`
is used in the "insert mode" / normal editor too, so returning the
previous boundary breaks existing functionality in that case.

I was considering a new `find_boundary` function just for some of the
vim motions like this, but I thought that this is straightforward enough
and future Vim functions might need similar logic too.

Release Notes:

- Fixed https://github.com/zed-industries/zed/issues/4354
2024-02-06 20:25:56 -07:00
Conrad Irwin
90cd3b5e87 Prevent terminal being a single column wide (#7471)
Fixes: #2750
Fixes: #7457



Release Notes:

- Fixed a hang/panic that could happen rendering a double-width
character in a single-width terminal
([#2750](https://github.com/zed-industries/zed/issues/2750),
[#7457](https://github.com/zed-industries/zed/issues/7457)).
2024-02-06 20:25:02 -07:00
Max Brunsfeld
1264e36429 Remove Default impl for ConnectionId (#7452)
We noticed the following message in my logs when trying to debug some
lag when collaborating:

```
2024-02-06T09:42:09-08:00 [ERROR] error handling message. client_id:3, sender_id:Some(PeerId { owner_id: 327, id: 1123430 }), type:GetCompletions, error:no such connection: 0/0
```

That `0/0` looks like a bogus connection id, constructed via a derived
`Default`. We didn't ever find a code path that would *use* a default
`ConnectionId` and lead to this error, but it did seem like an
improvement to not have a `Default` for that type.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-06 15:45:15 -05:00
Max Brunsfeld
4e519e3af7 Make diagnostics with empty messages take up one line (#7456)
When a supporting diagnostic had an empty message, we were accidentally
giving the corresponding block a height of zero lines.

Release Notes:

- Fixed an issue where an editors' lines were not laid out correctly
when showing certain diagnostics.

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-06 15:38:54 -05:00
Remco Smits
6c4b96ec76 Add the ability to reply to a message (#7170)
Feature
- [x] Allow to click on reply to go to the real message
    - [x] In chat
- [x] Show only a part of the message that you reply to
    - [x] In chat
    - [x] In reply preview

TODO’s
- [x] Fix migration
    - [x] timestamp(in filename)
    - [x] remove the reference to the reply_message_id
- [x] Fix markdown cache for reply message
- [x] Fix spacing when first message is a reply to you and you want to
reply to that message.
- [x] Fetch message that you replied to
    - [x] allow fetching messages that are not inside the current view 
- [x] When message is deleted, we should show a text like `message
deleted` or something
    - [x] Show correct GitHub username + icon after `Replied to: `
    - [x] Show correct message(now it's hard-coded)
- [x] Add icon to reply + add the onClick logic
- [x] Show message that you want to reply to
  - [x] Allow to click away the message that you want to reply to
  - [x] Fix hard-coded GitHub user + icon after `Reply tp:`
  - [x] Add tests

<img width="242" alt="Screenshot 2024-02-06 at 20 51 40"
src="https://github.com/zed-industries/zed/assets/62463826/a7a5f3e0-dee3-4d38-95db-258b169e4498">
<img width="240" alt="Screenshot 2024-02-06 at 20 52 02"
src="https://github.com/zed-industries/zed/assets/62463826/3e136de3-4135-4c07-bd43-30089b677c0a">


Release Notes:

- Added the ability to reply to a message.
- Added highlight message when you click on mention notifications or a
reply message.

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-06 13:22:54 -07:00
Piotr Osiewicz
743f9b345f chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Piotr Osiewicz
70e7ea365c chore: Fix up warnings from cargo +beta check. (#7453)
With upcoming release of 1.76 I did a check of current +beta (which
seems to already be at 1.77). These would cause CI pipeline failures
once 1.77 is out.

Release Notes:

- N/A
2024-02-06 20:36:02 +01:00
Marshall Bowers
792c832205 Improve error handling when copying a permalink fails (#7447)
This PR improves the error handling when the `editor: copy permalink to
line` action fails.

Right now if something goes wrong nothing happens, and we don't write
anything to the logs.

This PR makes it so we display a toast when the operation fails with the
error message, as well as write it to the Zed logs.

Release Notes:

- Improved error behavior for `editor: copy permalink to line` action.
2024-02-06 12:08:11 -05:00
Marshall Bowers
0b2a9d2bea Remove empty message editor placeholder (#7444)
This PR removes the placeholder that we previously displayed for the
chat message editor.

With the changes in #7441 we can no longer hit this codepath.

Release Notes:

- N/A
2024-02-06 11:37:08 -05:00
Thorsten Ball
960eaf6245 Remove unused TerminalView.has_new_content (#7429)
Found this last week with @osiewicz and we realized that it's unused. So
I think it's fine to remove it, but I want to hear whether @mikayla-maki
has some thoughts here.



Release Notes:

- N/A
2024-02-06 16:58:10 +01:00
Thorsten Ball
068c141559 Fix shell environment not loading for Nushell (#7442)
Turns out that Nushell doesn't like `-lic` and `&&`, but works perfectly
fine with `-l -i -c` and `;`, which the other shells do too.

These all work:

    bash -l -i -c 'echo lol; /usr/bin/env -0'
    nu -l -i -c 'echo lol; /usr/bin/env -0'
    zsh -l -i -c 'echo lol; /usr/bin/env -0'
    fish -l -i -c 'echo lol; /usr/bin/env -0'

Release Notes:

- Fixed shell environment not being loaded if Nushell was set as
`$SHELL`.
2024-02-06 16:44:24 +01:00
Andrey Kuzmin
33d982b08a Add Elm file icon (#7440)
Tried to match the existing file icons in Zed as much as possible. This
is how it looks:

|  dark  | light  | 
|---|----|
| <img width="183" alt="Screenshot 2024-02-06 at 15 03 57"
src="https://github.com/zed-industries/zed/assets/43472/bd862753-41bb-4ca6-9a44-16b9b1c9591c">
| <img width="180" alt="Screenshot 2024-02-06 at 15 03 14"
src="https://github.com/zed-industries/zed/assets/43472/9df8c589-64b6-49f2-8e15-b43126579a9f">
|

The main challenge is that the tangram is visually quite heavy and
detailed. The existing icons in Zed are designed in a 14px bounding box,
but are a bit smaller themselves. I guess the extra space is reserved
for hanging elements, it probably doesn't make sense to occupy the whole
area.

Simply scaling down an available SVG of the tangram didn't work well.
The individual shapes were not recognizable because the spacing between
them was too thin. I tried removing the spacing and applying different
opacities for each shape, but that didn't yield enough contrast between
the shapes either.

The second approach was to just use the outlines. It sort of worked, but
looked a bit messy in the places when the outlines are denser than the
tangram shapes:

|  dark  | light  | 
|---|----|
| <img width="192" alt="Screenshot 2024-02-05 at 22 55 46"
src="https://github.com/zed-industries/zed/assets/43472/d0029f49-675d-40ac-96d8-788a29706bad">
| <img width="195" alt="Screenshot 2024-02-05 at 22 56 05"
src="https://github.com/zed-industries/zed/assets/43472/d2de922a-70ec-4bd1-9033-db9a5201e9bd">
|

I then tried to remove the main outline and use the maximum space for
the tangram. That let me increase the spacing between the shapes. I also
rounded them a little bit, to make them look similar to other icons from
Zed. The end result looks clean and the shapes are still recognisable.

Approaches I tried next to an existing icon from Zed:

<img width="711" alt="Screenshot 2024-02-06 at 15 15 33"
src="https://github.com/zed-industries/zed/assets/43472/a3e4b0db-4b98-4072-91e8-fe71cff19adf">


Release Notes:

- Added file type icon for Elm
2024-02-06 17:25:38 +02:00
Marshall Bowers
56f7f18033 Hide the chat message editor when there is no active chat (#7441)
This PR makes it so the chat message editor is hidden when not in an
active chat.

Release Notes:

- Changed the chat message editor to be hidden when not in an active
chat.
2024-02-06 10:18:17 -05:00
Guillem Arias Fauste
b2ce515593 Add Prisma file icon (#7207)
Add Prisma icon from https://github.com/file-icons/icons

![CleanShot 2024-02-06 at 13 17
01@2x](https://github.com/zed-industries/zed/assets/5864275/55ce9286-4e15-4125-b7f7-003e2e8d8bd5)


Release Notes:

- Added Prisma icon.
2024-02-06 13:34:46 +01:00
Josh Taylor
dad2df365c Add notes about XCode also being on the Apple Developer website (#7431)
Super minor edit about XCode being on the Apple Developer website, which
can be easier to download and install without needing to go through the
App Store.

Release Notes:
- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-02-06 12:25:46 +02:00
Piotr Osiewicz
1446fb7632 Outline a bunch of methods in gpui that leaked SubscriberSet types (#7430)
This takes down LLVM IR size of theme_selector from 316k to ~250k. Note
that I do not care about theme_selector in particular, though it acts as
a benchmark for smaller crates to me ("how much static overhead in
compile time does gpui have").

The title is a bit dramatic, so just to shed some light: by leaking a
type I mean forcing downstream crates to codegen it's methods/know about
it's drop code. Since SubscriberSet is no longer used directly in the
generic (==inlineable) methods, users no longer have to codegen `insert`
and co.

Release Notes:

- N/A
2024-02-06 11:10:15 +01:00
Thorsten Ball
c591681bad Fix Terminal focus handlers not being called (#7428)
This fixes #7401 and probably a few other things that seemed odd with
the terminal.

Turns out that `TerminalView` has `focus_in` and `focus_out` callbacks,
but they were never called. The `focus_handle` on which they were set
was not passed in to `TerminalView`.

That meant that the `impl FocusableView for TerminalView` never returned
the focus handle with the right callbacks.

This change here uses the already created focus handle and passes it in,
so that `focus_in` and `focus_out` are now correctly called.

Release Notes:

- Fixed terminal not handling focus-state correctly and, for example,
not restoring cursor blinking state correctly.
([#7401](https://github.com/zed-industries/zed/issues/7401)).
2024-02-06 10:31:01 +01:00
Oliver N
038d2a84e8 Respect RUST_LOG when started in terminal (#7425)
Release Notes:

- N/A
2024-02-06 10:14:50 +02:00
Dzmitry Malyshau
11964dc731 blade: cull mask support for sprites 2024-02-05 23:04:54 -08:00
Mikayla Maki
7509677003 add a few more libraries to the linux script 2024-02-05 21:54:03 -08:00
Dzmitry Malyshau
78f32f30f5 linux: introduce platform callbacks 2024-02-05 21:49:19 -08:00
Dzmitry Malyshau
7721b55808 Refactor cli and gpui dependnecies based on PR review feedback 2024-02-05 21:49:00 -08:00
Mikayla Maki
c7c4166724 Disable extra frames for ProMotion when screen is not active. (#7410)
This was causing an issue where windows about 1/10 of the way across the
display would hang for a fully second after being deactivated.

Release Notes:

- N/A

Co-authored-by: max <max@zed.dev>
Co-authored-by: nathan <nathan@zed.dev>
Co-authored-by: antonio <antonio@zed.dev>
2024-02-05 14:48:54 -08:00
Conrad Irwin
d04a286634 Fix prompting the user to hang up when opening a workspace (#7408)
Before this change if you had joined a call with an empty workspace,
then we'd prompt you to hang up when you tried to open a recent project.



Release Notes:

- Fixed an erroneous prompt to "hang up" when opening a new project from
an empty workspace.
2024-02-05 15:21:18 -07:00
Pseudomata
1a40c9f0f2 Add Haskell buffer symbol search (#7331)
This PR is a follow-up from
https://github.com/zed-industries/zed/pull/6786#issuecomment-1912912550
and adds an `outline.scm` file for buffer symbol search support in
Haskell.

Release Notes:

- Added buffer symbol search support for Haskell
2024-02-05 17:20:40 -05:00
Conrad Irwin
0c34bd8935 fix following bugs (#7406)
- Another broken following test
- Fix following between two windows

Release Notes:

- Fixed following when the leader has multiple Zed windows open
2024-02-05 15:12:25 -07:00
Marshall Bowers
a80a3b8706 Add support for specifying both light and dark themes in settings.json (#7404)
This PR adds support for configuring both a light and dark theme in
`settings.json`.

In addition to accepting just a theme name, the `theme` field now also
accepts an object in the following form:

```jsonc
{
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  }
}
```

Both `light` and `dark` are required, and indicate which theme should be
used when the system is in light mode and dark mode, respectively.

The `mode` field is optional and indicates which theme should be used:
- `"system"` - Use the theme that corresponds to the system's
appearance.
- `"light"` - Use the theme indicated by the `light` field.
- `"dark"` - Use the theme indicated by the `dark` field.

Thank you to @Yesterday17 for taking a first stab at this in #6881!

Release Notes:

- Added support for configuring both a light and dark theme and
switching between them based on system preference.
2024-02-05 15:39:01 -05:00
Kirill Bulatov
b59f925933 Upgrade GH actions to reduce CI warnings (#7403)
Deals with one of the warnings GH shows on our actions run:

https://github.com/zed-industries/zed/actions/runs/7790218555
<img width="1383" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/e523ec7c-bf43-4b0d-8c36-8540aef6fae9">

bufbuild/* actions seem to have no new major versions so there's nothing
new to upgrade to.

Release Notes:

- N/A
2024-02-05 22:26:56 +02:00
N8th8n8el
46464ebe87 terminal: Fix copy to clipboard lag (#7323)
Fixes #7322

Release Notes:

- Fixed terminal's copy to clipboard being non-instant ([7322](https://github.com/zed-industries/zed/issues/7322))
2024-02-05 22:06:43 +02:00
Kirill Bulatov
28a62affe4 Clean up visible inlay hints that got removed from the cache (#7399)
Fixes another flack in the inlay hint cache.
Now that test does not fail after 500 iterations and seems to be stable
at last.

Release Notes:

- N/A
2024-02-05 22:03:44 +02:00
Caius Durling
6863b9263e Add Terraform & HCL syntax highlighting (#6882)
Terraform and HCL are almost the same language, but not quite so
proposing them as separate languages within Zed. (Terraform is an
extension of HCL, with a different formatter.)

This is just adding the language definition, parsing and highlighting
functionality, not any LSP or formatting beyond that for either
language.

I've taken a bunch of inspiration from Neovim for having the separate
languages, and also lifted some of their `scm` files (with attribution
comments in this codebase) as the tree-sitter repo doesn't contain them.
(Neovim's code is Apache-2.0 licensed, so should be fine here with
attribution from reading Zed's licenses files.) I've then amended to
make sure the capture groups are named for things Zed understands. I'd
love someone from Zed to confirm that's okay, or if I should clean-room
implement the `scm` files.

Highlighting in Terraform & HCL with a moderate amount of syntax in a
file (Terraform on left, HCL on right.)

<img width="1392" alt="Screenshot 2024-01-31 at 18 07 45"
src="https://github.com/zed-industries/zed/assets/696/1d3c9a08-588e-4b8f-ad92-98ce1e419659">

Release Notes:

- (|Improved) ...
([#5098](https://github.com/zed-industries/zed/issues/5098)).
2024-02-05 11:38:30 -08:00
Marshall Bowers
21797bad4d file_finder: Simplify removal of file name from file path (#7398)
This PR simplifies the removal of the file name from the file path when
computing the file finder matches.

Release Notes:

- N/A
2024-02-05 13:26:42 -05:00
Marshall Bowers
ce62404e24 Correctly use the base element in HighlightedLabel (#7397)
This PR updates the `HighlightedLabel` to correctly render its base
element, which is the one that receives the styling properties, instead
of rendering a new `LabelLike`.

Release Notes:

- N/A
2024-02-05 13:21:07 -05:00
Kirill Bulatov
8911e1b365 Make inlay hints test less flacky (#7396)
Suppresses a flacky inlay hints test failures like
https://github.com/zed-industries/zed/actions/runs/7788741514a for now.

Release Notes:

- N/A
2024-02-05 20:19:50 +02:00
Andrew Lygin
2ed45d72d8 File finder UI enhancement (#7364)
File finder looks and feels a little bulky now. It duplicates file names
and consumes too much space for each file.

This PR makes it more compact:
- File name is trimmed from the path, removing duplication
- Path is placed to the right of the file name, improving space usage
- Path is muted and printed in small size to not distract attention from
the main information (file names)

It makes search results easier to look through, consistent with the
editor tabs, and closer in terms of usage to mature editors.

Release Notes:

- File finder UI enhancement
2024-02-05 11:12:47 -07:00
Dairon M
91303a5021 Do not run scheduled CI jobs on forks (#7394)
Runs scheduled CI jobs only on the main repository, not on forks. These
jobs fail on forks and generate unnecessary noise on contributor emails.



Release Notes:

- N/A
2024-02-05 10:12:29 -08:00
Conrad Irwin
e2e8e52ec4 Beancount syntax highlighting (#7389)
Release Notes:

- Added syntax highlighting for [Beancount](https://beancount.github.io)
2024-02-05 11:07:26 -07:00
Conrad Irwin
4195f27964 Fix hover links in channel buffers (#7393)
Release Notes:

- N/A
2024-02-05 10:57:53 -07:00
Thorsten Ball
583ce44359 Fix cmd+k in terminal and fix sporadic keybind misses (#7388)
This fixes `cmd+k` in the terminal taking 1s to have an effect. It is
now immediate.

It also fixes #7270 by ensuring that we don't set a bad state when
matching keybindings.

It matches keybindings per context and if it finds a match on a lower
context it doesn't keep pending keystrokes. If it finds two matches on
the same context level, requiring more keystrokes, then it waits.



Release Notes:

- Fixed `cmd-k` in terminal taking 1s to have an effect. Also fixed
sporadic non-matching of keybindings if there are overlapping
keybindings.
([#7270](https://github.com/zed-industries/zed/issues/7270)).

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-05 10:55:27 -07:00
Marshall Bowers
47329f4489 Add search.match_background colors to bundled themes (#7385)
This PR populates the `search.match_background` colors in the bundled
themes, using the values from the Zed1 themes.

Release Notes:

- Added theme-specific `search.match_background` colors to built-in
themes.
2024-02-05 11:13:38 -05:00
Thorsten Ball
223f45c65b Remove default keybinds for navigating between docks/editors (#7381)
Turns out that these keybindings are active in Vim *and* in non-Vim mode
and they shadow `Ctrl-w` in terminals.

We should fix `Ctrl-w` being shadowed, but until then let's remove the
default keybindings.

Release Notes:

- N/A

Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Conrad <Conrad@zed.dev>
2024-02-05 17:12:35 +01:00
Amin Yahyaabadi
81bfa5fac4 fix: create the settings and keymaps to unblock file watching 2024-02-04 23:56:45 -08:00
Amin Yahyaabadi
fde159fea1 build: add Blade font-config sys deps on Linux 2024-02-04 23:56:45 -08:00
Dzmitry Malyshau
521b2b12e4 linux: create a hidden window inside the platform
It allows us to receive messages from the dispatcher,
which breaks us out of waiting and lets us execute
main thread runnables as a part of the main loop.
2024-02-04 23:52:22 -08:00
Dzmitry Malyshau
282cc71df9 linux: refactor LinuxPlatform to avoid recursive locking from the window callbacks 2024-02-04 22:37:34 -08:00
Dzmitry Malyshau
8d339ede1c linux: HACK disable watcher and crash uploader temporarily 2024-02-04 20:23:06 -08:00
Dzmitry Malyshau
d03f3b9f18 linux: switch folders to use CONFIG_DIR 2024-02-04 20:14:11 -08:00
Dzmitry Malyshau
1c410c1b99 linux: only tick the main thread tasks and one at a time in the event loop 2024-02-04 19:36:58 -08:00
Dzmitry Malyshau
f92be4b817 linux: temporarily disable purescript tree sitter
Link error:
  = note: /nix/store/idiaraknw071d20nlqp49s18gbvw4wa0-binutils-2.40/bin/ld: /x/Code/zed/target/x86_64-unknown-linux-gnu/debug/deps/libtree_sitter_haskell-7323f782ad886c6d.rlib(scanner.o): in function `state_new':
          /home/kvark/.cargo/git/checkouts/tree-sitter-haskell-74c278e7a2ef8d7d/cf98de2/src/scanner.c:218: multiple definition of `state_new'; /x/Code/zed/target/x86_64-unknown-linux-gnu/debug/deps/libtree_sitter_purescript-b0a95fb604a5817c.rlib(scanner.o):/home/kvark/.cargo/git/checkouts/tree-sitter-purescript-88dd3ec656c48026/a37140f/src/scanner.c:218: first defined here
2024-02-04 15:59:07 -08:00
Dzmitry Malyshau
b13b5726c5 linux: disable mac-os specific build commands 2024-02-04 15:58:29 -08:00
Dzmitry Malyshau
224fe13f9f blade: fix tile bounds shader FFI 2024-02-04 13:59:41 -08:00
Dzmitry Malyshau
0a5ebee9e5 blade: encapsulate BladeAtlasStorage for indexing 2024-02-04 13:03:16 -08:00
Dzmitry Malyshau
26ca798707 blade: initialize atlas textures 2024-02-04 12:45:18 -08:00
Dzmitry Malyshau
61fa5e93a8 blade: always create texture views for atlas tiles 2024-02-04 12:15:41 -08:00
Dzmitry Malyshau
aae532987f blade: tune belt alignment to match Intel Iris Xe 2024-02-04 11:35:19 -08:00
Dzmitry Malyshau
13ba8b6b54 Fix linux target in rust-toolchain.toml
Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>
2024-02-04 11:34:57 -08:00
Dzmitry Malyshau
d6bbcf503b blade: enforce alignment in the belt 2024-02-04 00:09:32 -08:00
Dzmitry Malyshau
c5ff46e14f blade: fix shadow vertex bounds 2024-02-03 23:51:37 -08:00
Dzmitry Malyshau
cf71fe8bf1 fix MacOS build, switch external RWH to 0.6
leaving blade-internal RWH as 0.5 until this is fixed:
https://github.com/ash-rs/ash/issues/864
2024-02-03 23:50:44 -08:00
Dzmitry Malyshau
d0a0ce1885 blade: mono/poly chrome sprite rendering 2024-02-03 21:30:47 -08:00
Dzmitry Malyshau
59642bf29a blade: point to master, remove the override 2024-02-03 14:13:36 -08:00
Dzmitry Malyshau
2e32f5867e linux: various fixes across the crates to make it compile 2024-02-03 00:06:20 -08:00
Dzmitry Malyshau
7c7aad5e76 blade: port underline shader 2024-02-02 23:04:56 -08:00
Dzmitry Malyshau
04e49dc493 blade: refactor the atlas to not own the command encoder 2024-02-02 22:22:18 -08:00
Dzmitry Malyshau
c000d2e16b blade: path sprite rendering 2024-02-02 00:34:08 -08:00
Dzmitry Malyshau
fdaffdbfff linux: path rasterization shader 2024-02-01 22:56:50 -08:00
Dzmitry Malyshau
05c42211fe linux: implement RWH for LinuxWindow 2024-02-01 22:05:59 -08:00
Dzmitry Malyshau
ed679c9347 WIP path rasterization 2024-02-01 21:43:28 -08:00
Dzmitry Malyshau
ce84a2a671 linux: refactor window structure, support move callback 2024-02-01 21:43:28 -08:00
Dzmitry Malyshau
c9ec337034 linux: share corner picking code between shaders 2024-02-01 21:43:28 -08:00
Dzmitry Malyshau
666b134d20 linux: shadow rendering 2024-02-01 21:43:28 -08:00
Dzmitry Malyshau
ecf4955899 hide MacOS dependencie of live_kit_client and media 2024-02-01 21:42:57 -08:00
Dzmitry Malyshau
8aa768765f linux: basic quad renderer logic 2024-02-01 21:41:15 -08:00
Dzmitry Malyshau
503ac7a251 linux: work around the mutex locks for request_frame and resize 2024-02-01 21:40:54 -08:00
Dzmitry Malyshau
74fde5967b linux: hook up render event, basic renderer command buffer 2024-02-01 21:40:54 -08:00
Dzmitry Malyshau
7f8c64aa6c linux: port from x11rb to xcb and hook up RawWindowHandle 2024-02-01 21:40:54 -08:00
Dzmitry Malyshau
aed363d3c7 x11: create window and route events 2024-02-01 21:29:07 -08:00
Dzmitry Malyshau
cefc98258f linux: hook up X11rb for Window creation 2024-02-01 21:29:07 -08:00
Dzmitry Malyshau
e95bf24a1f linux: basic window, display, and atlas 2024-02-01 21:29:07 -08:00
Dzmitry Malyshau
b0376aaf8f linux: start the text system 2024-02-01 21:28:37 -08:00
Dzmitry Malyshau
ca62d22147 linux: implement dispatcher, add dummy textsystem 2024-02-01 21:28:16 -08:00
Dzmitry Malyshau
d675abf70c Add Linux platform, gate usage of CVImageBuffer by macOS 2024-02-01 21:28:16 -08:00
Dzmitry Malyshau
ef4ef5f0e8 Add blade dependency 2024-02-01 21:27:43 -08:00
811 changed files with 34204 additions and 12212 deletions

View File

@@ -1,5 +1,7 @@
name: Bug Report
description: "Tip: open this issue template from within Zed with the `file bug report` command palette action"
description: |
Use this template for **non-crash-related** bug reports.
Tip: open this issue template from within Zed with the `file bug report` command palette action.
labels: ["admin read", "triage", "defect"]
body:
- type: checkboxes

View File

@@ -1,47 +0,0 @@
name: Language Support
description: Request language support
title: "<name_of_language> support"
labels:
[
"admin read",
"triage",
"enhancement",
"language",
"unsupported language",
"potential plugin",
]
body:
- type: checkboxes
attributes:
label: Check for existing issues
description: Check the backlog of issues to reduce the chances of creating duplicates; if an issue already exists, place a `+1` (👍) on it.
options:
- label: Completed
required: true
- type: input
attributes:
label: Language
description: What language do you want support for?
placeholder: HTML
validations:
required: true
- type: input
attributes:
label: Tree Sitter parser link
description: If applicable, provide a link to the appropriate tree sitter parser. Look here first - https://tree-sitter.github.io/tree-sitter/#available-parsers
placeholder: https://github.com/tree-sitter/tree-sitter-html
validations:
required: false
- type: input
attributes:
label: Language server link
description: If applicable, provide a link to the appropriate language server. Look here first - https://microsoft.github.io/language-server-protocol/implementors/servers/
placeholder: https://github.com/Microsoft/vscode/tree/main/extensions/html-language-features/server
validations:
required: false
- type: textarea
attributes:
label: Misc notes
description: Provide any additional things the team should consider when adding support for this language
validations:
required: false

View File

@@ -0,0 +1,39 @@
name: Crash Report
description: |
Use this template for crash reports.
labels: ["admin read", "triage", "defect", "panic / crash"]
body:
- type: checkboxes
attributes:
label: Check for existing issues
description: Check the backlog of issues to reduce the chances of creating duplicates; if an issue already exists, place a `+1` (👍) on it.
options:
- label: Completed
required: true
- type: textarea
attributes:
label: Describe the bug / provide steps to reproduce it
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Run the `copy system specs into clipboard` command palette action and paste the output in the field below.
validations:
required: true
- type: textarea
attributes:
label: If applicable, add mockups / screenshots to help explain present your vision of the feature
description: Drag issues into the text input below
validations:
required: false
- type: textarea
attributes:
label: |
If applicable, attach your `~/Library/Logs/Zed/Zed.log` file to this issue.
If you only need the most recent lines, you can run the `zed: open log` command palette action to see the last 1000.
description: Drag Zed.log into the text input below
validations:
required: false

View File

@@ -1,4 +1,10 @@
contact_links:
- name: Language Request
url: https://github.com/zed-industries/extensions/issues/new?assignees=&labels=language&projects=&template=1_language_request.yml&title=%3Cname_of_language%3E
about: Request a language in the extensions repository
- name: Theme Request
url: https://github.com/zed-industries/extensions/issues/new?assignees=&labels=theme&projects=&template=0_theme_request.yml&title=%3Cname_of_theme%3E+theme
about: Request a theme in the extensions repository
- name: Top-Ranking Issues
url: https://github.com/zed-industries/zed/issues/5393
about: See an overview of the most popular Zed issues

View File

@@ -8,23 +8,8 @@ runs:
shell: bash -euxo pipefail {0}
run: cargo fmt --all -- --check
- name: cargo clippy
shell: bash -euxo pipefail {0}
# clippy.toml is not currently supporting specifying allowed lints
# so specify those here, and disable the rest until Zed's workspace
# will have more fixes & suppression for the standard lint set
run: |
cargo clippy --release --workspace --all-features --all-targets -- -A clippy::all -D clippy::dbg_macro -D clippy::todo
cargo clippy -p gpui
- name: Find modified migrations
shell: bash -euxo pipefail {0}
run: |
export SQUAWK_GITHUB_TOKEN=${{ github.token }}
. ./script/squawk
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-breaking-action@v1
with:
input: "crates/rpc/proto/"
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,subdir=crates/rpc/proto/"

View File

@@ -2,22 +2,22 @@ name: "Run tests"
description: "Runs the tests"
runs:
using: "composite"
steps:
- name: Install Rust
shell: bash -euxo pipefail {0}
run: |
cargo install cargo-nextest
using: "composite"
steps:
- name: Install Rust
shell: bash -euxo pipefail {0}
run: |
cargo install cargo-nextest
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Limit target directory size
shell: bash -euxo pipefail {0}
run: script/clear-target-dir-if-larger-than 100
- name: Limit target directory size
shell: bash -euxo pipefail {0}
run: script/clear-target-dir-if-larger-than 100
- name: Run tests
shell: bash -euxo pipefail {0}
run: cargo nextest run --workspace --no-fail-fast
- name: Run tests
shell: bash -euxo pipefail {0}
run: cargo nextest run --workspace --no-fail-fast

View File

@@ -7,3 +7,5 @@ Release Notes:
**or**
- N/A
Optionally, include screenshots / media showcasing your addition that can be included in the release notes.

View File

@@ -23,7 +23,7 @@ env:
jobs:
style:
name: Check formatting, Clippy lints, and spelling
name: Check formatting and spelling
runs-on:
- self-hosted
- test
@@ -35,6 +35,9 @@ jobs:
submodules: "recursive"
fetch-depth: 0
- name: Remove untracked files
run: git clean -df
- name: Set up default .cargo/config.toml
run: cp ./.cargo/ci-config.toml ~/.cargo/config.toml
@@ -48,8 +51,28 @@ jobs:
- name: Run style checks
uses: ./.github/actions/check_style
tests:
name: Run tests
- name: Ensure fresh merge
shell: bash -euxo pipefail {0}
run: |
if [ -z "$GITHUB_BASE_REF" ];
then
echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> $GITHUB_ENV
else
git checkout -B temp
git merge -q origin/$GITHUB_BASE_REF -m "merge main into temp"
echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
fi
- uses: bufbuild/buf-setup-action@v1
with:
version: v1.29.0
- uses: bufbuild/buf-breaking-action@v1
with:
input: "crates/rpc/proto/"
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/rpc/proto/"
macos_tests:
name: (macOS) Run Clippy and tests
runs-on:
- self-hosted
- test
@@ -60,31 +83,99 @@ jobs:
clean: false
submodules: "recursive"
- name: cargo clippy
shell: bash -euxo pipefail {0}
run: script/clippy
- name: Run tests
uses: ./.github/actions/run_tests
- name: Build collab
run: cargo build -p collab
- name: Build other binaries
run: cargo build --workspace --bins --all-features
- name: Build other binaries and features
run: cargo build --workspace --bins --all-features; cargo check -p gpui --features "macos-blade"
# todo!(linux): Actually run the tests
linux_tests:
name: (Linux) Run Clippy and tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- name: Restore from cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: configure linux
shell: bash -euxo pipefail {0}
run: script/linux
- name: cargo clippy
shell: bash -euxo pipefail {0}
run: script/clippy
- name: Build Zed
run: cargo build -p zed
# todo!(windows): Actually run the tests
windows_tests:
name: (Windows) Run Clippy and tests
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- name: Restore from cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- name: cargo clippy
shell: bash -euxo pipefail {0}
run: script/clippy
- name: Build Zed
run: cargo build -p zed
bundle:
name: Bundle app
name: Bundle macOS app
runs-on:
- self-hosted
- bundle
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-build-dmg') }}
needs: tests
needs: [macos_tests]
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
steps:
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "18"

View File

@@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v3
with:
version: 8

View File

@@ -27,6 +27,10 @@ jobs:
- name: Run style checks
uses: ./.github/actions/check_style
- name: Run clippy
shell: bash -euxo pipefail {0}
run: script/clippy
tests:
name: Run tests
runs-on:
@@ -41,8 +45,18 @@ jobs:
submodules: "recursive"
fetch-depth: 0
- name: Install cargo nextest
shell: bash -euxo pipefail {0}
run: |
cargo install cargo-nextest
- name: Limit target directory size
shell: bash -euxo pipefail {0}
run: script/clear-target-dir-if-larger-than 100
- name: Run tests
uses: ./.github/actions/run_tests
shell: bash -euxo pipefail {0}
run: cargo nextest run --package collab --no-fail-fast
publish:
name: Publish collab server image
@@ -59,9 +73,6 @@ jobs:
- name: Sign into DigitalOcean docker registry
run: doctl registry login
- name: Prune Docker system
run: docker system prune --filter 'until=720h' -f
- name: Checkout repo
uses: actions/checkout@v4
with:
@@ -74,6 +85,9 @@ jobs:
- name: Publish docker image
run: docker push registry.digitalocean.com/zed/collab:${GITHUB_SHA}
- name: Prune Docker system
run: docker system prune --filter 'until=72h' -f
deploy:
name: Deploy new server image
needs:
@@ -86,22 +100,32 @@ jobs:
- name: Sign into Kubernetes
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ secrets.CLUSTER_NAME }}
- name: Determine namespace
- name: Start rollout
run: |
set -eu
if [[ $GITHUB_REF_NAME = "collab-production" ]]; then
echo "Deploying collab:$GITHUB_SHA to production"
echo "KUBE_NAMESPACE=production" >> $GITHUB_ENV
export ZED_KUBE_NAMESPACE=production
elif [[ $GITHUB_REF_NAME = "collab-staging" ]]; then
echo "Deploying collab:$GITHUB_SHA to staging"
echo "KUBE_NAMESPACE=staging" >> $GITHUB_ENV
export ZED_KUBE_NAMESPACE=staging
else
echo "cowardly refusing to deploy from an unknown branch"
exit 1
fi
- name: Start rollout
run: kubectl -n "$KUBE_NAMESPACE" set image deployment/collab collab=registry.digitalocean.com/zed/collab:${GITHUB_SHA}
echo "Deploying collab:$GITHUB_SHA to $ZED_KUBE_NAMESPACE"
- name: Wait for rollout to finish
run: kubectl -n "$KUBE_NAMESPACE" rollout status deployment/collab
source script/lib/deploy-helpers.sh
export_vars_for_environment $ZED_KUBE_NAMESPACE
export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header)
export ZED_IMAGE_ID="registry.digitalocean.com/zed/collab:${GITHUB_SHA}"
export ZED_SERVICE_NAME=collab
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
kubectl -n "$ZED_KUBE_NAMESPACE" rollout status deployment/$ZED_SERVICE_NAME --watch
echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"
export ZED_SERVICE_NAME=api
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
kubectl -n "$ZED_KUBE_NAMESPACE" rollout status deployment/$ZED_SERVICE_NAME --watch
echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"

View File

@@ -23,7 +23,7 @@ jobs:
- randomized-tests
steps:
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "18"

View File

@@ -1,92 +1,98 @@
name: Release Nightly
on:
schedule:
# Fire every day at 7:00am UTC (Roughly before EU workday and after US workday)
- cron: "0 7 * * *"
push:
tags:
- "nightly"
schedule:
# Fire every day at 7:00am UTC (Roughly before EU workday and after US workday)
- cron: "0 7 * * *"
push:
tags:
- "nightly"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
style:
name: Check formatting and Clippy lints
runs-on:
- self-hosted
- test
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
fetch-depth: 0
style:
name: Check formatting and Clippy lints
if: github.repository_owner == 'zed-industries'
runs-on:
- self-hosted
- test
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
fetch-depth: 0
- name: Run style checks
uses: ./.github/actions/check_style
- name: Run style checks
uses: ./.github/actions/check_style
tests:
name: Run tests
runs-on:
- self-hosted
- test
needs: style
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- name: Run clippy
shell: bash -euxo pipefail {0}
run: script/clippy
tests:
name: Run tests
if: github.repository_owner == 'zed-industries'
runs-on:
- self-hosted
- test
needs: style
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- name: Run tests
uses: ./.github/actions/run_tests
- name: Run tests
uses: ./.github/actions/run_tests
bundle:
name: Bundle app
runs-on:
- self-hosted
- bundle
needs: tests
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
steps:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18"
bundle:
name: Bundle app
if: github.repository_owner == 'zed-industries'
runs-on:
- self-hosted
- bundle
needs: tests
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
steps:
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
submodules: "recursive"
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100
- name: Set release channel to nightly
run: |
set -eu
version=$(git rev-parse --short HEAD)
echo "Publishing version: ${version} on release channel nightly"
echo "nightly" > crates/zed/RELEASE_CHANNEL
- name: Set release channel to nightly
run: |
set -eu
version=$(git rev-parse --short HEAD)
echo "Publishing version: ${version} on release channel nightly"
echo "nightly" > crates/zed/RELEASE_CHANNEL
- name: Generate license file
run: script/generate-licenses
- name: Generate license file
run: script/generate-licenses
- name: Create app bundle
run: script/bundle
- name: Create app bundle
run: script/bundle
- name: Upload Zed Nightly
run: script/upload-nightly
- name: Upload Zed Nightly
run: script/upload-nightly

View File

@@ -1,17 +1,18 @@
on:
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:
jobs:
update_top_ranking_issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10.5"
architecture: "x64"
cache: "pip"
- run: pip install -r script/update_top_ranking_issues/requirements.txt
- run: python script/update_top_ranking_issues/main.py 5393 --github-token ${{ secrets.GITHUB_TOKEN }} --prod
update_top_ranking_issues:
runs-on: ubuntu-latest
if: github.repository_owner == 'zed-industries'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10.5"
architecture: "x64"
cache: "pip"
- run: pip install -r script/update_top_ranking_issues/requirements.txt
- run: python script/update_top_ranking_issues/main.py 5393 --github-token ${{ secrets.GITHUB_TOKEN }} --prod

View File

@@ -1,17 +1,18 @@
on:
schedule:
- cron: "0 15 * * *"
workflow_dispatch:
schedule:
- cron: "0 15 * * *"
workflow_dispatch:
jobs:
update_top_ranking_issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10.5"
architecture: "x64"
cache: "pip"
- run: pip install -r script/update_top_ranking_issues/requirements.txt
- run: python script/update_top_ranking_issues/main.py 6952 --github-token ${{ secrets.GITHUB_TOKEN }} --prod --query-day-interval 7
update_top_ranking_issues:
runs-on: ubuntu-latest
if: github.repository_owner == 'zed-industries'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10.5"
architecture: "x64"
cache: "pip"
- run: pip install -r script/update_top_ranking_issues/requirements.txt
- run: python script/update_top_ranking_issues/main.py 6952 --github-token ${{ secrets.GITHUB_TOKEN }} --prod --query-day-interval 7

5
.gitignore vendored
View File

@@ -5,12 +5,8 @@
.DS_Store
/plugins/bin
/script/node_modules
/styles/node_modules
/styles/src/types/zed.ts
/crates/theme/schemas/theme.json
/crates/collab/static/styles.css
/crates/collab/.admins.json
/vendor/bin
/assets/*licenses.md
**/venv
.build
@@ -25,3 +21,4 @@ DerivedData/
**/*.db
.pytest_cache
.venv
.blob_store

View File

@@ -11,8 +11,12 @@
Antonio Scandurra <me@as-cii.com>
Antonio Scandurra <me@as-cii.com> <antonio@zed.dev>
Christian Bergschneider <christian.bergschneider@gmx.de>
Christian Bergschneider <christian.bergschneider@gmx.de> <magiclake@gmx.de>
Conrad Irwin <conrad@zed.dev>
Conrad Irwin <conrad@zed.dev> <conrad.irwin@gmail.com>
Greg Morenz <greg-morenz@droid.cafe>
Greg Morenz <greg-morenz@droid.cafe> <morenzg@gmail.com>
Joseph T. Lyons <JosephTLyons@gmail.com>
Joseph T. Lyons <JosephTLyons@gmail.com> <JosephTLyons@users.noreply.github.com>
Julia <floc@unpromptedtirade.com>
@@ -39,6 +43,8 @@ Nathan Sobo <nathan@zed.dev> <nathan@warp.dev>
Nathan Sobo <nathan@zed.dev> <nathansobo@gmail.com>
Piotr Osiewicz <piotr@zed.dev>
Piotr Osiewicz <piotr@zed.dev> <24362066+osiewicz@users.noreply.github.com>
Robert Clover <git@clo4.net>
Robert Clover <git@clo4.net> <robert@clover.gdn>
Thorsten Ball <thorsten@zed.dev>
Thorsten Ball <thorsten@zed.dev> <me@thorstenball.com>
Thorsten Ball <thorsten@zed.dev> <mrnugget@gmail.com>

View File

@@ -1,6 +1,16 @@
{
"JSON": {
"tab_size": 4
"languages": {
"Markdown": {
"tab_size": 2,
"formatter": "prettier"
},
"TOML": {
"formatter": "prettier",
"format_on_save": "off"
},
"YAML": {
"formatter": "prettier"
}
},
"formatter": "auto"
}

3012
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,11 +16,14 @@ members = [
"crates/collab_ui",
"crates/collections",
"crates/command_palette",
"crates/command_palette_hooks",
"crates/copilot",
"crates/copilot_ui",
"crates/db",
"crates/diagnostics",
"crates/editor",
"crates/extension",
"crates/extensions_ui",
"crates/feature_flags",
"crates/feedback",
"crates/file_finder",
@@ -30,15 +33,13 @@ members = [
"crates/git",
"crates/go_to_line",
"crates/gpui",
"crates/gpui",
"crates/gpui_macros",
"crates/gpui_macros",
"crates/install_cli",
"crates/journal",
"crates/journal",
"crates/language",
"crates/language_selector",
"crates/language_tools",
"crates/languages",
"crates/live_kit_client",
"crates/live_kit_server",
"crates/lsp",
@@ -50,10 +51,9 @@ members = [
"crates/notifications",
"crates/outline",
"crates/picker",
"crates/plugin",
"crates/plugin_macros",
"crates/prettier",
"crates/project",
"crates/project_core",
"crates/project_panel",
"crates/project_symbols",
"crates/quick_action_bar",
@@ -64,6 +64,8 @@ members = [
"crates/rich_text",
"crates/rope",
"crates/rpc",
"crates/task",
"crates/tasks_ui",
"crates/search",
"crates/semantic_index",
"crates/settings",
@@ -79,6 +81,8 @@ members = [
"crates/theme",
"crates/theme_importer",
"crates/theme_selector",
"crates/telemetry_events",
"crates/time_format",
"crates/ui",
"crates/util",
"crates/vcs_menu",
@@ -92,44 +96,146 @@ default-members = ["crates/zed"]
resolver = "2"
[workspace.dependencies]
activity_indicator = { path = "crates/activity_indicator" }
ai = { path = "crates/ai" }
assets = { path = "crates/assets" }
assistant = { path = "crates/assistant" }
audio = { path = "crates/audio" }
auto_update = { path = "crates/auto_update" }
breadcrumbs = { path = "crates/breadcrumbs" }
call = { path = "crates/call" }
channel = { path = "crates/channel" }
cli = { path = "crates/cli" }
client = { path = "crates/client" }
clock = { path = "crates/clock" }
collab = { path = "crates/collab" }
collab_ui = { path = "crates/collab_ui" }
collections = { path = "crates/collections" }
color = { path = "crates/color" }
command_palette = { path = "crates/command_palette" }
command_palette_hooks = { path = "crates/command_palette_hooks" }
copilot = { path = "crates/copilot" }
copilot_ui = { path = "crates/copilot_ui" }
db = { path = "crates/db" }
diagnostics = { path = "crates/diagnostics" }
editor = { path = "crates/editor" }
extension = { path = "crates/extension" }
extensions_ui = { path = "crates/extensions_ui" }
feature_flags = { path = "crates/feature_flags" }
feedback = { path = "crates/feedback" }
file_finder = { path = "crates/file_finder" }
fs = { path = "crates/fs" }
fsevent = { path = "crates/fsevent" }
fuzzy = { path = "crates/fuzzy" }
git = { path = "crates/git" }
go_to_line = { path = "crates/go_to_line" }
gpui = { path = "crates/gpui" }
gpui_macros = { path = "crates/gpui_macros" }
install_cli = { path = "crates/install_cli" }
journal = { path = "crates/journal" }
language = { path = "crates/language" }
language_selector = { path = "crates/language_selector" }
language_tools = { path = "crates/language_tools" }
languages = { path = "crates/languages" }
live_kit_client = { path = "crates/live_kit_client" }
live_kit_server = { path = "crates/live_kit_server" }
lsp = { path = "crates/lsp" }
markdown_preview = { path = "crates/markdown_preview" }
media = { path = "crates/media" }
menu = { path = "crates/menu" }
multi_buffer = { path = "crates/multi_buffer" }
node_runtime = { path = "crates/node_runtime" }
notifications = { path = "crates/notifications" }
outline = { path = "crates/outline" }
picker = { path = "crates/picker" }
plugin = { path = "crates/plugin" }
plugin_macros = { path = "crates/plugin_macros" }
prettier = { path = "crates/prettier" }
project = { path = "crates/project" }
project_core = { path = "crates/project_core" }
project_panel = { path = "crates/project_panel" }
project_symbols = { path = "crates/project_symbols" }
quick_action_bar = { path = "crates/quick_action_bar" }
recent_projects = { path = "crates/recent_projects" }
release_channel = { path = "crates/release_channel" }
rich_text = { path = "crates/rich_text" }
rope = { path = "crates/rope" }
rpc = { path = "crates/rpc" }
task = { path = "crates/task" }
tasks_ui = { path = "crates/tasks_ui" }
search = { path = "crates/search" }
semantic_index = { path = "crates/semantic_index" }
settings = { path = "crates/settings" }
snippet = { path = "crates/snippet" }
sqlez = { path = "crates/sqlez" }
sqlez_macros = { path = "crates/sqlez_macros" }
story = { path = "crates/story" }
storybook = { path = "crates/storybook" }
sum_tree = { path = "crates/sum_tree" }
terminal = { path = "crates/terminal" }
terminal_view = { path = "crates/terminal_view" }
text = { path = "crates/text" }
theme = { path = "crates/theme" }
theme_importer = { path = "crates/theme_importer" }
theme_selector = { path = "crates/theme_selector" }
telemetry_events = { path = "crates/telemetry_events" }
time_format = { path = "crates/time_format" }
ui = { path = "crates/ui" }
util = { path = "crates/util" }
vcs_menu = { path = "crates/vcs_menu" }
vim = { path = "crates/vim" }
welcome = { path = "crates/welcome" }
workspace = { path = "crates/workspace" }
zed = { path = "crates/zed" }
zed_actions = { path = "crates/zed_actions" }
anyhow = "1.0.57"
async-compression = { version = "0.4", features = ["gzip", "futures-io"] }
async-tar = "0.4.2"
async-trait = "0.1"
blade-graphics = { git = "https://github.com/kvark/blade", rev = "e9d93a4d41f3946a03ffb76136290d6ccf7f2b80" }
blade-macros = { git = "https://github.com/kvark/blade", rev = "e9d93a4d41f3946a03ffb76136290d6ccf7f2b80" }
blade-rwh = { package = "raw-window-handle", version = "0.5" }
chrono = { version = "0.4", features = ["serde"] }
clickhouse = { version = "0.11.6" }
ctor = "0.2.6"
core-foundation = { version = "0.9.3" }
core-foundation-sys = "0.8.6"
derive_more = "0.99.17"
env_logger = "0.9"
futures = "0.3"
git2 = { version = "0.15", default-features = false }
globset = "0.4"
hex = "0.4.3"
ignore = "0.4.22"
indoc = "1"
# We explicitly disable a http2 support in isahc.
isahc = { version = "1.7.2", default-features = false, features = [
"static-curl",
"text-decoding",
] }
# We explicitly disable http2 support in isahc.
isahc = { version = "1.7.2", default-features = false, features = ["static-curl", "text-decoding"] }
itertools = "0.11.0"
lazy_static = "1.4.0"
linkify = "0.10.0"
log = { version = "0.4.16", features = ["kv_unstable_serde"] }
ordered-float = "2.1.1"
parking_lot = "0.11.1"
profiling = "1"
postage = { version = "0.5", features = ["futures-traits"] }
pretty_assertions = "1.3.0"
prost = "0.8"
pulldown-cmark = { version = "0.9.2", default-features = false }
pulldown-cmark = { version = "0.10.0", default-features = false }
rand = "0.8.5"
refineable = { path = "./crates/refineable" }
regex = "1.5"
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
rust-embed = { version = "8.0", features = ["include-exclude"] }
schemars = "0.8"
semver = "1.0"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_derive = { version = "1.0", features = ["deserialize_in_place"] }
serde_json = { version = "1.0", features = ["preserve_order", "raw_value"] }
serde_json_lenient = { version = "0.1", features = [
"preserve_order",
"raw_value",
] }
serde_json_lenient = { version = "0.1", features = ["preserve_order", "raw_value"] }
serde_repr = "0.1"
sha2 = "0.10"
shellexpand = "2.1.0"
smallvec = { version = "1.6", features = ["union"] }
smol = "1.2"
strum = { version = "0.25.0", features = ["derive"] }
@@ -137,14 +243,19 @@ sysinfo = "0.29.10"
tempfile = "3.9.0"
thiserror = "1.0.29"
tiktoken-rs = "0.5.7"
time = { version = "0.3", features = ["serde", "serde-well-known"] }
toml = "0.5"
time = { version = "0.3", features = ["serde", "serde-well-known", "formatting"] }
toml = "0.8"
tower-http = "0.4.4"
tree-sitter = { version = "0.20", features = ["wasm"] }
tree-sitter-astro = { git = "https://github.com/virchau13/tree-sitter-astro.git", rev = "e924787e12e8a03194f36a113290ac11d6dc10f3" }
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "7331995b19b8f8aba2d5e26deb51d2195c18bc94" }
tree-sitter-c = "0.20.1"
tree-sitter-clojure = { git = "https://github.com/prcastro/tree-sitter-clojure", branch = "update-ts" }
tree-sitter-c-sharp = { git = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "dd5e59721a5f8dae34604060833902b882023aaf" }
tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "f44509141e7e483323d2ec178f2d2e6c0fc041c1" }
tree-sitter-css = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" }
tree-sitter-dockerfile = { git = "https://github.com/camdencheek/tree-sitter-dockerfile", rev = "33e22c33bcdbfc33d42806ee84cfd0b1248cc392" }
tree-sitter-dart = { git = "https://github.com/agent3bood/tree-sitter-dart", rev = "48934e3bf757a9b78f17bdfaa3e2b4284656fdc7" }
tree-sitter-elixir = { git = "https://github.com/elixir-lang/tree-sitter-elixir", rev = "a2861e88a730287a60c11ea9299c033c7d076e30" }
tree-sitter-elm = { git = "https://github.com/elm-tooling/tree-sitter-elm", rev = "692c50c0b961364c40299e73c1306aecb5d20f40" }
tree-sitter-embedded-template = "0.20.0"
@@ -155,47 +266,62 @@ tree-sitter-glsl = { git = "https://github.com/theHamsta/tree-sitter-glsl", rev
tree-sitter-go = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "aeb2f33b366fd78d5789ff104956ce23508b85db" }
tree-sitter-gomod = { git = "https://github.com/camdencheek/tree-sitter-go-mod" }
tree-sitter-gowork = { git = "https://github.com/d1y/tree-sitter-go-work" }
tree-sitter-haskell = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "cf98de23e4285b8e6bcb57b050ef2326e2cc284b" }
tree-sitter-haskell = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "8a99848fc734f9c4ea523b3f2a07df133cbbcec2" }
tree-sitter-hcl = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "v1.1.0" }
tree-sitter-heex = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "2e1348c3cf2c9323e87c2744796cf3f3868aa82a" }
tree-sitter-html = "0.19.0"
tree-sitter-json = { git = "https://github.com/tree-sitter/tree-sitter-json", rev = "40a81c01a40ac48744e0c8ccabbaba1920441199" }
tree-sitter-lua = "0.0.14"
tree-sitter-markdown = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "330ecab87a3e3a7211ac69bbadc19eabecdb1cca" }
tree-sitter-nix = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "66e3e9ce9180ae08fc57372061006ef83f0abde7" }
tree-sitter-nu = { git = "https://github.com/nushell/tree-sitter-nu", rev = "26bbaecda0039df4067861ab38ea8ea169f7f5aa" }
tree-sitter-nu = { git = "https://github.com/nushell/tree-sitter-nu", rev = "7dd29f9616822e5fc259f5b4ae6c4ded9a71a132" }
tree-sitter-ocaml = { git = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "4abfdc1c7af2c6c77a370aee974627be1c285b3b" }
tree-sitter-php = "0.21.1"
tree-sitter-prisma-io = { git = "https://github.com/victorhqc/tree-sitter-prisma" }
tree-sitter-proto = { git = "https://github.com/rewinfrey/tree-sitter-proto", rev = "36d54f288aee112f13a67b550ad32634d0c2cb52" }
tree-sitter-purescript = { git = "https://github.com/ivanmoreau/tree-sitter-purescript", rev = "a37140f0c7034977b90faa73c94fcb8a5e45ed08" }
tree-sitter-purescript = { git = "https://github.com/postsolar/tree-sitter-purescript", rev = "v0.1.0" }
tree-sitter-python = "0.20.2"
tree-sitter-racket = { git = "https://github.com/zed-industries/tree-sitter-racket", rev = "eb010cf2c674c6fd9a6316a84e28ef90190fe51a" }
tree-sitter-ruby = "0.20.0"
tree-sitter-rust = "0.20.3"
tree-sitter-scheme = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "af0fd1fa452cb2562dc7b5c8a8c55551c39273b9" }
tree-sitter-svelte = { git = "https://github.com/Himujjal/tree-sitter-svelte", rev = "697bb515471871e85ff799ea57a76298a71a9cca" }
tree-sitter-svelte = { git = "https://github.com/Himujjal/tree-sitter-svelte", rev = "bd60db7d3d06f89b6ec3b287c9a6e9190b5564bd" }
tree-sitter-toml = { git = "https://github.com/tree-sitter/tree-sitter-toml", rev = "342d9be207c2dba869b9967124c679b5e6fd0ebe" }
tree-sitter-typescript = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "5d20856f34315b068c41edaee2ac8a100081d259" }
tree-sitter-uiua = { git = "https://github.com/shnarazk/tree-sitter-uiua", rev = "9260f11be5900beda4ee6d1a24ab8ddfaf5a19b2" }
tree-sitter-uiua = { git = "https://github.com/shnarazk/tree-sitter-uiua", rev = "21dc2db39494585bf29a3f86d5add6e9d11a22ba" }
tree-sitter-vue = { git = "https://github.com/zed-industries/tree-sitter-vue", rev = "6608d9d60c386f19d80af7d8132322fa11199c42" }
tree-sitter-yaml = { git = "https://github.com/zed-industries/tree-sitter-yaml", rev = "f545a41f57502e1b5ddf2a6668896c1b0620f930" }
tree-sitter-zig = { git = "https://github.com/maxxnino/tree-sitter-zig", rev = "0d08703e4c3f426ec61695d7617415fff97029bd" }
unindent = "0.1.7"
url = "2.2"
uuid = { version = "1.1.2", features = ["v4"] }
wasmtime = "16"
wasmtime = "18.0"
which = "6.0.0"
sys-locale = "0.3.1"
[patch.crates-io]
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "1d8975319c2d5de1bf710e7e21db25b0eee4bc66" }
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "v16.0.0" }
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "e4a23971ec3071a09c1e84816954c98f96e98e52" }
# Workaround for a broken nightly build of gpui: See #7644 and revisit once 0.5.3 is released.
pathfinder_simd = { git = "https://github.com/servo/pathfinder.git", rev = "e4fcda0d5259d0acf902aee6de7d2501f2bd6629" }
[profile.dev]
split-debuginfo = "unpacked"
debug = "limited"
[profile.dev.package.taffy]
opt-level = 3
# todo!(linux) - Remove this
[profile.dev.package.blade-graphics]
split-debuginfo = "off"
debug = "full"
[profile.dev.package]
taffy = { opt-level = 3 }
cranelift-codegen = { opt-level = 3 }
wasmtime-cranelift = { opt-level = 3 }
[profile.release]
debug = "limited"
lto = "thin"
codegen-units = 1
[workspace.metadata.cargo-machete]
ignored = ["bindgen", "cbindgen", "prost_build", "serde"]

View File

@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.2
FROM rust:1.75-bullseye as builder
FROM rust:1.76-bullseye as builder
WORKDIR app
COPY . .
@@ -11,6 +11,7 @@ ARG GITHUB_SHA
ENV GITHUB_SHA=$GITHUB_SHA
RUN --mount=type=cache,target=./script/node_modules \
--mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=./target \
cargo build --release --package collab --bin collab

View File

@@ -1,2 +1,3 @@
collab: cd crates/collab && RUST_LOG=${RUST_LOG:-warn,collab=info} cargo run serve
collab: RUST_LOG=${RUST_LOG:-warn,tower_http=info,collab=info} cargo run --package=collab serve
livekit: livekit-server --dev
blob_store: MINIO_ROOT_USER=the-blob-store-access-key MINIO_ROOT_PASSWORD=the-blob-store-secret-key minio server .blob_store

View File

@@ -21,7 +21,8 @@ brew install zed
## Developing Zed
- [Building Zed](./docs/src/developing_zed__building_zed.md)
- [Building Zed for macOS](./docs/src/developing_zed__building_zed_macos.md)
- [Building Zed for Linux](./docs/src/developing_zed__building_zed_linux.md)
- [Running Collaboration Locally](./docs/src/developing_zed__local_collaboration.md)
## Contributing

View File

@@ -0,0 +1,4 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.32668 11.5331C4.78215 10.9852 4.62318 9.834 4.85006 9C5.24343 9.52582 5.78848 9.69239 6.35304 9.78642C7.2246 9.93151 8.08055 9.87724 8.89019 9.43877C8.98281 9.38857 9.06841 9.32182 9.16962 9.25421C9.24559 9.49681 9.26536 9.74172 9.23882 9.99099C9.1743 10.5981 8.89982 11.067 8.46326 11.4225C8.28869 11.5647 8.10397 11.6918 7.92367 11.8259C7.36978 12.2379 7.21992 12.7211 7.42805 13.4239C7.433 13.4411 7.43742 13.4582 7.44861 13.5C7.1658 13.3606 6.95923 13.1578 6.80182 12.8911C6.63558 12.6097 6.55649 12.2983 6.55233 11.9614C6.55025 11.7974 6.55025 11.632 6.53022 11.4704C6.4813 11.0763 6.31323 10.8999 5.99661 10.8897C5.67166 10.8793 5.41462 11.1004 5.34646 11.4486C5.34125 11.4753 5.33371 11.5017 5.32616 11.5328L5.32668 11.5331Z" fill="#17191E" fill-opacity="0.6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.30826 8.62679L6.73279 4.5906C6.82176 4.33854 7.17823 4.33854 7.26719 4.5906L8.69173 8.62679C8.69652 8.64035 8.70626 8.65153 8.7189 8.65814C8.80645 8.6531 8.89466 8.65055 8.98347 8.65055C10.1418 8.65055 11.1986 9.08493 12 9.79967L8.83801 1.36772C8.75507 1.14653 8.54362 1 8.30739 1H5.6926C5.45637 1 5.24492 1.14653 5.16198 1.36772L1.99999 9.79968C2.80137 9.08493 3.85822 8.65055 5.01652 8.65055C5.10533 8.65055 5.19355 8.6531 5.28109 8.65814C5.29373 8.65153 5.30347 8.64035 5.30826 8.62679Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,3 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px" viewBox="0 0 14 14" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 9.203125 3.410156 C 8.792969 3 8.378906 2.597656 7.957031 2.207031 C 7.835938 2.078125 7.664062 1.996094 7.476562 1.996094 C 7.472656 1.996094 7.472656 1.996094 7.46875 1.996094 C 7.324219 2.011719 7.1875 2.042969 7.0625 2.089844 L 7.074219 2.085938 L 4.425781 3.40625 Z M 3.71875 3.71875 L 3.71875 9.078125 C 3.714844 9.109375 3.710938 9.144531 3.710938 9.179688 C 3.710938 9.40625 3.800781 9.613281 3.945312 9.765625 L 6.183594 12.003906 L 10.066406 12.003906 L 10.066406 10.066406 Z M 3.40625 3.40625 C 3.40625 3.40625 5.707031 2.257812 6.855469 1.683594 C 7.039062 1.59375 7.25 1.539062 7.476562 1.539062 C 7.496094 1.539062 7.515625 1.539062 7.53125 1.539062 C 7.824219 1.597656 8.082031 1.722656 8.296875 1.902344 L 8.292969 1.898438 L 12.460938 6.066406 L 12.460938 10.519531 L 10.519531 10.519531 L 10.519531 12.460938 L 5.996094 12.460938 L 1.898438 8.367188 C 1.683594 8.140625 1.546875 7.839844 1.542969 7.503906 C 1.558594 7.316406 1.609375 7.148438 1.6875 6.992188 L 1.683594 7 Z M 3.40625 3.40625 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,9 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.7295 12.1981L7.17677 7.64544C7.07914 7.5478 6.92085 7.5478 6.82322 7.64544L2.27053 12.1981C2.11304 12.3556 2.22458 12.6249 2.4473 12.6249H11.5527C11.7754 12.6249 11.887 12.3556 11.7295 12.1981Z" fill="black" fill-opacity="0.9"/>
<path d="M1.80178 11.7294L6.35447 7.17668C6.4521 7.07905 6.4521 6.92076 6.35447 6.82312L1.80178 2.27043C1.64429 2.11294 1.375 2.22448 1.375 2.44721L1.375 11.5526C1.375 11.7753 1.64428 11.8869 1.80178 11.7294Z" fill="black" fill-opacity="0.9"/>
<path d="M9.98928 9.16694L11.9794 7.17751C12.0771 7.0799 12.0771 6.92161 11.9795 6.82396L9.98928 4.833C9.89165 4.73534 9.73333 4.73532 9.63569 4.83297L7.64553 6.82313C7.5479 6.92076 7.5479 7.07905 7.64553 7.17668L9.63575 9.16691C9.73337 9.26453 9.89164 9.26455 9.98928 9.16694Z" fill="black" fill-opacity="0.9"/>
<path d="M7.89553 1.80168L12.1982 6.10438C12.3557 6.26187 12.625 6.15033 12.625 5.9276V2.37491C12.625 1.82262 12.1773 1.37491 11.625 1.37491H8.0723C7.84958 1.37491 7.73804 1.64419 7.89553 1.80168Z" fill="black" fill-opacity="0.6"/>
<path d="M8.73976 4.18772L5.25981 4.1895C5.03708 4.18962 4.92567 4.45896 5.08325 4.61637L6.82322 6.35456C6.92087 6.45211 7.07909 6.45207 7.17669 6.35447L8.91666 4.61449C9.0742 4.45696 8.96255 4.1876 8.73976 4.18772Z" fill="black" fill-opacity="0.6"/>
<path d="M8.1147 3.55936L4.13431 3.55936C4.06801 3.55936 4.00442 3.53302 3.95753 3.48614L2.27057 1.79918C2.11308 1.64169 2.22462 1.37241 2.44735 1.37241L6.42774 1.37241C6.49405 1.37241 6.55763 1.39874 6.60452 1.44563L8.29148 3.13258C8.44897 3.29007 8.33743 3.55936 8.1147 3.55936Z" fill="black" fill-opacity="0.6"/>
<path d="M12.625 8.07221V11.5526C12.625 11.7753 12.3557 11.8869 12.1982 11.7294L10.458 9.98918C10.3604 9.89155 10.3604 9.73326 10.458 9.63563L12.1982 7.89544C12.3557 7.73794 12.625 7.84949 12.625 8.07221Z" fill="black" fill-opacity="0.6"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,233 +1,307 @@
{
"suffixes": {
"Emakefile": "erlang",
"aac": "audio",
"accdb": "storage",
"app.src": "erlang",
"avif": "image",
"bak": "backup",
"bash": "terminal",
"bash_aliases": "terminal",
"bash_logout": "terminal",
"bash_profile": "terminal",
"bashrc": "terminal",
"bmp": "image",
"c": "code",
"cc": "code",
"conf": "settings",
"cpp": "code",
"css": "css",
"csv": "storage",
"dat": "storage",
"db": "storage",
"dbf": "storage",
"dll": "storage",
"doc": "document",
"docx": "document",
"eex": "elixir",
"erl": "erlang",
"escript": "erlang",
"eslintrc": "eslint",
"eslintrc.js": "eslint",
"eslintrc.json": "eslint",
"ex": "elixir",
"exs": "elixir",
"fish": "terminal",
"flac": "audio",
"fmp": "storage",
"fp7": "storage",
"frm": "storage",
"gdb": "storage",
"gif": "image",
"gitattributes": "vcs",
"gitignore": "vcs",
"gitkeep": "vcs",
"gitmodules": "vcs",
"go": "go",
"h": "code",
"handlebars": "code",
"hbs": "template",
"heex": "elixir",
"heif": "image",
"hrl": "erlang",
"hs": "haskell",
"htm": "template",
"html": "template",
"ib": "storage",
"ico": "image",
"ini": "settings",
"java": "code",
"jpeg": "image",
"jpg": "image",
"js": "code",
"json": "storage",
"jsonc": "storage",
"ldf": "storage",
"lock": "lock",
"log": "log",
"md": "document",
"mdb": "storage",
"mdf": "storage",
"mdx": "document",
"ml": "ocaml",
"mli": "ocaml",
"mp3": "audio",
"mp4": "video",
"myd": "storage",
"myi": "storage",
"odp": "document",
"ods": "document",
"odt": "document",
"ogg": "video",
"pdb": "storage",
"pdf": "document",
"php": "php",
"png": "image",
"ppt": "document",
"pptx": "document",
"prettierignore": "prettier",
"prettierrc": "prettier",
"profile": "terminal",
"ps1": "terminal",
"psd": "image",
"py": "python",
"rb": "ruby",
"rebar.config": "erlang",
"rkt": "code",
"rs": "rust",
"rtf": "document",
"sav": "storage",
"scm": "code",
"sdf": "storage",
"sh": "terminal",
"sqlite": "storage",
"svelte": "template",
"svg": "image",
"swift": "code",
"tiff": "image",
"toml": "toml",
"ts": "typescript",
"tsv": "storage",
"tsx": "code",
"txt": "document",
"vue": "vue",
"wav": "audio",
"webm": "video",
"webp": "image",
"xls": "document",
"xlsx": "document",
"xml": "template",
"xrl": "erlang",
"yaml": "settings",
"yml": "settings",
"yrl": "erlang",
"zlogin": "terminal",
"zsh": "terminal",
"zsh_aliases": "terminal",
"zsh_histfile": "terminal",
"zsh_profile": "terminal",
"zshenv": "terminal",
"zshrc": "terminal"
"suffixes": {
"astro": "astro",
"Emakefile": "erlang",
"aac": "audio",
"accdb": "storage",
"app.src": "erlang",
"avi": "video",
"avif": "image",
"bak": "backup",
"bash": "terminal",
"bash_aliases": "terminal",
"bash_logout": "terminal",
"bash_profile": "terminal",
"bashrc": "terminal",
"bmp": "image",
"c": "code",
"cc": "code",
"cjs": "code",
"conf": "settings",
"cpp": "code",
"css": "css",
"csv": "storage",
"cts": "typescript",
"dart": "dart",
"dat": "storage",
"db": "storage",
"dbf": "storage",
"dll": "storage",
"doc": "document",
"docx": "document",
"eex": "elixir",
"elm": "elm",
"erl": "erlang",
"escript": "erlang",
"eslintrc": "eslint",
"eslintrc.js": "eslint",
"eslintrc.json": "eslint",
"ex": "elixir",
"exs": "elixir",
"fish": "terminal",
"flac": "audio",
"fmp": "storage",
"fp7": "storage",
"frm": "storage",
"gdb": "storage",
"gif": "image",
"gitattributes": "vcs",
"gitignore": "vcs",
"gitkeep": "vcs",
"gitmodules": "vcs",
"go": "go",
"graphql": "graphql",
"h": "code",
"handlebars": "code",
"hbs": "template",
"heex": "elixir",
"heif": "image",
"heic": "image",
"hrl": "erlang",
"hs": "haskell",
"htm": "template",
"html": "template",
"ib": "storage",
"ico": "image",
"ini": "settings",
"j2k": "image",
"java": "java",
"jfif": "image",
"jp2": "image",
"jpeg": "image",
"jpg": "image",
"js": "code",
"json": "storage",
"jsonc": "storage",
"jxl": "image",
"kt": "kotlin",
"ldf": "storage",
"lock": "lock",
"lockb": "bun",
"log": "log",
"lua": "lua",
"m4a": "audio",
"m4v": "video",
"md": "document",
"mdb": "storage",
"mdf": "storage",
"mdx": "document",
"mkv": "video",
"mjs": "code",
"mka": "audio",
"ml": "ocaml",
"mli": "ocaml",
"mov": "video",
"mp3": "audio",
"mp4": "video",
"mts": "typescript",
"myd": "storage",
"myi": "storage",
"nu": "terminal",
"odp": "document",
"ods": "document",
"odt": "document",
"ogg": "audio",
"opus": "audio",
"otf": "font",
"pdb": "storage",
"pdf": "document",
"php": "php",
"plist": "template",
"png": "image",
"ppt": "document",
"pptx": "document",
"prettierignore": "prettier",
"prettierrc": "prettier",
"prisma": "prisma",
"profile": "terminal",
"ps1": "terminal",
"psd": "image",
"py": "python",
"qoi": "image",
"rb": "ruby",
"rebar.config": "erlang",
"rkt": "code",
"rs": "rust",
"r": "r",
"rtf": "document",
"sav": "storage",
"scm": "code",
"sdf": "storage",
"sh": "terminal",
"sqlite": "storage",
"svelte": "template",
"svg": "image",
"swift": "swift",
"tf": "terraform",
"tfvars": "terraform",
"tiff": "image",
"toml": "toml",
"ts": "typescript",
"tsv": "storage",
"ttf": "font",
"tsx": "code",
"txt": "document",
"vue": "vue",
"wav": "audio",
"webm": "video",
"webp": "image",
"wma": "audio",
"wmv": "video",
"wv": "audio",
"xls": "document",
"xlsx": "document",
"xml": "template",
"xrl": "erlang",
"yaml": "settings",
"yml": "settings",
"yrl": "erlang",
"zlogin": "terminal",
"zsh": "terminal",
"zsh_aliases": "terminal",
"zsh_histfile": "terminal",
"zsh_profile": "terminal",
"zshenv": "terminal",
"zshrc": "terminal"
},
"types": {
"astro": {
"icon": "icons/file_icons/astro.svg"
},
"types": {
"audio": {
"icon": "icons/file_icons/audio.svg"
},
"code": {
"icon": "icons/file_icons/code.svg"
},
"collapsed_chevron": {
"icon": "icons/file_icons/chevron_right.svg"
},
"collapsed_folder": {
"icon": "icons/file_icons/folder.svg"
},
"css": {
"icon": "icons/file_icons/css.svg"
},
"default": {
"icon": "icons/file_icons/file.svg"
},
"document": {
"icon": "icons/file_icons/book.svg"
},
"elixir": {
"icon": "icons/file_icons/elixir.svg"
},
"erlang": {
"icon": "icons/file_icons/erlang.svg"
},
"eslint": {
"icon": "icons/file_icons/eslint.svg"
},
"expanded_chevron": {
"icon": "icons/file_icons/chevron_down.svg"
},
"expanded_folder": {
"icon": "icons/file_icons/folder_open.svg"
},
"haskell": {
"icon": "icons/file_icons/haskell.svg"
},
"go": {
"icon": "icons/file_icons/go.svg"
},
"image": {
"icon": "icons/file_icons/image.svg"
},
"lock": {
"icon": "icons/file_icons/lock.svg"
},
"log": {
"icon": "icons/file_icons/info.svg"
},
"ocaml": {
"icon": "icons/file_icons/ocaml.svg"
},
"phoenix": {
"icon": "icons/file_icons/phoenix.svg"
},
"php": {
"icon": "icons/file_icons/php.svg"
},
"prettier": {
"icon": "icons/file_icons/prettier.svg"
},
"python": {
"icon": "icons/file_icons/python.svg"
},
"ruby": {
"icon": "icons/file_icons/ruby.svg"
},
"rust": {
"icon": "icons/file_icons/rust.svg"
},
"settings": {
"icon": "icons/file_icons/settings.svg"
},
"storage": {
"icon": "icons/file_icons/database.svg"
},
"template": {
"icon": "icons/file_icons/html.svg"
},
"terminal": {
"icon": "icons/file_icons/terminal.svg"
},
"toml": {
"icon": "icons/file_icons/toml.svg"
},
"typescript": {
"icon": "icons/file_icons/typescript.svg"
},
"vcs": {
"icon": "icons/file_icons/git.svg"
},
"video": {
"icon": "icons/file_icons/video.svg"
},
"vue": {
"icon": "icons/file_icons/vue.svg"
}
"audio": {
"icon": "icons/file_icons/audio.svg"
},
"code": {
"icon": "icons/file_icons/code.svg"
},
"collapsed_chevron": {
"icon": "icons/file_icons/chevron_right.svg"
},
"collapsed_folder": {
"icon": "icons/file_icons/folder.svg"
},
"css": {
"icon": "icons/file_icons/css.svg"
},
"dart": {
"icon": "icons/file_icons/dart.svg"
},
"default": {
"icon": "icons/file_icons/file.svg"
},
"document": {
"icon": "icons/file_icons/book.svg"
},
"elixir": {
"icon": "icons/file_icons/elixir.svg"
},
"elm": {
"icon": "icons/file_icons/elm.svg"
},
"erlang": {
"icon": "icons/file_icons/erlang.svg"
},
"eslint": {
"icon": "icons/file_icons/eslint.svg"
},
"expanded_chevron": {
"icon": "icons/file_icons/chevron_down.svg"
},
"expanded_folder": {
"icon": "icons/file_icons/folder_open.svg"
},
"font": {
"icon": "icons/file_icons/font.svg"
},
"haskell": {
"icon": "icons/file_icons/haskell.svg"
},
"go": {
"icon": "icons/file_icons/go.svg"
},
"graphql": {
"icon": "icons/file_icons/graphql.svg"
},
"image": {
"icon": "icons/file_icons/image.svg"
},
"java": {
"icon": "icons/file_icons/java.svg"
},
"kotlin":{
"icon": "icons/file_icons/kotlin.svg"
},
"lock": {
"icon": "icons/file_icons/lock.svg"
},
"bun": {
"icon": "icons/file_icons/bun.svg"
},
"log": {
"icon": "icons/file_icons/info.svg"
},
"lua": {
"icon": "icons/file_icons/lua.svg"
},
"ocaml": {
"icon": "icons/file_icons/ocaml.svg"
},
"phoenix": {
"icon": "icons/file_icons/phoenix.svg"
},
"php": {
"icon": "icons/file_icons/php.svg"
},
"prettier": {
"icon": "icons/file_icons/prettier.svg"
},
"prisma": {
"icon": "icons/file_icons/prisma.svg"
},
"python": {
"icon": "icons/file_icons/python.svg"
},
"ruby": {
"icon": "icons/file_icons/ruby.svg"
},
"rust": {
"icon": "icons/file_icons/rust.svg"
},
"r": {
"icon": "icons/file_icons/r.svg"
},
"settings": {
"icon": "icons/file_icons/settings.svg"
},
"storage": {
"icon": "icons/file_icons/database.svg"
},
"swift": {
"icon": "icons/file_icons/swift.svg"
},
"template": {
"icon": "icons/file_icons/html.svg"
},
"terraform": {
"icon": "icons/file_icons/terraform.svg"
},
"terminal": {
"icon": "icons/file_icons/terminal.svg"
},
"toml": {
"icon": "icons/file_icons/toml.svg"
},
"typescript": {
"icon": "icons/file_icons/typescript.svg"
},
"vcs": {
"icon": "icons/file_icons/git.svg"
},
"video": {
"icon": "icons/file_icons/video.svg"
},
"vue": {
"icon": "icons/file_icons/vue.svg"
}
}
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px" viewBox="0 0 14 14" version="1.1">
<g id="surface1">
<path style="fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:4;" d="M 16.001786 21 L 19.497321 21 M 5.997321 21 L 12 3 L 18.002679 21 M 4.502679 21 L 7.998214 21 M 14.997321 14.000893 L 9.002679 14.000893 " transform="matrix(0.486111,0,0,0.486111,1.166667,1.166667)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 559 B

View File

@@ -0,0 +1 @@
<svg width="14px" height="14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="#000000"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 6.90308L87.323 28.4515V71.5484L50 93.0968L12.677 71.5484V28.4515L50 6.90308ZM16.8647 30.8693V62.5251L44.2795 15.0414L16.8647 30.8693ZM50 13.5086L18.3975 68.2457H81.6025L50 13.5086ZM77.4148 72.4334H22.5852L50 88.2613L77.4148 72.4334ZM83.1353 62.5251L55.7205 15.0414L83.1353 30.8693V62.5251Z"/><circle cx="50" cy="9.3209" r="8.82"/><circle cx="85.2292" cy="29.6605" r="8.82"/><circle cx="85.2292" cy="70.3396" r="8.82"/><circle cx="50" cy="90.6791" r="8.82"/><circle cx="14.7659" cy="70.3396" r="8.82"/><circle cx="14.7659" cy="29.6605" r="8.82"/></svg>

After

Width:  |  Height:  |  Size: 709 B

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px" viewBox="0 0 14 14" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 10.644531 9.734375 C 9.640625 9.734375 8.824219 8.917969 8.824219 7.910156 C 8.824219 6.90625 9.640625 6.089844 10.644531 6.089844 C 11.652344 6.089844 12.46875 6.90625 12.46875 7.910156 C 12.46875 8.917969 11.652344 9.734375 10.644531 9.734375 Z M 10.644531 7 C 10.144531 7 9.734375 7.410156 9.734375 7.910156 C 9.734375 8.414062 10.144531 8.824219 10.644531 8.824219 C 11.148438 8.824219 11.558594 8.414062 11.558594 7.910156 C 11.558594 7.410156 11.148438 7 10.644531 7 Z M 7.457031 4.265625 L 6.542969 4.265625 L 6.542969 2.441406 L 7.457031 2.441406 Z M 6.089844 4.265625 L 5.175781 4.265625 L 5.175781 1.53125 L 6.089844 1.53125 Z M 4.722656 4.265625 L 3.808594 4.265625 L 3.808594 2.441406 L 4.722656 2.441406 Z M 4.722656 4.265625 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 5.632812 12.011719 C 3.617188 12.011719 1.988281 10.382812 1.988281 8.367188 L 1.988281 5.632812 L 9.277344 5.632812 L 9.277344 8.367188 C 9.277344 10.382812 7.648438 12.011719 5.632812 12.011719 Z M 5.632812 12.011719 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px" viewBox="0 0 14 14" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 12.125 12.125 L 1.875 12.125 L 1.875 1.875 L 12.125 1.875 L 7 7 Z M 12.125 12.125 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 385 B

View File

@@ -0,0 +1,10 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_34_7)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2625 7.00157C12.2625 4.09565 9.90677 1.73994 7.00085 1.73994C4.09494 1.73994 1.73923 4.09565 1.73923 7.00157C1.73923 9.90749 4.09494 12.2632 7.00085 12.2632C9.90677 12.2632 12.2625 9.90749 12.2625 7.00157ZM10.7213 4.82205C10.7213 3.97095 10.0313 3.281 9.18023 3.281C8.32913 3.281 7.63917 3.97095 7.63917 4.82205C7.63917 5.67315 8.32913 6.3631 9.18023 6.3631C10.0313 6.3631 10.7213 5.67315 10.7213 4.82205ZM11.9704 11.3383L12.2849 11.6123C12.4856 11.3819 12.6732 11.1354 12.8424 10.8799L12.4947 10.6496C12.3355 10.8899 12.1591 11.1216 11.9704 11.3383ZM3.09019 12.8218C2.83557 12.6512 2.59021 12.4623 2.36091 12.2602L2.63665 11.9473C2.85224 12.1372 3.08295 12.3149 3.3224 12.4754L3.09019 12.8218ZM13.2533 9.09685L13.6488 9.22944C13.5516 9.51944 13.4341 9.806 13.2995 10.0812L12.9248 9.89792C13.0514 9.63912 13.1619 9.3696 13.2533 9.09685ZM11.3601 11.9516L11.6357 12.2647C11.4062 12.4667 11.1607 12.6555 10.9061 12.8259L10.6741 12.4793C10.9135 12.3191 11.1443 12.1415 11.3601 11.9516ZM9.92464 12.9125L10.1093 13.2865C9.83502 13.4219 9.54901 13.5406 9.25919 13.6391L9.12488 13.2442C9.39754 13.1515 9.66662 13.0399 9.92464 12.9125ZM0.698663 10.0754C0.564769 9.80041 0.447705 9.51376 0.350717 9.22346L0.746321 9.09128C0.837577 9.36442 0.947715 9.63411 1.0737 9.89286L0.698663 10.0754ZM4.7358 13.6379C4.44725 13.539 4.16148 13.4197 3.88645 13.2833L4.07178 12.9096C4.33065 13.038 4.59955 13.1503 4.871 13.2433L4.7358 13.6379ZM7.50907 0.425028L7.54103 0.00914471C7.84635 0.0326099 8.15299 0.0767322 8.45243 0.140276L8.36583 0.548303C8.08435 0.488557 7.79609 0.447081 7.50907 0.425028ZM8.28868 13.469L8.37042 13.878C8.07006 13.9381 7.76308 13.9787 7.45798 13.999L7.4304 13.5828C7.71737 13.5638 8.00614 13.5255 8.28868 13.469ZM6.56475 13.5831L6.5374 13.9993C6.23179 13.9792 5.92469 13.9385 5.62462 13.8783L5.70667 13.4693C5.98876 13.5259 6.27745 13.5642 6.56475 13.5831ZM1.71207 11.6074C1.51131 11.3768 1.32385 11.1303 1.15489 10.8748L1.5028 10.6447C1.66168 10.885 1.83795 11.1167 2.0267 11.3336L1.71207 11.6074ZM1.54706 3.2931L1.20185 3.05901C1.3739 2.80528 1.56421 2.56096 1.76748 2.33281L2.07891 2.61029C1.8878 2.82479 1.70885 3.05452 1.54706 3.2931ZM13.5829 7.4008L13.9993 7.42603C13.9807 7.73163 13.9418 8.03889 13.8834 8.33925L13.474 8.25969C13.5289 7.97721 13.5655 7.68824 13.5829 7.4008ZM2.69596 2.00373L2.42386 1.68762C2.65562 1.48813 2.90314 1.30202 3.15957 1.13448L3.38773 1.48365C3.14661 1.64119 2.91386 1.81619 2.69596 2.00373ZM4.14194 1.05867L3.96141 0.682649C4.23716 0.550267 4.52444 0.434775 4.8153 0.339358L4.9453 0.735689C4.67165 0.825447 4.40135 0.934116 4.14194 1.05867ZM6.64336 0.415732C6.35624 0.431589 6.06708 0.466692 5.78392 0.520066L5.70665 0.110177C6.00769 0.0534275 6.3151 0.0161137 6.62038 -0.00073251L6.64336 0.415732ZM9.33849 0.390492C9.62584 0.492485 9.91028 0.614901 10.1839 0.754324L9.99453 1.12595C9.73698 0.994735 9.46932 0.879534 9.19896 0.783565L9.33849 0.390492ZM0.116692 8.3334C0.0582983 8.03277 0.0192821 7.72556 0.000734408 7.42027L0.417082 7.39499C0.434525 7.68212 0.471213 7.97108 0.526144 8.25385L0.116692 8.3334ZM13.8694 5.59362C13.9308 5.89342 13.9729 6.20022 13.9945 6.50553L13.5785 6.53503C13.5581 6.24787 13.5185 5.95929 13.4607 5.67733L13.8694 5.59362ZM0.421578 6.52929L0.00551996 6.49964C0.0272978 6.19421 0.0697176 5.88734 0.131602 5.58753L0.540095 5.67184C0.48192 5.95369 0.442046 6.24218 0.421578 6.52929ZM13.268 3.85795C13.4053 4.1315 13.5257 4.41681 13.6258 4.70597L13.2317 4.84251C13.1375 4.57059 13.0243 4.30226 12.8952 4.045L13.268 3.85795ZM0.770731 4.83746L0.376902 4.70007C0.477381 4.41205 0.598242 4.12695 0.736138 3.85268L1.10878 4.04006C0.979007 4.29819 0.86526 4.56647 0.770731 4.83746ZM10.7213 1.73979C10.7213 0.888612 11.4113 0.198592 12.2625 0.198592C13.1137 0.198592 13.8037 0.888612 13.8037 1.73979C13.8037 2.59098 13.1137 3.281 12.2625 3.281C11.4113 3.281 10.7213 2.59098 10.7213 1.73979Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_34_7">
<rect width="14" height="14" fill="white" transform="matrix(-1 0 0 1 14 0)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,6 @@
<svg width="14" height="14" viewBox="
0 0 425 512" xmlns="http://www.w3.org/2000/svg" fill="#000000
">
<path
d="m381.38934 405.88714-229.67062 67.92744c-7.01651 2.07778-13.74132-3.99173-12.2669-11.07217l82.04834-392.9335c1.53436-7.352147 11.69152-8.514905 14.89609-1.710173l151.9177 322.59543c2.86494 6.08949-.40357 13.26702-6.92461 15.19297zm39.38512-16.02808-175.89887-373.53306c-11.59465-21.691431-39.0351-20.904032-49.75484-2.749064l-190.77231 308.99c-5.9096786 9.63371-5.7938027 21.50903.3356409 31.01887l93.252489 144.4589c9.615412 11.46292 18.506512 16.87006 33.692012 12.37878l270.68561-80.05849c18.03265-5.40039 26.72265-22.82202 18.46027-40.50593z" />
</svg>

After

Width:  |  Height:  |  Size: 680 B

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15px" height="14px" viewBox="0 0 15 14" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 14.0625 6.46875 C 14.0625 4.203125 11.125 2.367188 7.5 2.367188 C 3.875 2.367188 0.9375 4.203125 0.9375 6.46875 C 0.9375 8.488281 3.273438 10.160156 6.34375 10.503906 L 6.34375 11.8125 L 8.582031 11.8125 L 8.582031 10.511719 C 9.113281 10.457031 9.636719 10.359375 10.148438 10.21875 L 11.058594 11.8125 L 13.589844 11.8125 L 12.0625 9.410156 C 13.292969 8.667969 14.0625 7.625 14.0625 6.46875 Z M 3.515625 6.773438 C 3.515625 5.226562 5.75 3.96875 8.503906 3.96875 C 11.257812 3.96875 13.292969 4.828125 13.292969 6.773438 C 13.304688 7.757812 12.671875 8.644531 11.699219 9.015625 C 11.65625 8.988281 11.609375 8.964844 11.558594 8.941406 C 11.355469 8.851562 11.144531 8.78125 10.933594 8.71875 C 10.933594 8.71875 12.886719 8.582031 12.886719 6.765625 C 12.886719 4.949219 10.839844 4.914062 10.839844 4.914062 L 6.34375 4.914062 L 6.34375 9.300781 C 4.671875 8.847656 3.515625 7.886719 3.515625 6.773438 Z M 9.957031 7.582031 L 8.601562 7.582031 L 8.601562 6.410156 L 9.957031 6.410156 C 10.125 6.398438 10.292969 6.453125 10.410156 6.5625 C 10.53125 6.675781 10.597656 6.828125 10.585938 6.984375 C 10.589844 7.144531 10.527344 7.296875 10.410156 7.410156 C 10.289062 7.519531 10.128906 7.582031 9.957031 7.582031 Z M 8.582031 9.109375 L 9.183594 9.109375 C 9.300781 9.113281 9.40625 9.15625 9.484375 9.238281 C 9.578125 9.320312 9.65625 9.414062 9.722656 9.511719 C 9.34375 9.554688 8.964844 9.574219 8.582031 9.578125 Z M 8.582031 9.109375 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px" viewBox="0 0 14 14" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 8.269531 1.53125 C 13.078125 4.824219 11.523438 8.457031 11.523438 8.457031 C 11.523438 8.457031 12.890625 10.015625 12.335938 11.375 C 12.335938 11.375 11.773438 10.421875 10.828125 10.421875 C 9.914062 10.421875 9.378906 11.375 7.546875 11.375 C 3.460938 11.375 1.53125 7.9375 1.53125 7.9375 C 5.210938 10.375 7.722656 8.648438 7.722656 8.648438 C 6.066406 7.679688 2.539062 3.039062 2.539062 3.039062 C 5.609375 5.675781 6.9375 6.371094 6.9375 6.371094 C 6.144531 5.710938 3.921875 2.484375 3.921875 2.484375 C 5.699219 4.296875 9.230469 6.828125 9.230469 6.828125 C 10.234375 4.027344 8.269531 1.53125 8.269531 1.53125 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 926 B

View File

@@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5066 8.01531L19.2375 12.1073V20.2894L12.5066 16.1992V8.01531Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0294 12.1073V20.2894L27.1563 16.1992V8.01531L20.0294 12.1073Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.58781 3.66V11.5787L11.7147 15.5381V7.61937L4.58781 3.66Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5066 25.04L19.2375 29V21.1348V21.0818L12.5066 17.1219V25.04Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 620 B

1
assets/icons/play.svg Normal file
View File

@@ -0,0 +1 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>

After

Width:  |  Height:  |  Size: 518 B

View File

@@ -55,38 +55,14 @@
"bindings": {
"alt-cmd-/": "search::ToggleRegex",
"ctrl-0": "project_panel::ToggleFocus",
"cmd-1": [
"pane::ActivateItem",
0
],
"cmd-2": [
"pane::ActivateItem",
1
],
"cmd-3": [
"pane::ActivateItem",
2
],
"cmd-4": [
"pane::ActivateItem",
3
],
"cmd-5": [
"pane::ActivateItem",
4
],
"cmd-6": [
"pane::ActivateItem",
5
],
"cmd-7": [
"pane::ActivateItem",
6
],
"cmd-8": [
"pane::ActivateItem",
7
],
"cmd-1": ["pane::ActivateItem", 0],
"cmd-2": ["pane::ActivateItem", 1],
"cmd-3": ["pane::ActivateItem", 2],
"cmd-4": ["pane::ActivateItem", 3],
"cmd-5": ["pane::ActivateItem", 4],
"cmd-6": ["pane::ActivateItem", 5],
"cmd-7": ["pane::ActivateItem", 6],
"cmd-8": ["pane::ActivateItem", 7],
"cmd-9": "pane::ActivateLastItem"
}
},

View File

@@ -0,0 +1,561 @@
[
{
"bindings": {
"up": "menu::SelectPrev",
"pageup": "menu::SelectFirst",
"shift-pageup": "menu::SelectFirst",
"ctrl-p": "menu::SelectPrev",
"down": "menu::SelectNext",
"pagedown": "menu::SelectLast",
"shift-pagedown": "menu::SelectFirst",
"ctrl-n": "menu::SelectNext",
"ctrl-up": "menu::SelectFirst",
"ctrl-down": "menu::SelectLast",
"enter": "menu::Confirm",
"shift-f10": "menu::ShowContextMenu",
"ctrl-enter": "menu::SecondaryConfirm",
"escape": "menu::Cancel",
"ctrl-c": "menu::Cancel",
"ctrl-shift-w": "workspace::CloseWindow",
"shift-escape": "workspace::ToggleZoom",
"ctrl-o": "workspace::Open",
"ctrl-=": "zed::IncreaseBufferFontSize",
"ctrl-+": "zed::IncreaseBufferFontSize",
"ctrl--": "zed::DecreaseBufferFontSize",
"ctrl-0": "zed::ResetBufferFontSize",
"ctrl-,": "zed::OpenSettings",
"ctrl-q": "zed::Quit",
"ctrl-h": "zed::Hide",
"alt-ctrl-h": "zed::HideOthers",
"ctrl-m": "zed::Minimize",
"f11": "zed::ToggleFullScreen"
}
},
{
"context": "Editor",
"bindings": {
"escape": "editor::Cancel",
"backspace": "editor::Backspace",
"shift-backspace": "editor::Backspace",
"ctrl-h": "editor::Backspace",
"delete": "editor::Delete",
"ctrl-d": "editor::Delete",
"tab": "editor::Tab",
"shift-tab": "editor::TabPrev",
"ctrl-k": "editor::CutToEndOfLine",
"ctrl-t": "editor::Transpose",
"ctrl-backspace": "editor::DeleteToBeginningOfLine",
"ctrl-delete": "editor::DeleteToEndOfLine",
"alt-backspace": "editor::DeleteToPreviousWordStart",
"alt-delete": "editor::DeleteToNextWordEnd",
"alt-h": "editor::DeleteToPreviousWordStart",
"alt-d": "editor::DeleteToNextWordEnd",
"ctrl-x": "editor::Cut",
"ctrl-c": "editor::Copy",
"ctrl-v": "editor::Paste",
"ctrl-z": "editor::Undo",
"ctrl-shift-z": "editor::Redo",
"ctrl-y": "editor::Redo",
"up": "editor::MoveUp",
"ctrl-up": "editor::MoveToStartOfParagraph",
"pageup": "editor::PageUp",
"shift-pageup": "editor::MovePageUp",
"home": "editor::MoveToBeginningOfLine",
"down": "editor::MoveDown",
"ctrl-down": "editor::MoveToEndOfParagraph",
"pagedown": "editor::PageDown",
"shift-pagedown": "editor::MovePageDown",
"end": "editor::MoveToEndOfLine",
"left": "editor::MoveLeft",
"right": "editor::MoveRight",
"ctrl-p": "editor::MoveUp",
"ctrl-n": "editor::MoveDown",
"ctrl-b": "editor::MoveLeft",
"ctrl-f": "editor::MoveRight",
"ctrl-shift-l": "editor::NextScreen", // todo!(linux): What is this
"alt-left": "editor::MoveToPreviousWordStart",
"alt-b": "editor::MoveToPreviousWordStart",
"alt-right": "editor::MoveToNextWordEnd",
"alt-f": "editor::MoveToNextWordEnd",
"ctrl-e": "editor::MoveToEndOfLine",
"ctrl-home": "editor::MoveToBeginning",
"ctrl-=end": "editor::MoveToEnd",
"shift-up": "editor::SelectUp",
"ctrl-shift-p": "editor::SelectUp",
"shift-down": "editor::SelectDown",
"ctrl-shift-n": "editor::SelectDown",
"shift-left": "editor::SelectLeft",
"ctrl-shift-b": "editor::SelectLeft",
"shift-right": "editor::SelectRight",
"ctrl-shift-f": "editor::SelectRight",
"alt-shift-left": "editor::SelectToPreviousWordStart",
"alt-shift-b": "editor::SelectToPreviousWordStart",
"alt-shift-right": "editor::SelectToNextWordEnd",
"alt-shift-f": "editor::SelectToNextWordEnd",
"ctrl-shift-up": "editor::SelectToStartOfParagraph",
"ctrl-shift-down": "editor::SelectToEndOfParagraph",
"ctrl-shift-home": "editor::SelectToBeginning",
"ctrl-shift-end": "editor::SelectToEnd",
"ctrl-a": "editor::SelectAll",
"ctrl-l": "editor::SelectLine",
"ctrl-shift-i": "editor::Format",
"shift-home": [
"editor::SelectToBeginningOfLine",
{
"stop_at_soft_wraps": true
}
],
"shift-end": [
"editor::SelectToEndOfLine",
{
"stop_at_soft_wraps": true
}
],
"ctrl-shift-e": [
"editor::SelectToEndOfLine",
{
"stop_at_soft_wraps": true
}
]
}
},
{
"context": "Editor && mode == full",
"bindings": {
"enter": "editor::Newline",
"shift-enter": "editor::Newline",
"ctrl-shift-enter": "editor::NewlineAbove",
"ctrl-enter": "editor::NewlineBelow",
"alt-z": "editor::ToggleSoftWrap",
"ctrl-f": [
"buffer_search::Deploy",
{
"focus": true
}
],
"alt-\\": "copilot::Suggest",
"alt-]": "copilot::NextSuggestion",
"alt-[": "copilot::PreviousSuggestion",
"ctrl->": "assistant::QuoteSelection"
}
},
{
"context": "Editor && mode == auto_height",
"bindings": {
"ctrl-enter": "editor::Newline",
"shift-enter": "editor::Newline",
"ctrl-shift-enter": "editor::NewlineBelow"
}
},
{
"context": "AssistantPanel",
"bindings": {
"f3": "search::SelectNextMatch",
"shift-f3": "search::SelectPrevMatch"
}
},
{
"context": "ConversationEditor > Editor",
"bindings": {
"ctrl-enter": "assistant::Assist",
"ctrl-s": "workspace::Save",
"ctrl->": "assistant::QuoteSelection",
"shift-enter": "assistant::Split",
"ctrl-r": "assistant::CycleMessageRole"
}
},
{
"context": "BufferSearchBar",
"bindings": {
"escape": "buffer_search::Dismiss",
"tab": "buffer_search::FocusEditor",
"enter": "search::SelectNextMatch",
"shift-enter": "search::SelectPrevMatch",
"alt-enter": "search::SelectAllMatches",
"alt-tab": "search::CycleMode"
}
},
{
"context": "BufferSearchBar && in_replace",
"bindings": {
"enter": "search::ReplaceNext",
"ctrl-enter": "search::ReplaceAll"
}
},
{
"context": "BufferSearchBar && !in_replace > Editor",
"bindings": {
"up": "search::PreviousHistoryQuery",
"down": "search::NextHistoryQuery"
}
},
{
"context": "ProjectSearchBar",
"bindings": {
"escape": "project_search::ToggleFocus",
"alt-tab": "search::CycleMode",
"ctrl-shift-h": "search::ToggleReplace",
"ctrl-alt-g": "search::ActivateRegexMode",
"ctrl-alt-s": "search::ActivateSemanticMode",
"ctrl-alt-x": "search::ActivateTextMode"
}
},
{
"context": "ProjectSearchBar > Editor",
"bindings": {
"up": "search::PreviousHistoryQuery",
"down": "search::NextHistoryQuery"
}
},
{
"context": "ProjectSearchBar && in_replace",
"bindings": {
"enter": "search::ReplaceNext",
"ctrl-enter": "search::ReplaceAll"
}
},
{
"context": "ProjectSearchView",
"bindings": {
"escape": "project_search::ToggleFocus",
"alt-tab": "search::CycleMode",
"ctrl-shift-h": "search::ToggleReplace",
"ctrl-alt-g": "search::ActivateRegexMode",
"ctrl-alt-s": "search::ActivateSemanticMode",
"ctrl-alt-x": "search::ActivateTextMode"
}
},
{
"context": "Pane",
"bindings": {
"ctrl-{": "pane::ActivatePrevItem",
"ctrl-}": "pane::ActivateNextItem",
"ctrl-alt-left": "pane::ActivatePrevItem",
"ctrl-alt-right": "pane::ActivateNextItem",
"ctrl-w": "pane::CloseActiveItem",
"ctrl-alt-t": "pane::CloseInactiveItems",
"ctrl-alt-shift-w": "workspace::CloseInactiveTabsAndPanes",
"ctrl-k u": "pane::CloseCleanItems",
"ctrl-k ctrl-w": "pane::CloseAllItems",
"ctrl-f": "project_search::ToggleFocus",
"f3": "search::SelectNextMatch",
"shift-f3": "search::SelectPrevMatch",
"ctrl-shift-h": "search::ToggleReplace",
"alt-enter": "search::SelectAllMatches",
"ctrl-alt-c": "search::ToggleCaseSensitive",
"ctrl-alt-w": "search::ToggleWholeWord",
"alt-tab": "search::CycleMode",
"ctrl-alt-f": "project_search::ToggleFilters",
"ctrl-alt-g": "search::ActivateRegexMode",
"ctrl-alt-s": "search::ActivateSemanticMode",
"ctrl-alt-x": "search::ActivateTextMode"
}
},
// Bindings from VS Code
{
"context": "Editor",
"bindings": {
"ctrl-[": "editor::Outdent",
"ctrl-]": "editor::Indent",
"ctrl-alt-up": "editor::AddSelectionAbove",
"ctrl-alt-down": "editor::AddSelectionBelow",
"ctrl-d": [
"editor::SelectNext",
{
"replace_newest": false
}
],
"ctrl-shift-l": "editor::SelectAllMatches",
"ctrl-shift-d": [
"editor::SelectPrevious",
{
"replace_newest": false
}
],
"ctrl-k ctrl-d": [
"editor::SelectNext",
{
"replace_newest": true
}
],
"ctrl-k ctrl-shift-d": [
"editor::SelectPrevious",
{
"replace_newest": true
}
],
"ctrl-k ctrl-i": "editor::Hover",
"ctrl-/": [
"editor::ToggleComments",
{
"advance_downwards": false
}
],
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"ctrl-u": "editor::UndoSelection",
"ctrl-shift-u": "editor::RedoSelection",
"f8": "editor::GoToDiagnostic",
"shift-f8": "editor::GoToPrevDiagnostic",
"f2": "editor::Rename",
"f12": "editor::GoToDefinition",
"alt-f12": "editor::GoToDefinitionSplit",
"ctrl-f12": "editor::GoToTypeDefinition",
"ctrl-alt-f12": "editor::GoToTypeDefinitionSplit",
"alt-shift-f12": "editor::FindAllReferences",
"ctrl-m": "editor::MoveToEnclosingBracket",
"ctrl-alt-[": "editor::Fold",
"ctrl-alt-]": "editor::UnfoldLines",
"ctrl-space": "editor::ShowCompletions",
"ctrl-.": "editor::ToggleCodeActions",
"ctrl-alt-r": "editor::RevealInFinder",
"ctrl-alt-c": "editor::DisplayCursorNames"
}
},
{
"context": "Editor && mode == full",
"bindings": {
"ctrl-shift-o": "outline::Toggle",
"ctrl-g": "go_to_line::Toggle"
}
},
{
"context": "Pane",
"bindings": {
"ctrl-1": ["pane::ActivateItem", 0],
"ctrl-2": ["pane::ActivateItem", 1],
"ctrl-3": ["pane::ActivateItem", 2],
"ctrl-4": ["pane::ActivateItem", 3],
"ctrl-5": ["pane::ActivateItem", 4],
"ctrl-6": ["pane::ActivateItem", 5],
"ctrl-7": ["pane::ActivateItem", 6],
"ctrl-8": ["pane::ActivateItem", 7],
"ctrl-9": ["pane::ActivateItem", 8],
"ctrl-0": "pane::ActivateLastItem",
"ctrl--": "pane::GoBack",
"ctrl-_": "pane::GoForward",
"ctrl-shift-t": "pane::ReopenClosedItem",
"ctrl-shift-f": "project_search::ToggleFocus"
}
},
{
"context": "Workspace",
"bindings": {
"ctrl-alt-o": "projects::OpenRecent",
"ctrl-alt-b": "branches::OpenRecent",
"ctrl-~": "workspace::NewTerminal",
"ctrl-s": "workspace::Save",
"ctrl-shift-s": "workspace::SaveAs",
"ctrl-n": "workspace::NewFile",
"ctrl-shift-n": "workspace::NewWindow",
"ctrl-`": "terminal_panel::ToggleFocus",
"ctrl-1": ["workspace::ActivatePane", 0],
"ctrl-2": ["workspace::ActivatePane", 1],
"ctrl-3": ["workspace::ActivatePane", 2],
"ctrl-4": ["workspace::ActivatePane", 3],
"ctrl-5": ["workspace::ActivatePane", 4],
"ctrl-6": ["workspace::ActivatePane", 5],
"ctrl-7": ["workspace::ActivatePane", 6],
"ctrl-8": ["workspace::ActivatePane", 7],
"ctrl-9": ["workspace::ActivatePane", 8],
"ctrl-b": "workspace::ToggleLeftDock",
"ctrl-r": "workspace::ToggleRightDock",
"ctrl-j": "workspace::ToggleBottomDock",
"ctrl-alt-y": "workspace::CloseAllDocks",
"ctrl-shift-f": "pane::DeploySearch",
"ctrl-k ctrl-t": "theme_selector::Toggle",
"ctrl-k ctrl-s": "zed::OpenKeymap",
"ctrl-t": "project_symbols::Toggle",
"ctrl-p": "file_finder::Toggle",
"ctrl-shift-p": "command_palette::Toggle",
"ctrl-shift-m": "diagnostics::Deploy",
"ctrl-shift-e": "project_panel::ToggleFocus",
"ctrl-?": "assistant::ToggleFocus",
"ctrl-alt-s": "workspace::SaveAll",
"ctrl-k m": "language_selector::Toggle",
"escape": "workspace::Unfollow",
"ctrl-k ctrl-left": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-k ctrl-right": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-k ctrl-up": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-k ctrl-down": ["workspace::ActivatePaneInDirection", "Down"],
"ctrl-k shift-left": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-k shift-right": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-k shift-up": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-k shift-down": ["workspace::SwapPaneInDirection", "Down"],
"alt-t": "task::Rerun",
"alt-shift-t": "task::Spawn"
}
},
// Bindings from Sublime Text
// todo!(linux) make sure these match linux bindings or remove above comment?
{
"context": "Editor",
"bindings": {
"ctrl-shift-k": "editor::DeleteLine",
"ctrl-shift-d": "editor::DuplicateLine",
"ctrl-j": "editor::JoinLines",
"ctrl-alt-up": "editor::MoveLineUp",
"ctrl-alt-down": "editor::MoveLineDown",
"ctrl-alt-backspace": "editor::DeleteToPreviousSubwordStart",
"ctrl-alt-h": "editor::DeleteToPreviousSubwordStart",
"ctrl-alt-delete": "editor::DeleteToNextSubwordEnd",
"ctrl-alt-d": "editor::DeleteToNextSubwordEnd",
"ctrl-alt-left": "editor::MoveToPreviousSubwordStart",
"ctrl-alt-b": "editor::MoveToPreviousSubwordStart",
"ctrl-alt-right": "editor::MoveToNextSubwordEnd",
"ctrl-alt-f": "editor::MoveToNextSubwordEnd",
"ctrl-alt-shift-left": "editor::SelectToPreviousSubwordStart",
"ctrl-alt-shift-b": "editor::SelectToPreviousSubwordStart",
"ctrl-alt-shift-right": "editor::SelectToNextSubwordEnd",
"ctrl-alt-shift-f": "editor::SelectToNextSubwordEnd"
}
},
// Bindings from Atom
// todo!(linux) make sure these match linux bindings or remove above comment?
{
"context": "Pane",
"bindings": {
"ctrl-k up": "pane::SplitUp",
"ctrl-k down": "pane::SplitDown",
"ctrl-k left": "pane::SplitLeft",
"ctrl-k right": "pane::SplitRight"
}
},
// Bindings that should be unified with bindings for more general actions
{
"context": "Editor && renaming",
"bindings": {
"enter": "editor::ConfirmRename"
}
},
{
"context": "Editor && showing_completions",
"bindings": {
"enter": "editor::ConfirmCompletion",
"tab": "editor::ConfirmCompletion"
}
},
{
"context": "Editor && showing_code_actions",
"bindings": {
"enter": "editor::ConfirmCodeAction"
}
},
{
"context": "Editor && (showing_code_actions || showing_completions)",
"bindings": {
"up": "editor::ContextMenuPrev",
"ctrl-p": "editor::ContextMenuPrev",
"down": "editor::ContextMenuNext",
"ctrl-n": "editor::ContextMenuNext",
"pageup": "editor::ContextMenuFirst",
"pagedown": "editor::ContextMenuLast"
}
},
// Custom bindings
{
"bindings": {
"ctrl-alt-shift-f": "workspace::FollowNextCollaborator",
// TODO: Move this to a dock open action
"ctrl-alt-c": "collab_panel::ToggleFocus",
"ctrl-alt-i": "zed::DebugElements",
"ctrl-:": "editor::ToggleInlayHints"
}
},
{
"context": "Editor && mode == full",
"bindings": {
"alt-enter": "editor::OpenExcerpts",
"ctrl-f8": "editor::GoToHunk",
"ctrl-shift-f8": "editor::GoToPrevHunk",
"ctrl-enter": "assistant::InlineAssist"
}
},
{
"context": "ProjectSearchBar && !in_replace",
"bindings": {
"ctrl-enter": "project_search::SearchInNew"
}
},
{
"context": "ProjectPanel",
"bindings": {
"left": "project_panel::CollapseSelectedEntry",
"right": "project_panel::ExpandSelectedEntry",
"ctrl-n": "project_panel::NewFile",
"ctrl-alt-n": "project_panel::NewDirectory",
"ctrl-x": "project_panel::Cut",
"ctrl-c": "project_panel::Copy",
"ctrl-v": "project_panel::Paste",
"ctrl-alt-c": "project_panel::CopyPath",
"ctrl-alt-shift-c": "project_panel::CopyRelativePath",
"f2": "project_panel::Rename",
"enter": "project_panel::Rename",
"backspace": "project_panel::Delete",
"ctrl-alt-r": "project_panel::RevealInFinder",
"alt-shift-f": "project_panel::NewSearchInDirectory"
}
},
{
"context": "ProjectPanel && not_editing",
"bindings": {
"space": "project_panel::Open"
}
},
{
"context": "CollabPanel && not_editing",
"bindings": {
"ctrl-backspace": "collab_panel::Remove",
"space": "menu::Confirm"
}
},
{
"context": "(CollabPanel && editing) > Editor",
"bindings": {
"space": "collab_panel::InsertSpace"
}
},
{
"context": "ChannelModal",
"bindings": {
"tab": "channel_modal::ToggleMode"
}
},
{
"context": "ChannelModal > Picker > Editor",
"bindings": {
"tab": "channel_modal::ToggleMode"
}
},
{
"context": "ChatPanel > MessageEditor",
"bindings": {
"escape": "chat_panel::CloseReplyPreview"
}
},
{
"context": "Terminal",
"bindings": {
"ctrl-alt-space": "terminal::ShowCharacterPalette",
"ctrl-shift-c": "terminal::Copy",
"ctrl-shift-v": "terminal::Paste",
"ctrl-k": "terminal::Clear",
// Some nice conveniences
"ctrl-backspace": ["terminal::SendText", "\u0015"],
"ctrl-right": ["terminal::SendText", "\u0005"],
"ctrl-left": ["terminal::SendText", "\u0001"],
// Terminal.app compatibility
"alt-left": ["terminal::SendText", "\u001bb"],
"alt-right": ["terminal::SendText", "\u001bf"],
// There are conflicting bindings for these keys in the global context.
// these bindings override them, remove at your own risk:
"up": ["terminal::SendKeystroke", "up"],
"pageup": ["terminal::SendKeystroke", "pageup"],
"down": ["terminal::SendKeystroke", "down"],
"pagedown": ["terminal::SendKeystroke", "pagedown"],
"escape": ["terminal::SendKeystroke", "escape"],
"enter": ["terminal::SendKeystroke", "enter"],
"ctrl-c": ["terminal::SendKeystroke", "ctrl-c"]
}
}
]

View File

@@ -415,7 +415,17 @@
"cmd-?": "assistant::ToggleFocus",
"cmd-alt-s": "workspace::SaveAll",
"cmd-k m": "language_selector::Toggle",
"escape": "workspace::Unfollow"
"escape": "workspace::Unfollow",
"cmd-k cmd-left": ["workspace::ActivatePaneInDirection", "Left"],
"cmd-k cmd-right": ["workspace::ActivatePaneInDirection", "Right"],
"cmd-k cmd-up": ["workspace::ActivatePaneInDirection", "Up"],
"cmd-k cmd-down": ["workspace::ActivatePaneInDirection", "Down"],
"cmd-k shift-left": ["workspace::SwapPaneInDirection", "Left"],
"cmd-k shift-right": ["workspace::SwapPaneInDirection", "Right"],
"cmd-k shift-up": ["workspace::SwapPaneInDirection", "Up"],
"cmd-k shift-down": ["workspace::SwapPaneInDirection", "Down"],
"alt-t": "task::Rerun",
"alt-shift-t": "task::Spawn"
}
},
// Bindings from Sublime Text
@@ -441,18 +451,6 @@
"ctrl-alt-shift-f": "editor::SelectToNextSubwordEnd"
}
},
{
"bindings": {
"cmd-k cmd-left": ["workspace::ActivatePaneInDirection", "Left"],
"cmd-k cmd-right": ["workspace::ActivatePaneInDirection", "Right"],
"cmd-k cmd-up": ["workspace::ActivatePaneInDirection", "Up"],
"cmd-k cmd-down": ["workspace::ActivatePaneInDirection", "Down"],
"cmd-k shift-left": ["workspace::SwapPaneInDirection", "Left"],
"cmd-k shift-right": ["workspace::SwapPaneInDirection", "Right"],
"cmd-k shift-up": ["workspace::SwapPaneInDirection", "Up"],
"cmd-k shift-down": ["workspace::SwapPaneInDirection", "Down"]
}
},
// Bindings from Atom
{
"context": "Pane",
@@ -533,7 +531,8 @@
"alt-cmd-shift-c": "project_panel::CopyRelativePath",
"f2": "project_panel::Rename",
"enter": "project_panel::Rename",
"backspace": "project_panel::Delete",
"delete": "project_panel::Delete",
"cmd-backspace": "project_panel::Delete",
"alt-cmd-r": "project_panel::RevealInFinder",
"alt-shift-f": "project_panel::NewSearchInDirectory"
}
@@ -569,6 +568,12 @@
"tab": "channel_modal::ToggleMode"
}
},
{
"context": "ChatPanel > MessageEditor",
"bindings": {
"escape": "chat_panel::CloseReplyPreview"
}
},
{
"context": "Terminal",
"bindings": {

View File

@@ -81,6 +81,13 @@
"cmd-6": "diagnostics::Deploy"
}
},
{
"context": "Pane",
"bindings": {
"cmd-alt-left": "pane::GoBack",
"cmd-alt-right": "pane::GoForward"
}
},
{
"context": "ProjectPanel",
"bindings": {

View File

@@ -0,0 +1,23 @@
[
// Standard macOS bindings
{
"bindings": {
"up": "menu::SelectPrev",
"pageup": "menu::SelectFirst",
"shift-pageup": "menu::SelectFirst",
"ctrl-p": "menu::SelectPrev",
"down": "menu::SelectNext",
"pagedown": "menu::SelectLast",
"shift-pagedown": "menu::SelectFirst",
"ctrl-n": "menu::SelectNext",
"cmd-up": "menu::SelectFirst",
"cmd-down": "menu::SelectLast",
"enter": "menu::Confirm",
"ctrl-enter": "menu::ShowContextMenu",
"cmd-enter": "menu::SecondaryConfirm",
"escape": "menu::Cancel",
"ctrl-c": "menu::Cancel",
"cmd-q": "storybook::Quit"
}
}
]

View File

@@ -117,12 +117,15 @@
"ctrl-e": "vim::LineDown",
"ctrl-y": "vim::LineUp",
// "g" commands
"g e": "vim::PreviousWordEnd",
"g shift-e": ["vim::PreviousWordEnd", { "ignorePunctuation": true }],
"g g": "vim::StartOfDocument",
"g h": "editor::Hover",
"g t": "pane::ActivateNextItem",
"g shift-t": "pane::ActivatePrevItem",
"g d": "editor::GoToDefinition",
"g shift-d": "editor::GoToTypeDefinition",
"g x": "editor::OpenUrl",
"g n": "vim::SelectNext",
"g shift-n": "vim::SelectPrevious",
"g >": [
@@ -284,7 +287,8 @@
"ctrl-w o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w ctrl-o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w n": ["workspace::NewFileInDirection", "Up"],
"ctrl-w ctrl-n": ["workspace::NewFileInDirection", "Up"]
"ctrl-w ctrl-n": ["workspace::NewFileInDirection", "Up"],
"-": "pane::RevealInProjectPanel"
}
},
{
@@ -379,6 +383,7 @@
"ignorePunctuation": true
}
],
"t": "vim::Tag",
"s": "vim::Sentence",
"'": "vim::Quotes",
"`": "vim::BackQuotes",
@@ -393,7 +398,8 @@
"}": "vim::CurlyBrackets",
"shift-b": "vim::CurlyBrackets",
"<": "vim::AngleBrackets",
">": "vim::AngleBrackets"
">": "vim::AngleBrackets",
"a": "vim::Argument"
}
},
{
@@ -484,7 +490,9 @@
"ctrl-x ctrl-a": "assistant::InlineAssist", // zed specific
"ctrl-x ctrl-c": "copilot::Suggest", // zed specific
"ctrl-x ctrl-l": "editor::ToggleCodeActions", // zed specific
"ctrl-x ctrl-z": "editor::Cancel"
"ctrl-x ctrl-z": "editor::Cancel",
"ctrl-w": "editor::DeleteToPreviousWordStart",
"ctrl-u": "editor::DeleteToBeginningOfLine"
}
},
{
@@ -497,23 +505,32 @@
}
},
{
"context": "BufferSearchBar && !in_replace > VimEnabled",
"context": "BufferSearchBar && !in_replace",
"bindings": {
"enter": "vim::SearchSubmit",
"escape": "buffer_search::Dismiss"
}
},
{
"context": "Dock",
// netrw compatibility
"context": "ProjectPanel && not_editing",
"bindings": {
"ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"],
"ctrl-w ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w ctrl-l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w ctrl-j": ["workspace::ActivatePaneInDirection", "Down"]
":": "command_palette::Toggle",
"%": "project_panel::NewFile",
"/": "project_panel::NewSearchInDirectory",
"d": "project_panel::NewDirectory",
"enter": "project_panel::Open",
"escape": "project_panel::ToggleFocus",
"h": "project_panel::CollapseSelectedEntry",
"j": "menu::SelectNext",
"k": "menu::SelectPrev",
"l": "project_panel::ExpandSelectedEntry",
"o": "project_panel::Open",
"shift-d": "project_panel::Delete",
"shift-r": "project_panel::Rename",
"t": "project_panel::Open",
"v": "project_panel::Open",
"x": "project_panel::RevealInFinder"
}
}
]

View File

@@ -140,6 +140,14 @@
// Whether to show diagnostic indicators in the scrollbar.
"diagnostics": true
},
"gutter": {
// Whether to show line numbers in the gutter.
"line_numbers": true,
// Whether to show code action buttons in the gutter.
"code_actions": true,
// Whether to show fold buttons in the gutter.
"folds": true
},
// The number of lines to keep above/below the cursor when scrolling.
"vertical_scroll_margin": 3,
"relative_line_numbers": false,
@@ -161,7 +169,13 @@
"show_type_hints": true,
"show_parameter_hints": true,
// Corresponds to null/None LSP hint type value.
"show_other_hints": true
"show_other_hints": true,
// Time to wait after editing the buffer, before requesting the hints,
// set to 0 to disable debouncing.
"edit_debounce_ms": 700,
// Time to wait after scrolling the buffer, before requesting the hints,
// set to 0 to disable debouncing.
"scroll_debounce_ms": 50
},
"project_panel": {
// Default width of the project panel.
@@ -214,6 +228,8 @@
"default_width": 640,
// Default height when the assistant is docked to the bottom.
"default_height": 320,
// The default OpenAI API endpoint to use when starting new conversations.
"openai_api_url": "https://api.openai.com/v1",
// The default OpenAI model to use when starting new conversations. This
// setting can take three values:
//
@@ -329,7 +345,9 @@
"copilot": {
// The set of glob patterns for which copilot should be disabled
// in any matching file.
"disabled_globs": [".env"]
"disabled_globs": [
".env"
]
},
// Settings specific to journaling
"journal": {
@@ -438,18 +456,26 @@
// Default directories to search for virtual environments, relative
// to the current working directory. We recommend overriding this
// in your project's settings, rather than globally.
"directories": [".env", "env", ".venv", "venv"],
"directories": [
".env",
"env",
".venv",
"venv"
],
// Can also be 'csh', 'fish', and `nushell`
"activate_script": "default"
}
}
// Set the terminal's font size. If this option is not included,
// the terminal will default to matching the buffer's font size.
// "font_size": "15",
// "font_size": 15,
// Set the terminal's font family. If this option is not included,
// the terminal will default to matching the buffer's font family.
// "font_family": "Zed Mono",
// ---
// Sets the maximum number of lines in the terminal's scrollback buffer.
// Default: 10_000, maximum: 100_000 (all bigger values set will be treated as 100_000), 0 disables the scrolling.
// Existing terminals will not pick up this change until they are recreated.
// "max_scroll_history_lines": 10000,
},
// Difference settings for semantic_index
"semantic_index": {
@@ -480,6 +506,7 @@
"deno": {
"enable": false
},
"code_actions_on_format": {},
// Different settings for specific languages.
"languages": {
"Plain Text": {
@@ -488,16 +515,26 @@
"Elixir": {
"tab_size": 2
},
"Gleam": {
"tab_size": 2
},
"Go": {
"tab_size": 4,
"hard_tabs": true
"hard_tabs": true,
"code_actions_on_format": {
"source.organizeImports": true
}
},
"Markdown": {
"tab_size": 2,
"soft_wrap": "preferred_line_length"
},
"JavaScript": {
"tab_size": 2
},
"Terraform": {
"tab_size": 2
},
"TypeScript": {
"tab_size": 2
},
@@ -531,14 +568,18 @@
"lsp": {
// Specify the LSP name as a key here.
// "rust-analyzer": {
// //These initialization options are merged into Zed's defaults
// // These initialization options are merged into Zed's defaults
// "initialization_options": {
// "checkOnSave": {
// "command": "clippy"
// "check": {
// "command": "clippy" // rust-analyzer.check.command (default: "check")
// }
// }
// }
},
// Vim settings
"vim": {
"use_system_clipboard": "always"
},
// The server to connect to. If the environment variable
// ZED_SERVER_URL is set, it will override this setting.
"server_url": "https://zed.dev",
@@ -557,7 +598,7 @@
"stable": {
// "theme": "Andromeda"
},
// Settings overrides to use when using Zed Stable.
// Settings overrides to use when using Zed Dev.
// Mostly useful for developers who are managing multiple instances of Zed.
"dev": {
// "theme": "Andromeda"

View File

@@ -0,0 +1,19 @@
// Static tasks configuration.
//
// Example:
[
{
"label": "Example task",
"command": "bash",
// rest of the parameters are optional
"args": ["-c", "for i in {1..5}; do echo \"Hello $i/5\"; sleep 1; done"],
// Env overrides for the command, will be appended to the terminal's environment from the settings.
"env": { "foo": "bar" },
// Current working directory to spawn the command into, defaults to current project root.
//"cwd": "/path/to/working/directory",
// Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`.
"use_new_terminal": false,
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
"allow_concurrent_runs": false
}
]

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#21242bff",
"tab.inactive_background": "#21242bff",
"tab.active_background": "#1e2025ff",
"search.match_background": null,
"search.match_background": "#11a79366",
"panel.background": "#21242bff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f7f7f84c",
"scrollbar.thumb.background": "#f7f7f84c",
"scrollbar.thumb.hover_background": "#252931ff",
"scrollbar.thumb.border": "#252931ff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#221f26ff",
"tab.inactive_background": "#221f26ff",
"tab.active_background": "#19171cff",
"search.match_background": null,
"search.match_background": "#576dda66",
"panel.background": "#221f26ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#efecf44c",
"scrollbar.thumb.background": "#efecf44c",
"scrollbar.thumb.hover_background": "#332f38ff",
"scrollbar.thumb.border": "#332f38ff",
"scrollbar.track.background": "#00000000",
@@ -426,11 +426,11 @@
"tab_bar.background": "#e6e3ebff",
"tab.inactive_background": "#e6e3ebff",
"tab.active_background": "#efecf4ff",
"search.match_background": null,
"search.match_background": "#586dda66",
"panel.background": "#e6e3ebff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#19171c4c",
"scrollbar.thumb.background": "#19171c4c",
"scrollbar.thumb.hover_background": "#cbc8d1ff",
"scrollbar.thumb.border": "#cbc8d1ff",
"scrollbar.track.background": "#00000000",
@@ -810,11 +810,11 @@
"tab_bar.background": "#262622ff",
"tab.inactive_background": "#262622ff",
"tab.active_background": "#20201dff",
"search.match_background": null,
"search.match_background": "#6684e066",
"panel.background": "#262622ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#fefbec4c",
"scrollbar.thumb.background": "#fefbec4c",
"scrollbar.thumb.hover_background": "#3b3933ff",
"scrollbar.thumb.border": "#3b3933ff",
"scrollbar.track.background": "#00000000",
@@ -1194,11 +1194,11 @@
"tab_bar.background": "#eeebd7ff",
"tab.inactive_background": "#eeebd7ff",
"tab.active_background": "#fefbecff",
"search.match_background": null,
"search.match_background": "#6784e066",
"panel.background": "#eeebd7ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#20201d4c",
"scrollbar.thumb.background": "#20201d4c",
"scrollbar.thumb.hover_background": "#d7d3beff",
"scrollbar.thumb.border": "#d7d3beff",
"scrollbar.track.background": "#00000000",
@@ -1578,11 +1578,11 @@
"tab_bar.background": "#2c2b23ff",
"tab.inactive_background": "#2c2b23ff",
"tab.active_background": "#22221bff",
"search.match_background": null,
"search.match_background": "#37a16666",
"panel.background": "#2c2b23ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f4f3ec4c",
"scrollbar.thumb.background": "#f4f3ec4c",
"scrollbar.thumb.hover_background": "#3c3b31ff",
"scrollbar.thumb.border": "#3c3b31ff",
"scrollbar.track.background": "#00000000",
@@ -1962,11 +1962,11 @@
"tab_bar.background": "#ebeae3ff",
"tab.inactive_background": "#ebeae3ff",
"tab.active_background": "#f4f3ecff",
"search.match_background": null,
"search.match_background": "#38a16666",
"panel.background": "#ebeae3ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#22221b4c",
"scrollbar.thumb.background": "#22221b4c",
"scrollbar.thumb.hover_background": "#d0cfc5ff",
"scrollbar.thumb.border": "#d0cfc5ff",
"scrollbar.track.background": "#00000000",
@@ -2346,11 +2346,11 @@
"tab_bar.background": "#27211eff",
"tab.inactive_background": "#27211eff",
"tab.active_background": "#1b1918ff",
"search.match_background": null,
"search.match_background": "#417ee666",
"panel.background": "#27211eff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f0eeed4c",
"scrollbar.thumb.background": "#f0eeed4c",
"scrollbar.thumb.hover_background": "#3b3431ff",
"scrollbar.thumb.border": "#3b3431ff",
"scrollbar.track.background": "#00000000",
@@ -2730,11 +2730,11 @@
"tab_bar.background": "#e9e6e4ff",
"tab.inactive_background": "#e9e6e4ff",
"tab.active_background": "#f0eeedff",
"search.match_background": null,
"search.match_background": "#417ee666",
"panel.background": "#e9e6e4ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#1b19184c",
"scrollbar.thumb.background": "#1b19184c",
"scrollbar.thumb.hover_background": "#d6d1cfff",
"scrollbar.thumb.border": "#d6d1cfff",
"scrollbar.track.background": "#00000000",
@@ -3114,11 +3114,11 @@
"tab_bar.background": "#252025ff",
"tab.inactive_background": "#252025ff",
"tab.active_background": "#1b181bff",
"search.match_background": null,
"search.match_background": "#526aeb66",
"panel.background": "#252025ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f7f3f74c",
"scrollbar.thumb.background": "#f7f3f74c",
"scrollbar.thumb.hover_background": "#393239ff",
"scrollbar.thumb.border": "#393239ff",
"scrollbar.track.background": "#00000000",
@@ -3498,11 +3498,11 @@
"tab_bar.background": "#e0d5e0ff",
"tab.inactive_background": "#e0d5e0ff",
"tab.active_background": "#f7f3f7ff",
"search.match_background": null,
"search.match_background": "#526aeb66",
"panel.background": "#e0d5e0ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#1b181b4c",
"scrollbar.thumb.background": "#1b181b4c",
"scrollbar.thumb.hover_background": "#ccbdccff",
"scrollbar.thumb.border": "#ccbdccff",
"scrollbar.track.background": "#00000000",
@@ -3882,11 +3882,11 @@
"tab_bar.background": "#1c2529ff",
"tab.inactive_background": "#1c2529ff",
"tab.active_background": "#161b1dff",
"search.match_background": null,
"search.match_background": "#277fad66",
"panel.background": "#1c2529ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#ebf8ff4c",
"scrollbar.thumb.background": "#ebf8ff4c",
"scrollbar.thumb.hover_background": "#2c3b42ff",
"scrollbar.thumb.border": "#2c3b42ff",
"scrollbar.track.background": "#00000000",
@@ -4266,11 +4266,11 @@
"tab_bar.background": "#cdeaf9ff",
"tab.inactive_background": "#cdeaf9ff",
"tab.active_background": "#ebf8ffff",
"search.match_background": null,
"search.match_background": "#277fad66",
"panel.background": "#cdeaf9ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#161b1d4c",
"scrollbar.thumb.background": "#161b1d4c",
"scrollbar.thumb.hover_background": "#b0d3e5ff",
"scrollbar.thumb.border": "#b0d3e5ff",
"scrollbar.track.background": "#00000000",
@@ -4650,11 +4650,11 @@
"tab_bar.background": "#252020ff",
"tab.inactive_background": "#252020ff",
"tab.active_background": "#1b1818ff",
"search.match_background": null,
"search.match_background": "#7272ca66",
"panel.background": "#252020ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f4ecec4c",
"scrollbar.thumb.background": "#f4ecec4c",
"scrollbar.thumb.hover_background": "#352f2fff",
"scrollbar.thumb.border": "#352f2fff",
"scrollbar.track.background": "#00000000",
@@ -5034,11 +5034,11 @@
"tab_bar.background": "#ebe3e3ff",
"tab.inactive_background": "#ebe3e3ff",
"tab.active_background": "#f4ececff",
"search.match_background": null,
"search.match_background": "#7372ca66",
"panel.background": "#ebe3e3ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#1b18184c",
"scrollbar.thumb.background": "#1b18184c",
"scrollbar.thumb.hover_background": "#cfc7c7ff",
"scrollbar.thumb.border": "#cfc7c7ff",
"scrollbar.track.background": "#00000000",
@@ -5418,11 +5418,11 @@
"tab_bar.background": "#1f2621ff",
"tab.inactive_background": "#1f2621ff",
"tab.active_background": "#171c19ff",
"search.match_background": null,
"search.match_background": "#478c9066",
"panel.background": "#1f2621ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#ecf4ee4c",
"scrollbar.thumb.background": "#ecf4ee4c",
"scrollbar.thumb.hover_background": "#2f3832ff",
"scrollbar.thumb.border": "#2f3832ff",
"scrollbar.track.background": "#00000000",
@@ -5802,11 +5802,11 @@
"tab_bar.background": "#e3ebe6ff",
"tab.inactive_background": "#e3ebe6ff",
"tab.active_background": "#ecf4eeff",
"search.match_background": null,
"search.match_background": "#488c9066",
"panel.background": "#e3ebe6ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#171c194c",
"scrollbar.thumb.background": "#171c194c",
"scrollbar.thumb.hover_background": "#c8d1cbff",
"scrollbar.thumb.border": "#c8d1cbff",
"scrollbar.track.background": "#00000000",
@@ -6186,11 +6186,11 @@
"tab_bar.background": "#1f231fff",
"tab.inactive_background": "#1f231fff",
"tab.active_background": "#131513ff",
"search.match_background": null,
"search.match_background": "#3e62f466",
"panel.background": "#1f231fff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f3faf34c",
"scrollbar.thumb.background": "#f3faf34c",
"scrollbar.thumb.hover_background": "#333b33ff",
"scrollbar.thumb.border": "#333b33ff",
"scrollbar.track.background": "#00000000",
@@ -6570,11 +6570,11 @@
"tab_bar.background": "#daeedaff",
"tab.inactive_background": "#daeedaff",
"tab.active_background": "#f3faf3ff",
"search.match_background": null,
"search.match_background": "#3f62f466",
"panel.background": "#daeedaff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#1315134c",
"scrollbar.thumb.background": "#1315134c",
"scrollbar.thumb.hover_background": "#bed7beff",
"scrollbar.thumb.border": "#bed7beff",
"scrollbar.track.background": "#00000000",
@@ -6954,11 +6954,11 @@
"tab_bar.background": "#262f51ff",
"tab.inactive_background": "#262f51ff",
"tab.active_background": "#202646ff",
"search.match_background": null,
"search.match_background": "#3e8fd066",
"panel.background": "#262f51ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f5f7ff4c",
"scrollbar.thumb.background": "#f5f7ff4c",
"scrollbar.thumb.hover_background": "#363f62ff",
"scrollbar.thumb.border": "#363f62ff",
"scrollbar.track.background": "#00000000",
@@ -7338,11 +7338,11 @@
"tab_bar.background": "#e5e8f5ff",
"tab.inactive_background": "#e5e8f5ff",
"tab.active_background": "#f5f7ffff",
"search.match_background": null,
"search.match_background": "#3f8fd066",
"panel.background": "#e5e8f5ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#2026464c",
"scrollbar.thumb.background": "#2026464c",
"scrollbar.thumb.hover_background": "#ccd0e1ff",
"scrollbar.thumb.border": "#ccd0e1ff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#1f2127ff",
"tab.inactive_background": "#1f2127ff",
"tab.active_background": "#0d1016ff",
"search.match_background": null,
"search.match_background": "#5ac2fe66",
"panel.background": "#1f2127ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#bfbdb64c",
"scrollbar.thumb.background": "#bfbdb64c",
"scrollbar.thumb.hover_background": "#2d2f34ff",
"scrollbar.thumb.border": "#2d2f34ff",
"scrollbar.track.background": "#00000000",
@@ -411,11 +411,11 @@
"tab_bar.background": "#ececedff",
"tab.inactive_background": "#ececedff",
"tab.active_background": "#fcfcfcff",
"search.match_background": null,
"search.match_background": "#3b9ee566",
"panel.background": "#ececedff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#5c61664c",
"scrollbar.thumb.background": "#5c61664c",
"scrollbar.thumb.hover_background": "#dfe0e1ff",
"scrollbar.thumb.border": "#dfe0e1ff",
"scrollbar.track.background": "#00000000",
@@ -780,11 +780,11 @@
"tab_bar.background": "#353944ff",
"tab.inactive_background": "#353944ff",
"tab.active_background": "#242835ff",
"search.match_background": null,
"search.match_background": "#73cffe66",
"panel.background": "#353944ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#cccac24c",
"scrollbar.thumb.background": "#cccac24c",
"scrollbar.thumb.hover_background": "#43464fff",
"scrollbar.thumb.border": "#43464fff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#3a3735ff",
"tab.inactive_background": "#3a3735ff",
"tab.active_background": "#282828ff",
"search.match_background": null,
"search.match_background": "#83a59866",
"panel.background": "#3a3735ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#fbf1c74c",
"scrollbar.thumb.background": "#fbf1c74c",
"scrollbar.thumb.hover_background": "#494340ff",
"scrollbar.thumb.border": "#494340ff",
"scrollbar.track.background": "#00000000",
@@ -416,11 +416,11 @@
"tab_bar.background": "#393634ff",
"tab.inactive_background": "#393634ff",
"tab.active_background": "#1d2021ff",
"search.match_background": null,
"search.match_background": "#83a59866",
"panel.background": "#393634ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#fbf1c74c",
"scrollbar.thumb.background": "#fbf1c74c",
"scrollbar.thumb.hover_background": "#494340ff",
"scrollbar.thumb.border": "#494340ff",
"scrollbar.track.background": "#00000000",
@@ -482,7 +482,7 @@
"hidden": "#998b78ff",
"hidden.background": "#4c4642ff",
"hidden.border": "#544c48ff",
"hint": "#8c957dff",
"hint": "#6a695bff",
"hint.background": "#1e2321ff",
"hint.border": "#303a36ff",
"ignored": "#c5b597ff",
@@ -790,11 +790,11 @@
"tab_bar.background": "#3b3735ff",
"tab.inactive_background": "#3b3735ff",
"tab.active_background": "#32302fff",
"search.match_background": null,
"search.match_background": "#83a59866",
"panel.background": "#3b3735ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#fbf1c74c",
"scrollbar.thumb.background": "#fbf1c74c",
"scrollbar.thumb.hover_background": "#494340ff",
"scrollbar.thumb.border": "#494340ff",
"scrollbar.track.background": "#00000000",
@@ -1164,11 +1164,11 @@
"tab_bar.background": "#ecddb4ff",
"tab.inactive_background": "#ecddb4ff",
"tab.active_background": "#fbf1c7ff",
"search.match_background": null,
"search.match_background": "#0b667866",
"panel.background": "#ecddb4ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#2828284c",
"scrollbar.thumb.background": "#2828284c",
"scrollbar.thumb.hover_background": "#ddcca7ff",
"scrollbar.thumb.border": "#ddcca7ff",
"scrollbar.track.background": "#00000000",
@@ -1538,11 +1538,11 @@
"tab_bar.background": "#ecddb5ff",
"tab.inactive_background": "#ecddb5ff",
"tab.active_background": "#f9f5d7ff",
"search.match_background": null,
"search.match_background": "#0b667866",
"panel.background": "#ecddb5ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#2828284c",
"scrollbar.thumb.background": "#2828284c",
"scrollbar.thumb.hover_background": "#ddcca7ff",
"scrollbar.thumb.border": "#ddcca7ff",
"scrollbar.track.background": "#00000000",
@@ -1912,11 +1912,11 @@
"tab_bar.background": "#ecdcb3ff",
"tab.inactive_background": "#ecdcb3ff",
"tab.active_background": "#f2e5bcff",
"search.match_background": null,
"search.match_background": "#0b667866",
"panel.background": "#ecdcb3ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#2828284c",
"scrollbar.thumb.background": "#2828284c",
"scrollbar.thumb.hover_background": "#ddcca7ff",
"scrollbar.thumb.border": "#ddcca7ff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#2f343eff",
"tab.inactive_background": "#2f343eff",
"tab.active_background": "#282c33ff",
"search.match_background": null,
"search.match_background": "#74ade866",
"panel.background": "#2f343eff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#c8ccd44c",
"scrollbar.thumb.background": "#c8ccd44c",
"scrollbar.thumb.hover_background": "#363c46ff",
"scrollbar.thumb.border": "#363c46ff",
"scrollbar.track.background": "#00000000",
@@ -416,11 +416,11 @@
"tab_bar.background": "#ebebecff",
"tab.inactive_background": "#ebebecff",
"tab.active_background": "#fafafaff",
"search.match_background": null,
"search.match_background": "#5c79e266",
"panel.background": "#ebebecff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#383a414c",
"scrollbar.thumb.background": "#383a414c",
"scrollbar.thumb.hover_background": "#dfdfe0ff",
"scrollbar.thumb.border": "#dfdfe0ff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#1c1b2aff",
"tab.inactive_background": "#1c1b2aff",
"tab.active_background": "#191724ff",
"search.match_background": null,
"search.match_background": "#57949f66",
"panel.background": "#1c1b2aff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#e0def44c",
"scrollbar.thumb.background": "#e0def44c",
"scrollbar.thumb.hover_background": "#232132ff",
"scrollbar.thumb.border": "#232132ff",
"scrollbar.track.background": "#00000000",
@@ -421,11 +421,11 @@
"tab_bar.background": "#fef9f2ff",
"tab.inactive_background": "#fef9f2ff",
"tab.active_background": "#faf4edff",
"search.match_background": null,
"search.match_background": "#9cced766",
"panel.background": "#fef9f2ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#5752794c",
"scrollbar.thumb.background": "#5752794c",
"scrollbar.thumb.hover_background": "#e5e0dfff",
"scrollbar.thumb.border": "#e5e0dfff",
"scrollbar.track.background": "#00000000",
@@ -800,11 +800,11 @@
"tab_bar.background": "#28253cff",
"tab.inactive_background": "#28253cff",
"tab.active_background": "#232136ff",
"search.match_background": null,
"search.match_background": "#9cced766",
"panel.background": "#28253cff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#e0def44c",
"scrollbar.thumb.background": "#e0def44c",
"scrollbar.thumb.hover_background": "#322f48ff",
"scrollbar.thumb.border": "#322f48ff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#2b3038ff",
"tab.inactive_background": "#2b3038ff",
"tab.active_background": "#282c33ff",
"search.match_background": null,
"search.match_background": "#528b8b66",
"panel.background": "#2b3038ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#fdf4c14c",
"scrollbar.thumb.background": "#fdf4c14c",
"scrollbar.thumb.hover_background": "#313741ff",
"scrollbar.thumb.border": "#313741ff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#04313bff",
"tab.inactive_background": "#04313bff",
"tab.active_background": "#002a35ff",
"search.match_background": null,
"search.match_background": "#288bd166",
"panel.background": "#04313bff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#fdf6e34c",
"scrollbar.thumb.background": "#fdf6e34c",
"scrollbar.thumb.hover_background": "#053541ff",
"scrollbar.thumb.border": "#053541ff",
"scrollbar.track.background": "#00000000",
@@ -411,11 +411,11 @@
"tab_bar.background": "#f3eddaff",
"tab.inactive_background": "#f3eddaff",
"tab.active_background": "#fdf6e3ff",
"search.match_background": null,
"search.match_background": "#298bd166",
"panel.background": "#f3eddaff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#002a354c",
"scrollbar.thumb.background": "#002a354c",
"scrollbar.thumb.hover_background": "#dcdacbff",
"scrollbar.thumb.border": "#dcdacbff",
"scrollbar.track.background": "#00000000",

View File

@@ -42,11 +42,11 @@
"tab_bar.background": "#231f16ff",
"tab.inactive_background": "#231f16ff",
"tab.active_background": "#1b1810ff",
"search.match_background": null,
"search.match_background": "#499bef66",
"panel.background": "#231f16ff",
"panel.focused_border": null,
"pane.focused_border": null,
"scrollbar_thumb.background": "#f8f5de4c",
"scrollbar.thumb.background": "#f8f5de4c",
"scrollbar.thumb.hover_background": "#29251bff",
"scrollbar.thumb.border": "#29251bff",
"scrollbar.track.background": "#00000000",

View File

@@ -11,18 +11,16 @@ doctest = false
[dependencies]
anyhow.workspace = true
auto_update = { path = "../auto_update" }
editor = { path = "../editor" }
auto_update.workspace = true
editor.workspace = true
futures.workspace = true
gpui = { path = "../gpui" }
language = { path = "../language" }
project = { path = "../project" }
settings = { path = "../settings" }
gpui.workspace = true
language.workspace = true
project.workspace = true
smallvec.workspace = true
theme = { path = "../theme" }
ui = { path = "../ui" }
util = { path = "../util" }
workspace = { path = "../workspace", package = "workspace" }
ui.workspace = true
util.workspace = true
workspace.workspace = true
[dev-dependencies]
editor = { path = "../editor", features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }

View File

@@ -17,9 +17,9 @@ anyhow.workspace = true
async-trait.workspace = true
bincode = "1.3.3"
futures.workspace = true
gpui = { path = "../gpui" }
gpui.workspace = true
isahc.workspace = true
language = { path = "../language" }
language.workspace = true
lazy_static.workspace = true
log.workspace = true
matrixmultiply = "0.3.7"
@@ -28,12 +28,11 @@ parking_lot.workspace = true
parse_duration = "2.1.1"
postage.workspace = true
rand.workspace = true
regex.workspace = true
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
serde.workspace = true
serde_json.workspace = true
tiktoken-rs.workspace = true
util = { path = "../util" }
util.workspace = true
[dev-dependencies]
gpui = { path = "../gpui", features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }

View File

@@ -103,6 +103,7 @@ pub struct OpenAiResponseStreamEvent {
}
pub async fn stream_completion(
api_url: String,
credential: ProviderCredential,
executor: BackgroundExecutor,
request: Box<dyn CompletionRequest>,
@@ -117,7 +118,7 @@ pub async fn stream_completion(
let (tx, rx) = futures::channel::mpsc::unbounded::<Result<OpenAiResponseStreamEvent>>();
let json_data = request.data()?;
let mut response = Request::post(format!("{OPEN_AI_API_URL}/chat/completions"))
let mut response = Request::post(format!("{api_url}/chat/completions"))
.header("Content-Type", "application/json")
.header("Authorization", format!("Bearer {}", api_key))
.body(json_data)?
@@ -195,18 +196,20 @@ pub async fn stream_completion(
#[derive(Clone)]
pub struct OpenAiCompletionProvider {
api_url: String,
model: OpenAiLanguageModel,
credential: Arc<RwLock<ProviderCredential>>,
executor: BackgroundExecutor,
}
impl OpenAiCompletionProvider {
pub async fn new(model_name: String, executor: BackgroundExecutor) -> Self {
pub async fn new(api_url: String, model_name: String, executor: BackgroundExecutor) -> Self {
let model = executor
.spawn(async move { OpenAiLanguageModel::load(&model_name) })
.await;
let credential = Arc::new(RwLock::new(ProviderCredential::NoCredentials));
Self {
api_url,
model,
credential,
executor,
@@ -303,7 +306,8 @@ impl CompletionProvider for OpenAiCompletionProvider {
// which is currently model based, due to the language model.
// At some point in the future we should rectify this.
let credential = self.credential.read().clone();
let request = stream_completion(credential, self.executor.clone(), prompt);
let api_url = self.api_url.clone();
let request = stream_completion(api_url, credential, self.executor.clone(), prompt);
async move {
let response = request.await?;
let stream = response

View File

@@ -35,6 +35,7 @@ lazy_static! {
#[derive(Clone)]
pub struct OpenAiEmbeddingProvider {
api_url: String,
model: OpenAiLanguageModel,
credential: Arc<RwLock<ProviderCredential>>,
pub client: Arc<dyn HttpClient>,
@@ -69,7 +70,11 @@ struct OpenAiEmbeddingUsage {
}
impl OpenAiEmbeddingProvider {
pub async fn new(client: Arc<dyn HttpClient>, executor: BackgroundExecutor) -> Self {
pub async fn new(
api_url: String,
client: Arc<dyn HttpClient>,
executor: BackgroundExecutor,
) -> Self {
let (rate_limit_count_tx, rate_limit_count_rx) = watch::channel_with(None);
let rate_limit_count_tx = Arc::new(Mutex::new(rate_limit_count_tx));
@@ -80,6 +85,7 @@ impl OpenAiEmbeddingProvider {
let credential = Arc::new(RwLock::new(ProviderCredential::NoCredentials));
OpenAiEmbeddingProvider {
api_url,
model,
credential,
client,
@@ -130,11 +136,12 @@ impl OpenAiEmbeddingProvider {
}
async fn send_request(
&self,
api_url: &str,
api_key: &str,
spans: Vec<&str>,
request_timeout: u64,
) -> Result<Response<AsyncBody>> {
let request = Request::post("https://api.openai.com/v1/embeddings")
let request = Request::post(format!("{api_url}/embeddings"))
.redirect_policy(isahc::config::RedirectPolicy::Follow)
.timeout(Duration::from_secs(request_timeout))
.header("Content-Type", "application/json")
@@ -246,6 +253,7 @@ impl EmbeddingProvider for OpenAiEmbeddingProvider {
const BACKOFF_SECONDS: [usize; 4] = [3, 5, 15, 45];
const MAX_RETRIES: usize = 4;
let api_url = self.api_url.as_str();
let api_key = self.get_api_key()?;
let mut request_number = 0;
@@ -255,6 +263,7 @@ impl EmbeddingProvider for OpenAiEmbeddingProvider {
while request_number < MAX_RETRIES {
response = self
.send_request(
&api_url,
&api_key,
spans.iter().map(|x| &**x).collect(),
request_timeout,

View File

@@ -7,5 +7,5 @@ license = "GPL-3.0-or-later"
[dependencies]
anyhow.workspace = true
gpui = { path = "../gpui" }
gpui.workspace = true
rust-embed.workspace = true

View File

@@ -10,44 +10,45 @@ path = "src/assistant.rs"
doctest = false
[dependencies]
ai = { path = "../ai" }
ai.workspace = true
anyhow.workspace = true
chrono.workspace = true
client = { path = "../client" }
collections = { path = "../collections" }
editor = { path = "../editor" }
fs = { path = "../fs" }
client.workspace = true
collections.workspace = true
editor.workspace = true
fs.workspace = true
futures.workspace = true
gpui = { path = "../gpui" }
gpui.workspace = true
indoc.workspace = true
isahc.workspace = true
language = { path = "../language" }
language.workspace = true
log.workspace = true
menu = { path = "../menu" }
multi_buffer = { path = "../multi_buffer" }
menu.workspace = true
multi_buffer.workspace = true
ordered-float.workspace = true
parking_lot.workspace = true
project = { path = "../project" }
project.workspace = true
regex.workspace = true
schemars.workspace = true
search = { path = "../search" }
semantic_index = { path = "../semantic_index" }
search.workspace = true
semantic_index.workspace = true
serde.workspace = true
serde_json.workspace = true
settings = { path = "../settings" }
settings.workspace = true
smol.workspace = true
theme = { path = "../theme" }
telemetry_events.workspace = true
theme.workspace = true
tiktoken-rs.workspace = true
ui = { path = "../ui" }
util = { path = "../util" }
ui.workspace = true
util.workspace = true
uuid.workspace = true
workspace = { path = "../workspace" }
workspace.workspace = true
[dev-dependencies]
ai = { path = "../ai", features = ["test-support"] }
ai = { workspace = true, features = ["test-support"] }
ctor.workspace = true
editor = { path = "../editor", features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }
env_logger.workspace = true
log.workspace = true
project = { path = "../project", features = ["test-support"] }
project = { workspace = true, features = ["test-support"] }
rand.workspace = true

View File

@@ -1,5 +1,5 @@
pub mod assistant_panel;
mod assistant_settings;
pub mod assistant_settings;
mod codegen;
mod prompts;
mod streaming_diff;
@@ -68,6 +68,7 @@ struct SavedConversation {
messages: Vec<SavedMessage>,
message_metadata: HashMap<MessageId, MessageMetadata>,
summary: String,
api_url: Option<String>,
model: OpenAiModel,
}

View File

@@ -7,6 +7,7 @@ use crate::{
SavedMessage, Split, ToggleFocus, ToggleIncludeConversation, ToggleRetrieveContext,
};
use ai::prompts::repository_context::PromptCodeSnippet;
use ai::providers::open_ai::OPEN_AI_API_URL;
use ai::{
auth::ProviderCredential,
completion::{CompletionProvider, CompletionRequest},
@@ -14,7 +15,6 @@ use ai::{
};
use anyhow::{anyhow, Result};
use chrono::{DateTime, Local};
use client::telemetry::AssistantKind;
use collections::{hash_map, HashMap, HashSet, VecDeque};
use editor::{
actions::{MoveDown, MoveUp},
@@ -51,6 +51,7 @@ use std::{
sync::Arc,
time::{Duration, Instant},
};
use telemetry_events::AssistantKind;
use theme::ThemeSettings;
use ui::{
prelude::*,
@@ -121,10 +122,19 @@ impl AssistantPanel {
.await
.log_err()
.unwrap_or_default();
// Defaulting currently to GPT4, allow for this to be set via config.
let completion_provider =
OpenAiCompletionProvider::new("gpt-4".into(), cx.background_executor().clone())
.await;
let (api_url, model_name) = cx.update(|cx| {
let settings = AssistantSettings::get_global(cx);
(
settings.openai_api_url.clone(),
settings.default_open_ai_model.full_name().to_string(),
)
})?;
let completion_provider = OpenAiCompletionProvider::new(
api_url,
model_name,
cx.background_executor().clone(),
)
.await;
// TODO: deserialize state.
let workspace_handle = workspace.clone();
@@ -352,7 +362,7 @@ impl AssistantPanel {
move |cx: &mut BlockContext| {
measurements.set(BlockMeasurements {
anchor_x: cx.anchor_x,
gutter_width: cx.gutter_width,
gutter_width: cx.gutter_dimensions.width,
});
inline_assistant.clone().into_any_element()
}
@@ -962,6 +972,7 @@ impl AssistantPanel {
line_height: relative(1.3).into(),
background_color: None,
underline: None,
strikethrough: None,
white_space: WhiteSpace::Normal,
};
EditorElement::new(
@@ -1406,6 +1417,7 @@ struct Conversation {
completion_count: usize,
pending_completions: Vec<PendingCompletion>,
model: OpenAiModel,
api_url: Option<String>,
token_count: Option<usize>,
max_token_count: usize,
pending_token_count: Task<Option<()>>,
@@ -1440,6 +1452,7 @@ impl Conversation {
let settings = AssistantSettings::get_global(cx);
let model = settings.default_open_ai_model.clone();
let api_url = settings.openai_api_url.clone();
let mut this = Self {
id: Some(Uuid::new_v4().to_string()),
@@ -1453,6 +1466,7 @@ impl Conversation {
token_count: None,
max_token_count: tiktoken_rs::model::get_context_size(&model.full_name()),
pending_token_count: Task::ready(None),
api_url: Some(api_url),
model: model.clone(),
_subscriptions: vec![cx.subscribe(&buffer, Self::handle_buffer_event)],
pending_save: Task::ready(Ok(())),
@@ -1498,6 +1512,7 @@ impl Conversation {
.map(|summary| summary.text.clone())
.unwrap_or_default(),
model: self.model.clone(),
api_url: self.api_url.clone(),
}
}
@@ -1512,8 +1527,12 @@ impl Conversation {
None => Some(Uuid::new_v4().to_string()),
};
let model = saved_conversation.model;
let api_url = saved_conversation.api_url;
let completion_provider: Arc<dyn CompletionProvider> = Arc::new(
OpenAiCompletionProvider::new(
api_url
.clone()
.unwrap_or_else(|| OPEN_AI_API_URL.to_string()),
model.full_name().into(),
cx.background_executor().clone(),
)
@@ -1566,6 +1585,7 @@ impl Conversation {
token_count: None,
max_token_count: tiktoken_rs::model::get_context_size(&model.full_name()),
pending_token_count: Task::ready(None),
api_url,
model,
_subscriptions: vec![cx.subscribe(&buffer, Self::handle_buffer_event)],
pending_save: Task::ready(Ok(())),
@@ -3166,6 +3186,7 @@ impl InlineAssistant {
line_height: relative(1.3).into(),
background_color: None,
underline: None,
strikethrough: None,
white_space: WhiteSpace::Normal,
};
EditorElement::new(

View File

@@ -55,6 +55,7 @@ pub struct AssistantSettings {
pub default_width: Pixels,
pub default_height: Pixels,
pub default_open_ai_model: OpenAiModel,
pub openai_api_url: String,
}
/// Assistant panel settings
@@ -80,6 +81,10 @@ pub struct AssistantSettingsContent {
///
/// Default: gpt-4-1106-preview
pub default_open_ai_model: Option<OpenAiModel>,
/// OpenAI API base URL to use when starting new conversations.
///
/// Default: https://api.openai.com/v1
pub openai_api_url: Option<String>,
}
impl Settings for AssistantSettings {

View File

@@ -366,7 +366,8 @@ mod tests {
use gpui::{Context, TestAppContext};
use indoc::indoc;
use language::{
language_settings, tree_sitter_rust, Buffer, BufferId, Language, LanguageConfig, Point,
language_settings, tree_sitter_rust, Buffer, BufferId, Language, LanguageConfig,
LanguageMatcher, Point,
};
use rand::prelude::*;
use serde::Serialize;
@@ -675,7 +676,10 @@ mod tests {
Language::new(
LanguageConfig {
name: "Rust".into(),
path_suffixes: vec!["rs".to_string()],
matcher: LanguageMatcher {
path_suffixes: vec!["rs".to_string()],
..Default::default()
},
..Default::default()
},
Some(tree_sitter_rust::language()),

View File

@@ -172,22 +172,24 @@ pub fn generate_content_prompt(
#[cfg(test)]
pub(crate) mod tests {
use super::*;
use std::sync::Arc;
use gpui::{AppContext, Context};
use indoc::indoc;
use language::{
language_settings, tree_sitter_rust, Buffer, BufferId, Language, LanguageConfig, Point,
language_settings, tree_sitter_rust, Buffer, BufferId, Language, LanguageConfig,
LanguageMatcher, Point,
};
use settings::SettingsStore;
use std::sync::Arc;
pub(crate) fn rust_lang() -> Language {
Language::new(
LanguageConfig {
name: "Rust".into(),
path_suffixes: vec!["rs".to_string()],
matcher: LanguageMatcher {
path_suffixes: vec!["rs".to_string()],
..Default::default()
},
..Default::default()
},
Some(tree_sitter_rust::language()),

View File

@@ -11,11 +11,9 @@ doctest = false
[dependencies]
anyhow.workspace = true
collections = { path = "../collections" }
collections.workspace = true
derive_more.workspace = true
futures.workspace = true
gpui = { path = "../gpui" }
log.workspace = true
gpui.workspace = true
parking_lot.workspace = true
rodio = { version = "0.17.1", default-features = false, features = ["wav"] }
util = { path = "../util" }
util.workspace = true

View File

@@ -11,22 +11,21 @@ doctest = false
[dependencies]
anyhow.workspace = true
client = { path = "../client" }
db = { path = "../db" }
gpui = { path = "../gpui" }
client.workspace = true
db.workspace = true
editor.workspace = true
gpui.workspace = true
isahc.workspace = true
lazy_static.workspace = true
log.workspace = true
menu = { path = "../menu" }
project = { path = "../project" }
release_channel = { path = "../release_channel" }
markdown_preview.workspace = true
menu.workspace = true
release_channel.workspace = true
schemars.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
settings = { path = "../settings" }
settings.workspace = true
smol.workspace = true
tempfile.workspace = true
theme = { path = "../theme" }
util = { path = "../util" }
workspace = { path = "../workspace" }
util.workspace = true
workspace.workspace = true

View File

@@ -4,12 +4,14 @@ use anyhow::{anyhow, Context, Result};
use client::{Client, TelemetrySettings, ZED_APP_PATH};
use db::kvp::KEY_VALUE_STORE;
use db::RELEASE_CHANNEL;
use editor::{Editor, MultiBuffer};
use gpui::{
actions, AppContext, AsyncAppContext, Context as _, Global, Model, ModelContext,
SemanticVersion, Task, ViewContext, VisualContext, WindowContext,
SemanticVersion, SharedString, Task, View, ViewContext, VisualContext, WindowContext,
};
use isahc::AsyncBody;
use markdown_preview::markdown_preview_view::MarkdownPreviewView;
use schemars::JsonSchema;
use serde::Deserialize;
use serde_derive::Serialize;
@@ -26,13 +28,24 @@ use std::{
time::Duration,
};
use update_notification::UpdateNotification;
use util::http::{HttpClient, ZedHttpClient};
use util::{
http::{HttpClient, HttpClientWithUrl},
ResultExt,
};
use workspace::Workspace;
const SHOULD_SHOW_UPDATE_NOTIFICATION_KEY: &str = "auto-updater-should-show-updated-notification";
const POLL_INTERVAL: Duration = Duration::from_secs(60 * 60);
actions!(auto_update, [Check, DismissErrorMessage, ViewReleaseNotes]);
actions!(
auto_update,
[
Check,
DismissErrorMessage,
ViewReleaseNotes,
ViewReleaseNotesLocally
]
);
#[derive(Serialize)]
struct UpdateRequestBody {
@@ -54,7 +67,7 @@ pub enum AutoUpdateStatus {
pub struct AutoUpdater {
status: AutoUpdateStatus,
current_version: SemanticVersion,
http_client: Arc<ZedHttpClient>,
http_client: Arc<HttpClientWithUrl>,
pending_poll: Option<Task<Option<()>>>,
}
@@ -96,7 +109,13 @@ struct GlobalAutoUpdate(Option<Model<AutoUpdater>>);
impl Global for GlobalAutoUpdate {}
pub fn init(http_client: Arc<ZedHttpClient>, cx: &mut AppContext) {
#[derive(Deserialize)]
struct ReleaseNotesBody {
title: String,
release_notes: String,
}
pub fn init(http_client: Arc<HttpClientWithUrl>, cx: &mut AppContext) {
AutoUpdateSetting::register(cx);
cx.observe_new_views(|workspace: &mut Workspace, _cx| {
@@ -105,6 +124,10 @@ pub fn init(http_client: Arc<ZedHttpClient>, cx: &mut AppContext) {
workspace.register_action(|_, action, cx| {
view_release_notes(action, cx);
});
workspace.register_action(|workspace, _: &ViewReleaseNotesLocally, cx| {
view_release_notes_locally(workspace, cx);
});
})
.detach();
@@ -158,13 +181,78 @@ pub fn view_release_notes(_: &ViewReleaseNotes, cx: &mut AppContext) -> Option<(
let current_version = auto_updater.current_version;
let url = &auto_updater
.http_client
.zed_url(&format!("/releases/{release_channel}/{current_version}"));
.build_url(&format!("/releases/{release_channel}/{current_version}"));
cx.open_url(&url);
}
None
}
fn view_release_notes_locally(workspace: &mut Workspace, cx: &mut ViewContext<Workspace>) {
let release_channel = ReleaseChannel::global(cx);
let version = env!("CARGO_PKG_VERSION");
let client = client::Client::global(cx).http_client();
let url = client.build_url(&format!(
"/api/release_notes/{}/{}",
release_channel.dev_name(),
version
));
let markdown = workspace
.app_state()
.languages
.language_for_name("Markdown");
workspace
.with_local_workspace(cx, move |_, cx| {
cx.spawn(|workspace, mut cx| async move {
let markdown = markdown.await.log_err();
let response = client.get(&url, Default::default(), true).await;
let Some(mut response) = response.log_err() else {
return;
};
let mut body = Vec::new();
response.body_mut().read_to_end(&mut body).await.ok();
let body: serde_json::Result<ReleaseNotesBody> =
serde_json::from_slice(body.as_slice());
if let Ok(body) = body {
workspace
.update(&mut cx, |workspace, cx| {
let project = workspace.project().clone();
let buffer = project
.update(cx, |project, cx| project.create_buffer("", markdown, cx))
.expect("creating buffers on a local workspace always succeeds");
buffer.update(cx, |buffer, cx| {
buffer.edit([(0..0, body.release_notes)], None, cx)
});
let buffer = cx.new_model(|cx| MultiBuffer::singleton(buffer, cx));
let tab_description = SharedString::from(body.title.to_string());
let editor = cx
.new_view(|cx| Editor::for_multibuffer(buffer, Some(project), cx));
let workspace_handle = workspace.weak_handle();
let view: View<MarkdownPreviewView> = MarkdownPreviewView::new(
editor,
workspace_handle,
Some(tab_description),
cx,
);
workspace.add_item(Box::new(view.clone()), cx);
cx.notify();
})
.log_err();
}
})
.detach();
})
.detach();
}
pub fn notify_of_any_new_update(cx: &mut ViewContext<Workspace>) -> Option<()> {
let updater = AutoUpdater::get(cx)?;
let version = updater.read(cx).current_version;
@@ -195,7 +283,7 @@ impl AutoUpdater {
cx.default_global::<GlobalAutoUpdate>().0.clone()
}
fn new(current_version: SemanticVersion, http_client: Arc<ZedHttpClient>) -> Self {
fn new(current_version: SemanticVersion, http_client: Arc<HttpClientWithUrl>) -> Self {
Self {
status: AutoUpdateStatus::Idle,
current_version,
@@ -249,7 +337,7 @@ impl AutoUpdater {
(this.http_client.clone(), this.current_version)
})?;
let mut url_string = client.zed_url(&format!(
let mut url_string = client.build_url(&format!(
"/api/releases/latest?asset=Zed.dmg&os={}&arch={}",
OS, ARCH
));

View File

@@ -10,20 +10,15 @@ path = "src/breadcrumbs.rs"
doctest = false
[dependencies]
collections = { path = "../collections" }
editor = { path = "../editor" }
gpui = { path = "../gpui" }
itertools = "0.10"
language = { path = "../language" }
outline = { path = "../outline" }
project = { path = "../project" }
search = { path = "../search" }
settings = { path = "../settings" }
theme = { path = "../theme" }
ui = { path = "../ui" }
workspace = { path = "../workspace" }
editor.workspace = true
gpui.workspace = true
itertools.workspace = true
outline.workspace = true
theme.workspace = true
ui.workspace = true
workspace.workspace = true
[dev-dependencies]
editor = { path = "../editor", features = ["test-support"] }
gpui = { path = "../gpui", features = ["test-support"] }
workspace = { path = "../workspace", features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
workspace = { workspace = true, features = ["test-support"] }

View File

@@ -21,34 +21,29 @@ test-support = [
[dependencies]
anyhow.workspace = true
async-broadcast = "0.4"
audio = { path = "../audio" }
client = { path = "../client" }
collections = { path = "../collections" }
fs = { path = "../fs" }
audio.workspace = true
client.workspace = true
collections.workspace = true
fs.workspace = true
futures.workspace = true
gpui = { path = "../gpui" }
image = "0.23"
language = { path = "../language" }
live_kit_client = { path = "../live_kit_client" }
gpui.workspace = true
language.workspace = true
live_kit_client.workspace = true
log.workspace = true
media = { path = "../media" }
postage.workspace = true
project = { path = "../project" }
project.workspace = true
schemars.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
settings = { path = "../settings" }
smallvec.workspace = true
util = { path = "../util" }
settings.workspace = true
util.workspace = true
[dev-dependencies]
client = { path = "../client", features = ["test-support"] }
collections = { path = "../collections", features = ["test-support"] }
fs = { path = "../fs", features = ["test-support"] }
gpui = { path = "../gpui", features = ["test-support"] }
language = { path = "../language", features = ["test-support"] }
live_kit_client = { path = "../live_kit_client", features = ["test-support"] }
project = { path = "../project", features = ["test-support"] }
util = { path = "../util", features = ["test-support"] }
client = { workspace = true, features = ["test-support"] }
collections = { workspace = true, features = ["test-support"] }
fs = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
language = { workspace = true, features = ["test-support"] }
live_kit_client = { workspace = true, features = ["test-support"] }
project = { workspace = true, features = ["test-support"] }
util = { workspace = true, features = ["test-support"] }

View File

@@ -5,7 +5,7 @@ pub mod room;
use anyhow::{anyhow, Result};
use audio::Audio;
use call_settings::CallSettings;
use client::{proto, Client, TypedEnvelope, User, UserStore, ZED_ALWAYS_ACTIVE};
use client::{proto, ChannelId, Client, TypedEnvelope, User, UserStore, ZED_ALWAYS_ACTIVE};
use collections::HashSet;
use futures::{channel::oneshot, future::Shared, Future, FutureExt};
use gpui::{
@@ -107,7 +107,7 @@ impl ActiveCall {
}
}
pub fn channel_id(&self, cx: &AppContext) -> Option<u64> {
pub fn channel_id(&self, cx: &AppContext) -> Option<ChannelId> {
self.room()?.read(cx).channel_id()
}
@@ -336,7 +336,7 @@ impl ActiveCall {
pub fn join_channel(
&mut self,
channel_id: u64,
channel_id: ChannelId,
cx: &mut ModelContext<Self>,
) -> Task<Result<Option<Model<Room>>>> {
if let Some(room) = self.room().cloned() {
@@ -487,7 +487,7 @@ impl ActiveCall {
pub fn report_call_event_for_room(
operation: &'static str,
room_id: u64,
channel_id: Option<u64>,
channel_id: Option<ChannelId>,
client: &Arc<Client>,
) {
let telemetry = client.telemetry();
@@ -497,7 +497,7 @@ pub fn report_call_event_for_room(
pub fn report_call_event_for_channel(
operation: &'static str,
channel_id: u64,
channel_id: ChannelId,
client: &Arc<Client>,
cx: &AppContext,
) {

View File

@@ -6,7 +6,7 @@ use anyhow::{anyhow, Result};
use audio::{Audio, Sound};
use client::{
proto::{self, PeerId},
Client, ParticipantIndex, TypedEnvelope, User, UserStore,
ChannelId, Client, ParticipantIndex, TypedEnvelope, User, UserStore,
};
use collections::{BTreeMap, HashMap, HashSet};
use fs::Fs;
@@ -27,7 +27,7 @@ pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Event {
RoomJoined {
channel_id: Option<u64>,
channel_id: Option<ChannelId>,
},
ParticipantLocationChanged {
participant_id: proto::PeerId,
@@ -53,13 +53,13 @@ pub enum Event {
project_id: u64,
},
Left {
channel_id: Option<u64>,
channel_id: Option<ChannelId>,
},
}
pub struct Room {
id: u64,
channel_id: Option<u64>,
channel_id: Option<ChannelId>,
live_kit: Option<LiveKitRoom>,
status: RoomStatus,
shared_projects: HashSet<WeakModel<Project>>,
@@ -84,7 +84,7 @@ pub struct Room {
impl EventEmitter<Event> for Room {}
impl Room {
pub fn channel_id(&self) -> Option<u64> {
pub fn channel_id(&self) -> Option<ChannelId> {
self.channel_id
}
@@ -106,7 +106,7 @@ impl Room {
fn new(
id: u64,
channel_id: Option<u64>,
channel_id: Option<ChannelId>,
live_kit_connection_info: Option<proto::LiveKitConnectionInfo>,
client: Arc<Client>,
user_store: Model<UserStore>,
@@ -156,7 +156,7 @@ impl Room {
cx.spawn(|this, mut cx| async move {
connect.await?;
this.update(&mut cx, |this, cx| {
if !this.read_only() {
if this.can_use_microphone() {
if let Some(live_kit) = &this.live_kit {
if !live_kit.muted_by_user && !live_kit.deafened {
return this.share_microphone(cx);
@@ -273,13 +273,17 @@ impl Room {
}
pub(crate) async fn join_channel(
channel_id: u64,
channel_id: ChannelId,
client: Arc<Client>,
user_store: Model<UserStore>,
cx: AsyncAppContext,
) -> Result<Model<Self>> {
Self::from_join_response(
client.request(proto::JoinChannel { channel_id }).await?,
client
.request(proto::JoinChannel {
channel_id: channel_id.0,
})
.await?,
client,
user_store,
cx,
@@ -337,7 +341,7 @@ impl Room {
let room = cx.new_model(|cx| {
Self::new(
room_proto.id,
response.channel_id,
response.channel_id.map(ChannelId),
response.live_kit_connection_info,
client,
user_store,
@@ -1322,11 +1326,6 @@ impl Room {
})
}
pub fn read_only(&self) -> bool {
!(self.local_participant().role == proto::ChannelRole::Member
|| self.local_participant().role == proto::ChannelRole::Admin)
}
pub fn is_speaking(&self) -> bool {
self.live_kit
.as_ref()
@@ -1337,6 +1336,22 @@ impl Room {
self.live_kit.as_ref().map(|live_kit| live_kit.deafened)
}
pub fn can_use_microphone(&self) -> bool {
use proto::ChannelRole::*;
match self.local_participant.role {
Admin | Member | Talker => true,
Guest | Banned => false,
}
}
pub fn can_share_projects(&self) -> bool {
use proto::ChannelRole::*;
match self.local_participant.role {
Admin | Member => true,
Guest | Banned | Talker => false,
}
}
#[track_caller]
pub fn share_microphone(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
if self.status.is_offline() {

View File

@@ -14,42 +14,26 @@ test-support = ["collections/test-support", "gpui/test-support", "rpc/test-suppo
[dependencies]
anyhow.workspace = true
client = { path = "../client" }
clock = { path = "../clock" }
collections = { path = "../collections" }
db = { path = "../db" }
feature_flags = { path = "../feature_flags" }
client.workspace = true
clock.workspace = true
collections.workspace = true
futures.workspace = true
gpui = { path = "../gpui" }
image = "0.23"
language = { path = "../language" }
lazy_static.workspace = true
gpui.workspace = true
language.workspace = true
log.workspace = true
parking_lot.workspace = true
postage.workspace = true
rand.workspace = true
release_channel = { path = "../release_channel" }
rpc = { path = "../rpc" }
schemars.workspace = true
serde.workspace = true
serde_derive.workspace = true
settings = { path = "../settings" }
smallvec.workspace = true
smol.workspace = true
sum_tree = { path = "../sum_tree" }
tempfile.workspace = true
text = { path = "../text" }
thiserror.workspace = true
release_channel.workspace = true
rpc.workspace = true
settings.workspace = true
sum_tree.workspace = true
text.workspace = true
time.workspace = true
tiny_http = "0.8"
url.workspace = true
util = { path = "../util" }
uuid.workspace = true
util.workspace = true
[dev-dependencies]
collections = { path = "../collections", features = ["test-support"] }
gpui = { path = "../gpui", features = ["test-support"] }
rpc = { path = "../rpc", features = ["test-support"] }
client = { path = "../client", features = ["test-support"] }
settings = { path = "../settings", features = ["test-support"] }
util = { path = "../util", features = ["test-support"] }
collections = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
rpc = { workspace = true, features = ["test-support"] }
client = { workspace = true, features = ["test-support"] }
settings = { workspace = true, features = ["test-support"] }
util = { workspace = true, features = ["test-support"] }

View File

@@ -11,7 +11,7 @@ pub use channel_chat::{
mentions_to_proto, ChannelChat, ChannelChatEvent, ChannelMessage, ChannelMessageId,
MessageParams,
};
pub use channel_store::{Channel, ChannelEvent, ChannelId, ChannelMembership, ChannelStore};
pub use channel_store::{Channel, ChannelEvent, ChannelMembership, ChannelStore, HostedProjectId};
#[cfg(test)]
mod channel_store_tests;

View File

@@ -1,6 +1,6 @@
use crate::{Channel, ChannelId, ChannelStore};
use crate::{Channel, ChannelStore};
use anyhow::Result;
use client::{Client, Collaborator, UserStore, ZED_ALWAYS_ACTIVE};
use client::{ChannelId, Client, Collaborator, UserStore, ZED_ALWAYS_ACTIVE};
use collections::HashMap;
use gpui::{AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task};
use language::proto::serialize_version;
@@ -51,7 +51,7 @@ impl ChannelBuffer {
) -> Result<Model<Self>> {
let response = client
.request(proto::JoinChannelBuffer {
channel_id: channel.id,
channel_id: channel.id.0,
})
.await?;
let buffer_id = BufferId::new(response.buffer_id)?;
@@ -68,7 +68,7 @@ impl ChannelBuffer {
})?;
buffer.update(&mut cx, |buffer, cx| buffer.apply_ops(operations, cx))??;
let subscription = client.subscribe_to_entity(channel.id)?;
let subscription = client.subscribe_to_entity(channel.id.0)?;
anyhow::Ok(cx.new_model(|cx| {
cx.subscribe(&buffer, Self::on_buffer_update).detach();
@@ -97,7 +97,7 @@ impl ChannelBuffer {
}
self.client
.send(proto::LeaveChannelBuffer {
channel_id: self.channel_id,
channel_id: self.channel_id.0,
})
.log_err();
}
@@ -191,7 +191,7 @@ impl ChannelBuffer {
let operation = language::proto::serialize_operation(operation);
self.client
.send(proto::UpdateChannelBuffer {
channel_id: self.channel_id,
channel_id: self.channel_id.0,
operations: vec![operation],
})
.log_err();

View File

@@ -1,16 +1,17 @@
use crate::{Channel, ChannelId, ChannelStore};
use crate::{Channel, ChannelStore};
use anyhow::{anyhow, Result};
use client::{
proto,
user::{User, UserStore},
Client, Subscription, TypedEnvelope, UserId,
ChannelId, Client, Subscription, TypedEnvelope, UserId,
};
use collections::HashSet;
use futures::lock::Mutex;
use gpui::{AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task};
use gpui::{
AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task, WeakModel,
};
use rand::prelude::*;
use std::{
collections::HashSet,
mem,
ops::{ControlFlow, Range},
sync::Arc,
};
@@ -26,6 +27,7 @@ pub struct ChannelChat {
loaded_all_messages: bool,
last_acknowledged_id: Option<u64>,
next_pending_message_id: usize,
first_loaded_message_id: Option<u64>,
user_store: Model<UserStore>,
rpc: Arc<Client>,
outgoing_messages_lock: Arc<Mutex<()>>,
@@ -37,6 +39,7 @@ pub struct ChannelChat {
pub struct MessageParams {
pub text: String,
pub mentions: Vec<(Range<usize>, UserId)>,
pub reply_to_message_id: Option<u64>,
}
#[derive(Clone, Debug)]
@@ -47,6 +50,7 @@ pub struct ChannelMessage {
pub sender: Arc<User>,
pub nonce: u128,
pub mentions: Vec<(Range<usize>, UserId)>,
pub reply_to_message_id: Option<u64>,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -55,6 +59,15 @@ pub enum ChannelMessageId {
Pending(usize),
}
impl Into<Option<u64>> for ChannelMessageId {
fn into(self) -> Option<u64> {
match self {
ChannelMessageId::Saved(id) => Some(id),
ChannelMessageId::Pending(_) => None,
}
}
}
#[derive(Clone, Debug, Default)]
pub struct ChannelMessageSummary {
max_id: ChannelMessageId,
@@ -91,39 +104,48 @@ impl ChannelChat {
mut cx: AsyncAppContext,
) -> Result<Model<Self>> {
let channel_id = channel.id;
let subscription = client.subscribe_to_entity(channel_id).unwrap();
let subscription = client.subscribe_to_entity(channel_id.0).unwrap();
let response = client
.request(proto::JoinChannelChat { channel_id })
.request(proto::JoinChannelChat {
channel_id: channel_id.0,
})
.await?;
let messages = messages_from_proto(response.messages, &user_store, &mut cx).await?;
let loaded_all_messages = response.done;
Ok(cx.new_model(|cx| {
let handle = cx.new_model(|cx| {
cx.on_release(Self::release).detach();
let mut this = Self {
Self {
channel_id: channel.id,
user_store,
user_store: user_store.clone(),
channel_store,
rpc: client,
rpc: client.clone(),
outgoing_messages_lock: Default::default(),
messages: Default::default(),
acknowledged_message_ids: Default::default(),
loaded_all_messages,
loaded_all_messages: false,
next_pending_message_id: 0,
last_acknowledged_id: None,
rng: StdRng::from_entropy(),
first_loaded_message_id: None,
_subscription: subscription.set_model(&cx.handle(), &mut cx.to_async()),
};
this.insert_messages(messages, cx);
this
})?)
}
})?;
Self::handle_loaded_messages(
handle.downgrade(),
user_store,
client,
response.messages,
response.done,
&mut cx,
)
.await?;
Ok(handle)
}
fn release(&mut self, _: &mut AppContext) {
self.rpc
.send(proto::LeaveChannelChat {
channel_id: self.channel_id,
channel_id: self.channel_id.0,
})
.log_err();
}
@@ -166,6 +188,7 @@ impl ChannelChat {
timestamp: OffsetDateTime::now_utc(),
mentions: message.mentions.clone(),
nonce,
reply_to_message_id: message.reply_to_message_id,
},
&(),
),
@@ -179,10 +202,11 @@ impl ChannelChat {
Ok(cx.spawn(move |this, mut cx| async move {
let outgoing_message_guard = outgoing_messages_lock.lock().await;
let request = rpc.request(proto::SendChannelMessage {
channel_id,
channel_id: channel_id.0,
body: message.text,
nonce: Some(nonce.into()),
mentions: mentions_to_proto(&message.mentions),
reply_to_message_id: message.reply_to_message_id,
});
let response = request.await?;
drop(outgoing_message_guard);
@@ -198,7 +222,7 @@ impl ChannelChat {
pub fn remove_message(&mut self, id: u64, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
let response = self.rpc.request(proto::RemoveChannelMessage {
channel_id: self.channel_id,
channel_id: self.channel_id.0,
message_id: id,
});
cx.spawn(move |this, mut cx| async move {
@@ -223,16 +247,20 @@ impl ChannelChat {
async move {
let response = rpc
.request(proto::GetChannelMessages {
channel_id,
channel_id: channel_id.0,
before_message_id,
})
.await?;
let loaded_all_messages = response.done;
let messages = messages_from_proto(response.messages, &user_store, &mut cx).await?;
this.update(&mut cx, |this, cx| {
this.loaded_all_messages = loaded_all_messages;
this.insert_messages(messages, cx);
})?;
Self::handle_loaded_messages(
this,
user_store,
rpc,
response.messages,
response.done,
&mut cx,
)
.await?;
anyhow::Ok(())
}
.log_err()
@@ -240,9 +268,14 @@ impl ChannelChat {
}
pub fn first_loaded_message_id(&mut self) -> Option<u64> {
self.messages.first().and_then(|message| match message.id {
ChannelMessageId::Saved(id) => Some(id),
ChannelMessageId::Pending(_) => None,
self.first_loaded_message_id
}
/// Load a message by its id, if it's already stored locally.
pub fn find_loaded_message(&self, id: u64) -> Option<&ChannelMessage> {
self.messages.iter().find(|message| match message.id {
ChannelMessageId::Saved(message_id) => message_id == id,
ChannelMessageId::Pending(_) => false,
})
}
@@ -292,7 +325,7 @@ impl ChannelChat {
{
self.rpc
.send(proto::AckChannelMessage {
channel_id: self.channel_id,
channel_id: self.channel_id.0,
message_id: latest_message_id,
})
.ok();
@@ -304,44 +337,98 @@ impl ChannelChat {
}
}
async fn handle_loaded_messages(
this: WeakModel<Self>,
user_store: Model<UserStore>,
rpc: Arc<Client>,
proto_messages: Vec<proto::ChannelMessage>,
loaded_all_messages: bool,
cx: &mut AsyncAppContext,
) -> Result<()> {
let loaded_messages = messages_from_proto(proto_messages, &user_store, cx).await?;
let first_loaded_message_id = loaded_messages.first().map(|m| m.id);
let loaded_message_ids = this.update(cx, |this, _| {
let mut loaded_message_ids: HashSet<u64> = HashSet::default();
for message in loaded_messages.iter() {
if let Some(saved_message_id) = message.id.into() {
loaded_message_ids.insert(saved_message_id);
}
}
for message in this.messages.iter() {
if let Some(saved_message_id) = message.id.into() {
loaded_message_ids.insert(saved_message_id);
}
}
loaded_message_ids
})?;
let missing_ancestors = loaded_messages
.iter()
.filter_map(|message| {
if let Some(ancestor_id) = message.reply_to_message_id {
if !loaded_message_ids.contains(&ancestor_id) {
return Some(ancestor_id);
}
}
None
})
.collect::<Vec<_>>();
let loaded_ancestors = if missing_ancestors.is_empty() {
None
} else {
let response = rpc
.request(proto::GetChannelMessagesById {
message_ids: missing_ancestors,
})
.await?;
Some(messages_from_proto(response.messages, &user_store, cx).await?)
};
this.update(cx, |this, cx| {
this.first_loaded_message_id = first_loaded_message_id.and_then(|msg_id| msg_id.into());
this.loaded_all_messages = loaded_all_messages;
this.insert_messages(loaded_messages, cx);
if let Some(loaded_ancestors) = loaded_ancestors {
this.insert_messages(loaded_ancestors, cx);
}
})?;
Ok(())
}
pub fn rejoin(&mut self, cx: &mut ModelContext<Self>) {
let user_store = self.user_store.clone();
let rpc = self.rpc.clone();
let channel_id = self.channel_id;
cx.spawn(move |this, mut cx| {
async move {
let response = rpc.request(proto::JoinChannelChat { channel_id }).await?;
let messages = messages_from_proto(response.messages, &user_store, &mut cx).await?;
let loaded_all_messages = response.done;
let pending_messages = this.update(&mut cx, |this, cx| {
if let Some((first_new_message, last_old_message)) =
messages.first().zip(this.messages.last())
{
if first_new_message.id > last_old_message.id {
let old_messages = mem::take(&mut this.messages);
cx.emit(ChannelChatEvent::MessagesUpdated {
old_range: 0..old_messages.summary().count,
new_count: 0,
});
this.loaded_all_messages = loaded_all_messages;
}
}
this.insert_messages(messages, cx);
if loaded_all_messages {
this.loaded_all_messages = loaded_all_messages;
}
let response = rpc
.request(proto::JoinChannelChat {
channel_id: channel_id.0,
})
.await?;
Self::handle_loaded_messages(
this.clone(),
user_store.clone(),
rpc.clone(),
response.messages,
response.done,
&mut cx,
)
.await?;
let pending_messages = this.update(&mut cx, |this, _| {
this.pending_messages().cloned().collect::<Vec<_>>()
})?;
for pending_message in pending_messages {
let request = rpc.request(proto::SendChannelMessage {
channel_id,
channel_id: channel_id.0,
body: pending_message.body,
mentions: mentions_to_proto(&pending_message.mentions),
nonce: Some(pending_message.nonce.into()),
reply_to_message_id: pending_message.reply_to_message_id,
});
let response = request.await?;
let message = ChannelMessage::from_proto(
@@ -380,7 +467,7 @@ impl ChannelChat {
if self.acknowledged_message_ids.insert(id) {
self.rpc
.send(proto::AckChannelMessage {
channel_id: self.channel_id,
channel_id: self.channel_id.0,
message_id: id,
})
.ok();
@@ -553,6 +640,7 @@ impl ChannelMessage {
.nonce
.ok_or_else(|| anyhow!("nonce is required"))?
.into(),
reply_to_message_id: message.reply_to_message_id,
})
}
@@ -642,6 +730,7 @@ impl<'a> From<&'a str> for MessageParams {
Self {
text: value.into(),
mentions: Vec::new(),
reply_to_message_id: None,
}
}
}

View File

@@ -3,7 +3,7 @@ mod channel_index;
use crate::{channel_buffer::ChannelBuffer, channel_chat::ChannelChat, ChannelMessage};
use anyhow::{anyhow, Result};
use channel_index::ChannelIndex;
use client::{Client, Subscription, User, UserId, UserStore};
use client::{ChannelId, Client, Subscription, User, UserId, UserStore};
use collections::{hash_map, HashMap, HashSet};
use futures::{channel::mpsc, future::Shared, Future, FutureExt, StreamExt};
use gpui::{
@@ -19,15 +19,16 @@ use rpc::{
use std::{mem, sync::Arc, time::Duration};
use util::{async_maybe, maybe, ResultExt};
pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);
pub fn init(client: &Arc<Client>, user_store: Model<UserStore>, cx: &mut AppContext) {
let channel_store =
cx.new_model(|cx| ChannelStore::new(client.clone(), user_store.clone(), cx));
cx.set_global(GlobalChannelStore(channel_store));
}
pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);
pub type ChannelId = u64;
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub struct HostedProjectId(pub u64);
#[derive(Debug, Clone, Default)]
struct NotesVersion {
@@ -35,11 +36,31 @@ struct NotesVersion {
version: clock::Global,
}
#[derive(Debug, Clone)]
pub struct HostedProject {
id: HostedProjectId,
channel_id: ChannelId,
name: SharedString,
_visibility: proto::ChannelVisibility,
}
impl From<proto::HostedProject> for HostedProject {
fn from(project: proto::HostedProject) -> Self {
Self {
id: HostedProjectId(project.id),
channel_id: ChannelId(project.channel_id),
_visibility: project.visibility(),
name: project.name.into(),
}
}
}
pub struct ChannelStore {
pub channel_index: ChannelIndex,
channel_invitations: Vec<Arc<Channel>>,
channel_participants: HashMap<ChannelId, Vec<Arc<User>>>,
channel_states: HashMap<ChannelId, ChannelState>,
hosted_projects: HashMap<HostedProjectId, HostedProject>,
outgoing_invites: HashSet<(ChannelId, UserId)>,
update_channels_tx: mpsc::UnboundedSender<proto::UpdateChannels>,
@@ -58,7 +79,7 @@ pub struct Channel {
pub id: ChannelId,
pub name: SharedString,
pub visibility: proto::ChannelVisibility,
pub parent_path: Vec<u64>,
pub parent_path: Vec<ChannelId>,
}
#[derive(Default)]
@@ -68,6 +89,7 @@ pub struct ChannelState {
observed_chat_message: Option<u64>,
observed_notes_versions: Option<NotesVersion>,
role: Option<ChannelRole>,
projects: HashSet<HostedProjectId>,
}
impl Channel {
@@ -92,10 +114,7 @@ impl Channel {
}
pub fn root_id(&self) -> ChannelId {
self.parent_path
.first()
.map(|id| *id as ChannelId)
.unwrap_or(self.id)
self.parent_path.first().copied().unwrap_or(self.id)
}
pub fn slug(str: &str) -> String {
@@ -120,7 +139,8 @@ impl ChannelMembership {
proto::ChannelRole::Admin => 0,
proto::ChannelRole::Member => 1,
proto::ChannelRole::Banned => 2,
proto::ChannelRole::Guest => 3,
proto::ChannelRole::Talker => 3,
proto::ChannelRole::Guest => 4,
},
kind_order: match self.kind {
proto::channel_member::Kind::Member => 0,
@@ -198,6 +218,7 @@ impl ChannelStore {
channel_invitations: Vec::default(),
channel_index: ChannelIndex::default(),
channel_participants: Default::default(),
hosted_projects: Default::default(),
outgoing_invites: Default::default(),
opened_buffers: Default::default(),
opened_chats: Default::default(),
@@ -284,6 +305,19 @@ impl ChannelStore {
self.channel_index.by_id().get(&channel_id)
}
pub fn projects_for_id(&self, channel_id: ChannelId) -> Vec<(SharedString, HostedProjectId)> {
let mut projects: Vec<(SharedString, HostedProjectId)> = self
.channel_states
.get(&channel_id)
.map(|state| state.projects.clone())
.unwrap_or_default()
.into_iter()
.flat_map(|id| Some((self.hosted_projects.get(&id)?.name.clone(), id)))
.collect();
projects.sort();
projects
}
pub fn has_open_channel_buffer(&self, channel_id: ChannelId, _cx: &AppContext) -> bool {
if let Some(buffer) = self.opened_buffers.get(&channel_id) {
if let OpenedModelHandle::Open(buffer) = buffer {
@@ -348,6 +382,21 @@ impl ChannelStore {
.is_some_and(|state| state.has_new_messages())
}
pub fn last_acknowledge_message_id(&self, channel_id: ChannelId) -> Option<u64> {
self.channel_states.get(&channel_id).and_then(|state| {
if let Some(last_message_id) = state.latest_chat_message {
if state
.last_acknowledged_message_id()
.is_some_and(|id| id < last_message_id)
{
return state.last_acknowledged_message_id();
}
}
None
})
}
pub fn acknowledge_message_id(
&mut self,
channel_id: ChannelId,
@@ -546,13 +595,16 @@ impl ChannelStore {
let name = name.trim_start_matches("#").to_owned();
cx.spawn(move |this, mut cx| async move {
let response = client
.request(proto::CreateChannel { name, parent_id })
.request(proto::CreateChannel {
name,
parent_id: parent_id.map(|cid| cid.0),
})
.await?;
let channel = response
.channel
.ok_or_else(|| anyhow!("missing channel in response"))?;
let channel_id = channel.id;
let channel_id = ChannelId(channel.id);
this.update(&mut cx, |this, cx| {
let task = this.update_channels(
@@ -584,7 +636,10 @@ impl ChannelStore {
let client = self.client.clone();
cx.spawn(move |_, _| async move {
let _ = client
.request(proto::MoveChannel { channel_id, to })
.request(proto::MoveChannel {
channel_id: channel_id.0,
to: to.0,
})
.await?;
Ok(())
@@ -601,7 +656,7 @@ impl ChannelStore {
cx.spawn(move |_, _| async move {
let _ = client
.request(proto::SetChannelVisibility {
channel_id,
channel_id: channel_id.0,
visibility: visibility.into(),
})
.await?;
@@ -626,7 +681,7 @@ impl ChannelStore {
cx.spawn(move |this, mut cx| async move {
let result = client
.request(proto::InviteChannelMember {
channel_id,
channel_id: channel_id.0,
user_id,
role: role.into(),
})
@@ -658,7 +713,7 @@ impl ChannelStore {
cx.spawn(move |this, mut cx| async move {
let result = client
.request(proto::RemoveChannelMember {
channel_id,
channel_id: channel_id.0,
user_id,
})
.await;
@@ -688,7 +743,7 @@ impl ChannelStore {
cx.spawn(move |this, mut cx| async move {
let result = client
.request(proto::SetChannelMemberRole {
channel_id,
channel_id: channel_id.0,
user_id,
role: role.into(),
})
@@ -714,7 +769,10 @@ impl ChannelStore {
let name = new_name.to_string();
cx.spawn(move |this, mut cx| async move {
let channel = client
.request(proto::RenameChannel { channel_id, name })
.request(proto::RenameChannel {
channel_id: channel_id.0,
name,
})
.await?
.channel
.ok_or_else(|| anyhow!("missing channel in response"))?;
@@ -747,7 +805,10 @@ impl ChannelStore {
let client = self.client.clone();
cx.background_executor().spawn(async move {
client
.request(proto::RespondToChannelInvite { channel_id, accept })
.request(proto::RespondToChannelInvite {
channel_id: channel_id.0,
accept,
})
.await?;
Ok(())
})
@@ -762,7 +823,9 @@ impl ChannelStore {
let user_store = self.user_store.downgrade();
cx.spawn(move |_, mut cx| async move {
let response = client
.request(proto::GetChannelMembers { channel_id })
.request(proto::GetChannelMembers {
channel_id: channel_id.0,
})
.await?;
let user_ids = response.members.iter().map(|m| m.user_id).collect();
@@ -790,7 +853,11 @@ impl ChannelStore {
pub fn remove_channel(&self, channel_id: ChannelId) -> impl Future<Output = Result<()>> {
let client = self.client.clone();
async move {
client.request(proto::DeleteChannel { channel_id }).await?;
client
.request(proto::DeleteChannel {
channel_id: channel_id.0,
})
.await?;
Ok(())
}
}
@@ -827,19 +894,23 @@ impl ChannelStore {
for buffer_version in message.payload.observed_channel_buffer_version {
let version = language::proto::deserialize_version(&buffer_version.version);
this.acknowledge_notes_version(
buffer_version.channel_id,
ChannelId(buffer_version.channel_id),
buffer_version.epoch,
&version,
cx,
);
}
for message_id in message.payload.observed_channel_message_id {
this.acknowledge_message_id(message_id.channel_id, message_id.message_id, cx);
this.acknowledge_message_id(
ChannelId(message_id.channel_id),
message_id.message_id,
cx,
);
}
for membership in message.payload.channel_memberships {
if let Some(role) = ChannelRole::from_i32(membership.role) {
this.channel_states
.entry(membership.channel_id)
.entry(ChannelId(membership.channel_id))
.or_insert_with(|| ChannelState::default())
.set_role(role)
}
@@ -872,7 +943,7 @@ impl ChannelStore {
let channel_buffer = buffer.read(cx);
let buffer = channel_buffer.buffer().read(cx);
buffer_versions.push(proto::ChannelBufferVersion {
channel_id: channel_buffer.channel_id,
channel_id: channel_buffer.channel_id.0,
epoch: channel_buffer.epoch(),
version: language::proto::serialize_version(&buffer.version()),
});
@@ -903,7 +974,7 @@ impl ChannelStore {
if let Some(remote_buffer) = response
.buffers
.iter_mut()
.find(|buffer| buffer.channel_id == channel_id)
.find(|buffer| buffer.channel_id == channel_id.0)
{
let channel_id = channel_buffer.channel_id;
let remote_version =
@@ -939,7 +1010,7 @@ impl ChannelStore {
{
client
.send(proto::UpdateChannelBuffer {
channel_id,
channel_id: channel_id.0,
operations: chunk,
})
.ok();
@@ -994,12 +1065,12 @@ impl ChannelStore {
) -> Option<Task<Result<()>>> {
if !payload.remove_channel_invitations.is_empty() {
self.channel_invitations
.retain(|channel| !payload.remove_channel_invitations.contains(&channel.id));
.retain(|channel| !payload.remove_channel_invitations.contains(&channel.id.0));
}
for channel in payload.channel_invitations {
match self
.channel_invitations
.binary_search_by_key(&channel.id, |c| c.id)
.binary_search_by_key(&channel.id, |c| c.id.0)
{
Ok(ix) => {
Arc::make_mut(&mut self.channel_invitations[ix]).name = channel.name.into()
@@ -1007,10 +1078,14 @@ impl ChannelStore {
Err(ix) => self.channel_invitations.insert(
ix,
Arc::new(Channel {
id: channel.id,
id: ChannelId(channel.id),
visibility: channel.visibility(),
name: channel.name.into(),
parent_path: channel.parent_path,
parent_path: channel
.parent_path
.into_iter()
.map(|cid| ChannelId(cid))
.collect(),
}),
),
}
@@ -1019,20 +1094,27 @@ impl ChannelStore {
let channels_changed = !payload.channels.is_empty()
|| !payload.delete_channels.is_empty()
|| !payload.latest_channel_message_ids.is_empty()
|| !payload.latest_channel_buffer_versions.is_empty();
|| !payload.latest_channel_buffer_versions.is_empty()
|| !payload.hosted_projects.is_empty()
|| !payload.deleted_hosted_projects.is_empty();
if channels_changed {
if !payload.delete_channels.is_empty() {
self.channel_index.delete_channels(&payload.delete_channels);
let delete_channels: Vec<ChannelId> = payload
.delete_channels
.into_iter()
.map(|cid| ChannelId(cid))
.collect();
self.channel_index.delete_channels(&delete_channels);
self.channel_participants
.retain(|channel_id, _| !&payload.delete_channels.contains(channel_id));
.retain(|channel_id, _| !delete_channels.contains(&channel_id));
for channel_id in &payload.delete_channels {
for channel_id in &delete_channels {
let channel_id = *channel_id;
if payload
.channels
.iter()
.any(|channel| channel.id == channel_id)
.any(|channel| channel.id == channel_id.0)
{
continue;
}
@@ -1048,7 +1130,7 @@ impl ChannelStore {
let mut index = self.channel_index.bulk_insert();
for channel in payload.channels {
let id = channel.id;
let id = ChannelId(channel.id);
let channel_changed = index.insert(channel);
if channel_changed {
@@ -1063,17 +1145,45 @@ impl ChannelStore {
for latest_buffer_version in payload.latest_channel_buffer_versions {
let version = language::proto::deserialize_version(&latest_buffer_version.version);
self.channel_states
.entry(latest_buffer_version.channel_id)
.entry(ChannelId(latest_buffer_version.channel_id))
.or_default()
.update_latest_notes_version(latest_buffer_version.epoch, &version)
}
for latest_channel_message in payload.latest_channel_message_ids {
self.channel_states
.entry(latest_channel_message.channel_id)
.entry(ChannelId(latest_channel_message.channel_id))
.or_default()
.update_latest_message_id(latest_channel_message.message_id);
}
for hosted_project in payload.hosted_projects {
let hosted_project: HostedProject = hosted_project.into();
if let Some(old_project) = self
.hosted_projects
.insert(hosted_project.id, hosted_project.clone())
{
self.channel_states
.entry(old_project.channel_id)
.or_default()
.remove_hosted_project(old_project.id);
}
self.channel_states
.entry(hosted_project.channel_id)
.or_default()
.add_hosted_project(hosted_project.id);
}
for hosted_project_id in payload.deleted_hosted_projects {
let hosted_project_id = HostedProjectId(hosted_project_id);
if let Some(old_project) = self.hosted_projects.remove(&hosted_project_id) {
self.channel_states
.entry(old_project.channel_id)
.or_default()
.remove_hosted_project(old_project.id);
}
}
}
cx.notify();
@@ -1113,7 +1223,7 @@ impl ChannelStore {
participants.sort_by_key(|u| u.id);
this.channel_participants
.insert(entry.channel_id, participants);
.insert(ChannelId(entry.channel_id), participants);
}
cx.notify();
@@ -1131,9 +1241,10 @@ impl ChannelState {
if let Some(latest_version) = &self.latest_notes_versions {
if let Some(observed_version) = &self.observed_notes_versions {
latest_version.epoch > observed_version.epoch
|| latest_version
.version
.changed_since(&observed_version.version)
|| (latest_version.epoch == observed_version.epoch
&& latest_version
.version
.changed_since(&observed_version.version))
} else {
true
}
@@ -1151,6 +1262,10 @@ impl ChannelState {
})
}
fn last_acknowledged_message_id(&self) -> Option<u64> {
self.observed_chat_message
}
fn acknowledge_message_id(&mut self, message_id: u64) {
let observed = self.observed_chat_message.get_or_insert(message_id);
*observed = (*observed).max(message_id);
@@ -1186,4 +1301,12 @@ impl ChannelState {
version: version.clone(),
});
}
fn add_hosted_project(&mut self, project_id: HostedProjectId) {
self.projects.insert(project_id);
}
fn remove_hosted_project(&mut self, project_id: HostedProjectId) {
self.projects.remove(&project_id);
}
}

View File

@@ -1,4 +1,5 @@
use crate::{Channel, ChannelId};
use crate::Channel;
use client::ChannelId;
use collections::BTreeMap;
use rpc::proto;
use std::sync::Arc;
@@ -50,27 +51,32 @@ pub struct ChannelPathsInsertGuard<'a> {
impl<'a> ChannelPathsInsertGuard<'a> {
pub fn insert(&mut self, channel_proto: proto::Channel) -> bool {
let mut ret = false;
if let Some(existing_channel) = self.channels_by_id.get_mut(&channel_proto.id) {
let parent_path = channel_proto
.parent_path
.iter()
.map(|cid| ChannelId(*cid))
.collect();
if let Some(existing_channel) = self.channels_by_id.get_mut(&ChannelId(channel_proto.id)) {
let existing_channel = Arc::make_mut(existing_channel);
ret = existing_channel.visibility != channel_proto.visibility()
|| existing_channel.name != channel_proto.name
|| existing_channel.parent_path != channel_proto.parent_path;
|| existing_channel.parent_path != parent_path;
existing_channel.visibility = channel_proto.visibility();
existing_channel.name = channel_proto.name.into();
existing_channel.parent_path = channel_proto.parent_path.into();
existing_channel.parent_path = parent_path;
} else {
self.channels_by_id.insert(
channel_proto.id,
ChannelId(channel_proto.id),
Arc::new(Channel {
id: channel_proto.id,
id: ChannelId(channel_proto.id),
visibility: channel_proto.visibility(),
name: channel_proto.name.into(),
parent_path: channel_proto.parent_path,
parent_path,
}),
);
self.insert_root(channel_proto.id);
self.insert_root(ChannelId(channel_proto.id));
}
ret
}
@@ -94,14 +100,17 @@ impl<'a> Drop for ChannelPathsInsertGuard<'a> {
fn channel_path_sorting_key<'a>(
id: ChannelId,
channels_by_id: &'a BTreeMap<ChannelId, Arc<Channel>>,
) -> impl Iterator<Item = &str> {
) -> impl Iterator<Item = (&str, ChannelId)> {
let (parent_path, name) = channels_by_id
.get(&id)
.map_or((&[] as &[_], None), |channel| {
(channel.parent_path.as_slice(), Some(channel.name.as_ref()))
(
channel.parent_path.as_slice(),
Some((channel.name.as_ref(), channel.id)),
)
});
parent_path
.iter()
.filter_map(|id| Some(channels_by_id.get(id)?.name.as_ref()))
.filter_map(|id| Some((channels_by_id.get(id)?.name.as_ref(), *id)))
.chain(name)
}

View File

@@ -2,6 +2,7 @@ use crate::channel_chat::ChannelChatEvent;
use super::*;
use client::{test::FakeServer, Client, UserStore};
use clock::FakeSystemClock;
use gpui::{AppContext, Context, Model, TestAppContext};
use rpc::proto::{self};
use settings::SettingsStore;
@@ -184,6 +185,7 @@ async fn test_channel_messages(cx: &mut TestAppContext) {
sender_id: 5,
mentions: vec![],
nonce: Some(1.into()),
reply_to_message_id: None,
},
proto::ChannelMessage {
id: 11,
@@ -192,6 +194,7 @@ async fn test_channel_messages(cx: &mut TestAppContext) {
sender_id: 6,
mentions: vec![],
nonce: Some(2.into()),
reply_to_message_id: None,
},
],
done: false,
@@ -239,6 +242,7 @@ async fn test_channel_messages(cx: &mut TestAppContext) {
sender_id: 7,
mentions: vec![],
nonce: Some(3.into()),
reply_to_message_id: None,
}),
});
@@ -292,6 +296,7 @@ async fn test_channel_messages(cx: &mut TestAppContext) {
sender_id: 5,
nonce: Some(4.into()),
mentions: vec![],
reply_to_message_id: None,
},
proto::ChannelMessage {
id: 9,
@@ -300,6 +305,7 @@ async fn test_channel_messages(cx: &mut TestAppContext) {
sender_id: 6,
nonce: Some(5.into()),
mentions: vec![],
reply_to_message_id: None,
},
],
},
@@ -332,8 +338,9 @@ fn init_test(cx: &mut AppContext) -> Model<ChannelStore> {
release_channel::init("0.0.0", cx);
client::init_settings(cx);
let clock = Arc::new(FakeSystemClock::default());
let http = FakeHttpClient::with_404_response();
let client = Client::new(http.clone(), cx);
let client = Client::new(clock, http.clone(), cx);
let user_store = cx.new_model(|cx| UserStore::new(client.clone(), cx));
client::init(&client, cx);

View File

@@ -20,9 +20,9 @@ dirs = "3.0"
ipc-channel = "0.16"
serde.workspace = true
serde_derive.workspace = true
util = { path = "../util" }
util.workspace = true
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.9"
core-foundation.workspace = true
core-services = "0.2"
plist = "1.3"

View File

@@ -1,20 +1,14 @@
#![cfg_attr(target_os = "linux", allow(dead_code))]
use anyhow::{anyhow, Context, Result};
use clap::Parser;
use cli::{CliRequest, CliResponse, IpcHandshake, FORCE_CLI_MODE_ENV_VAR_NAME};
use core_foundation::{
array::{CFArray, CFIndex},
string::kCFStringEncodingUTF8,
url::{CFURLCreateWithBytes, CFURL},
};
use core_services::{kLSLaunchDefaults, LSLaunchURLSpec, LSOpenFromURLSpec, TCFType};
use ipc_channel::ipc::{IpcOneShotServer, IpcReceiver, IpcSender};
use cli::{CliRequest, CliResponse};
use serde::Deserialize;
use std::{
ffi::OsStr,
fs::{self, OpenOptions},
io,
path::{Path, PathBuf},
ptr,
};
use util::paths::PathLikeWithPosition;
@@ -112,136 +106,6 @@ enum Bundle {
},
}
impl Bundle {
fn detect(args_bundle_path: Option<&Path>) -> anyhow::Result<Self> {
let bundle_path = if let Some(bundle_path) = args_bundle_path {
bundle_path
.canonicalize()
.with_context(|| format!("Args bundle path {bundle_path:?} canonicalization"))?
} else {
locate_bundle().context("bundle autodiscovery")?
};
match bundle_path.extension().and_then(|ext| ext.to_str()) {
Some("app") => {
let plist_path = bundle_path.join("Contents/Info.plist");
let plist = plist::from_file::<_, InfoPlist>(&plist_path).with_context(|| {
format!("Reading *.app bundle plist file at {plist_path:?}")
})?;
Ok(Self::App {
app_bundle: bundle_path,
plist,
})
}
_ => {
println!("Bundle path {bundle_path:?} has no *.app extension, attempting to locate a dev build");
let plist_path = bundle_path
.parent()
.with_context(|| format!("Bundle path {bundle_path:?} has no parent"))?
.join("WebRTC.framework/Resources/Info.plist");
let plist = plist::from_file::<_, InfoPlist>(&plist_path)
.with_context(|| format!("Reading dev bundle plist file at {plist_path:?}"))?;
Ok(Self::LocalPath {
executable: bundle_path,
plist,
})
}
}
}
fn plist(&self) -> &InfoPlist {
match self {
Self::App { plist, .. } => plist,
Self::LocalPath { plist, .. } => plist,
}
}
fn path(&self) -> &Path {
match self {
Self::App { app_bundle, .. } => app_bundle,
Self::LocalPath { executable, .. } => executable,
}
}
fn launch(&self) -> anyhow::Result<(IpcSender<CliRequest>, IpcReceiver<CliResponse>)> {
let (server, server_name) =
IpcOneShotServer::<IpcHandshake>::new().context("Handshake before Zed spawn")?;
let url = format!("zed-cli://{server_name}");
match self {
Self::App { app_bundle, .. } => {
let app_path = app_bundle;
let status = unsafe {
let app_url = CFURL::from_path(app_path, true)
.with_context(|| format!("invalid app path {app_path:?}"))?;
let url_to_open = CFURL::wrap_under_create_rule(CFURLCreateWithBytes(
ptr::null(),
url.as_ptr(),
url.len() as CFIndex,
kCFStringEncodingUTF8,
ptr::null(),
));
// equivalent to: open zed-cli:... -a /Applications/Zed\ Preview.app
let urls_to_open = CFArray::from_copyable(&[url_to_open.as_concrete_TypeRef()]);
LSOpenFromURLSpec(
&LSLaunchURLSpec {
appURL: app_url.as_concrete_TypeRef(),
itemURLs: urls_to_open.as_concrete_TypeRef(),
passThruParams: ptr::null(),
launchFlags: kLSLaunchDefaults,
asyncRefCon: ptr::null_mut(),
},
ptr::null_mut(),
)
};
anyhow::ensure!(
status == 0,
"cannot start app bundle {}",
self.zed_version_string()
);
}
Self::LocalPath { executable, .. } => {
let executable_parent = executable
.parent()
.with_context(|| format!("Executable {executable:?} path has no parent"))?;
let subprocess_stdout_file =
fs::File::create(executable_parent.join("zed_dev.log"))
.with_context(|| format!("Log file creation in {executable_parent:?}"))?;
let subprocess_stdin_file =
subprocess_stdout_file.try_clone().with_context(|| {
format!("Cloning descriptor for file {subprocess_stdout_file:?}")
})?;
let mut command = std::process::Command::new(executable);
let command = command
.env(FORCE_CLI_MODE_ENV_VAR_NAME, "")
.stderr(subprocess_stdout_file)
.stdout(subprocess_stdin_file)
.arg(url);
command
.spawn()
.with_context(|| format!("Spawning {command:?}"))?;
}
}
let (_, handshake) = server.accept().context("Handshake after Zed spawn")?;
Ok((handshake.requests, handshake.responses))
}
fn zed_version_string(&self) -> String {
let is_dev = matches!(self, Self::LocalPath { .. });
format!(
"Zed {}{} {}",
self.plist().bundle_short_version_string,
if is_dev { " (dev)" } else { "" },
self.path().display(),
)
}
}
fn touch(path: &Path) -> io::Result<()> {
match OpenOptions::new().create(true).write(true).open(path) {
Ok(_) => Ok(()),
@@ -259,3 +123,220 @@ fn locate_bundle() -> Result<PathBuf> {
}
Ok(app_path)
}
#[cfg(target_os = "linux")]
mod linux {
use std::path::Path;
use cli::{CliRequest, CliResponse};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use crate::{Bundle, InfoPlist};
impl Bundle {
pub fn detect(_args_bundle_path: Option<&Path>) -> anyhow::Result<Self> {
unimplemented!()
}
pub fn plist(&self) -> &InfoPlist {
unimplemented!()
}
pub fn path(&self) -> &Path {
unimplemented!()
}
pub fn launch(&self) -> anyhow::Result<(IpcSender<CliRequest>, IpcReceiver<CliResponse>)> {
unimplemented!()
}
pub fn zed_version_string(&self) -> String {
unimplemented!()
}
}
}
// todo!("windows")
#[cfg(target_os = "windows")]
mod windows {
use std::path::Path;
use cli::{CliRequest, CliResponse};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use crate::{Bundle, InfoPlist};
impl Bundle {
pub fn detect(_args_bundle_path: Option<&Path>) -> anyhow::Result<Self> {
unimplemented!()
}
pub fn plist(&self) -> &InfoPlist {
unimplemented!()
}
pub fn path(&self) -> &Path {
unimplemented!()
}
pub fn launch(&self) -> anyhow::Result<(IpcSender<CliRequest>, IpcReceiver<CliResponse>)> {
unimplemented!()
}
pub fn zed_version_string(&self) -> String {
unimplemented!()
}
}
}
#[cfg(target_os = "macos")]
mod mac_os {
use anyhow::Context;
use core_foundation::{
array::{CFArray, CFIndex},
string::kCFStringEncodingUTF8,
url::{CFURLCreateWithBytes, CFURL},
};
use core_services::{kLSLaunchDefaults, LSLaunchURLSpec, LSOpenFromURLSpec, TCFType};
use std::{fs, path::Path, ptr};
use cli::{CliRequest, CliResponse, IpcHandshake, FORCE_CLI_MODE_ENV_VAR_NAME};
use ipc_channel::ipc::{IpcOneShotServer, IpcReceiver, IpcSender};
use crate::{locate_bundle, Bundle, InfoPlist};
impl Bundle {
pub fn detect(args_bundle_path: Option<&Path>) -> anyhow::Result<Self> {
let bundle_path = if let Some(bundle_path) = args_bundle_path {
bundle_path
.canonicalize()
.with_context(|| format!("Args bundle path {bundle_path:?} canonicalization"))?
} else {
locate_bundle().context("bundle autodiscovery")?
};
match bundle_path.extension().and_then(|ext| ext.to_str()) {
Some("app") => {
let plist_path = bundle_path.join("Contents/Info.plist");
let plist =
plist::from_file::<_, InfoPlist>(&plist_path).with_context(|| {
format!("Reading *.app bundle plist file at {plist_path:?}")
})?;
Ok(Self::App {
app_bundle: bundle_path,
plist,
})
}
_ => {
println!("Bundle path {bundle_path:?} has no *.app extension, attempting to locate a dev build");
let plist_path = bundle_path
.parent()
.with_context(|| format!("Bundle path {bundle_path:?} has no parent"))?
.join("WebRTC.framework/Resources/Info.plist");
let plist =
plist::from_file::<_, InfoPlist>(&plist_path).with_context(|| {
format!("Reading dev bundle plist file at {plist_path:?}")
})?;
Ok(Self::LocalPath {
executable: bundle_path,
plist,
})
}
}
}
fn plist(&self) -> &InfoPlist {
match self {
Self::App { plist, .. } => plist,
Self::LocalPath { plist, .. } => plist,
}
}
fn path(&self) -> &Path {
match self {
Self::App { app_bundle, .. } => app_bundle,
Self::LocalPath { executable, .. } => executable,
}
}
pub fn launch(&self) -> anyhow::Result<(IpcSender<CliRequest>, IpcReceiver<CliResponse>)> {
let (server, server_name) =
IpcOneShotServer::<IpcHandshake>::new().context("Handshake before Zed spawn")?;
let url = format!("zed-cli://{server_name}");
match self {
Self::App { app_bundle, .. } => {
let app_path = app_bundle;
let status = unsafe {
let app_url = CFURL::from_path(app_path, true)
.with_context(|| format!("invalid app path {app_path:?}"))?;
let url_to_open = CFURL::wrap_under_create_rule(CFURLCreateWithBytes(
ptr::null(),
url.as_ptr(),
url.len() as CFIndex,
kCFStringEncodingUTF8,
ptr::null(),
));
// equivalent to: open zed-cli:... -a /Applications/Zed\ Preview.app
let urls_to_open =
CFArray::from_copyable(&[url_to_open.as_concrete_TypeRef()]);
LSOpenFromURLSpec(
&LSLaunchURLSpec {
appURL: app_url.as_concrete_TypeRef(),
itemURLs: urls_to_open.as_concrete_TypeRef(),
passThruParams: ptr::null(),
launchFlags: kLSLaunchDefaults,
asyncRefCon: ptr::null_mut(),
},
ptr::null_mut(),
)
};
anyhow::ensure!(
status == 0,
"cannot start app bundle {}",
self.zed_version_string()
);
}
Self::LocalPath { executable, .. } => {
let executable_parent = executable
.parent()
.with_context(|| format!("Executable {executable:?} path has no parent"))?;
let subprocess_stdout_file = fs::File::create(
executable_parent.join("zed_dev.log"),
)
.with_context(|| format!("Log file creation in {executable_parent:?}"))?;
let subprocess_stdin_file =
subprocess_stdout_file.try_clone().with_context(|| {
format!("Cloning descriptor for file {subprocess_stdout_file:?}")
})?;
let mut command = std::process::Command::new(executable);
let command = command
.env(FORCE_CLI_MODE_ENV_VAR_NAME, "")
.stderr(subprocess_stdout_file)
.stdout(subprocess_stdin_file)
.arg(url);
command
.spawn()
.with_context(|| format!("Spawning {command:?}"))?;
}
}
let (_, handshake) = server.accept().context("Handshake after Zed spawn")?;
Ok((handshake.requests, handshake.responses))
}
pub fn zed_version_string(&self) -> String {
let is_dev = matches!(self, Self::LocalPath { .. });
format!(
"Zed {}{} {}",
self.plist().bundle_short_version_string,
if is_dev { " (dev)" } else { "" },
self.path().display(),
)
}
}
}

View File

@@ -10,20 +10,21 @@ path = "src/client.rs"
doctest = false
[features]
test-support = ["collections/test-support", "gpui/test-support", "rpc/test-support"]
test-support = ["clock/test-support", "collections/test-support", "gpui/test-support", "rpc/test-support"]
[dependencies]
chrono = { version = "0.4", features = ["serde"] }
collections = { path = "../collections" }
db = { path = "../db" }
gpui = { path = "../gpui" }
util = { path = "../util" }
release_channel = { path = "../release_channel" }
rpc = { path = "../rpc" }
text = { path = "../text" }
settings = { path = "../settings" }
feature_flags = { path = "../feature_flags" }
sum_tree = { path = "../sum_tree" }
chrono = { workspace = true, features = ["serde"] }
clock.workspace = true
collections.workspace = true
db.workspace = true
gpui.workspace = true
util.workspace = true
release_channel.workspace = true
rpc.workspace = true
text.workspace = true
settings.workspace = true
feature_flags.workspace = true
sum_tree.workspace = true
anyhow.workspace = true
async-recursion = "0.3"
@@ -40,9 +41,10 @@ schemars.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
sha2 = "0.10"
sha2.workspace = true
smol.workspace = true
sysinfo.workspace = true
telemetry_events.workspace = true
tempfile.workspace = true
thiserror.workspace = true
time.workspace = true
@@ -51,8 +53,9 @@ uuid.workspace = true
url.workspace = true
[dev-dependencies]
collections = { path = "../collections", features = ["test-support"] }
gpui = { path = "../gpui", features = ["test-support"] }
rpc = { path = "../rpc", features = ["test-support"] }
settings = { path = "../settings", features = ["test-support"] }
util = { path = "../util", features = ["test-support"] }
clock = { workspace = true, features = ["test-support"] }
collections = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
rpc = { workspace = true, features = ["test-support"] }
settings = { workspace = true, features = ["test-support"] }
util = { workspace = true, features = ["test-support"] }

View File

@@ -10,6 +10,8 @@ use async_tungstenite::tungstenite::{
error::Error as WebsocketError,
http::{Request, StatusCode},
};
use clock::SystemClock;
use collections::HashMap;
use futures::{
channel::oneshot, future::LocalBoxFuture, AsyncReadExt, FutureExt, SinkExt, StreamExt,
TryFutureExt as _, TryStreamExt,
@@ -29,7 +31,6 @@ use serde_json;
use settings::{Settings, SettingsStore};
use std::{
any::TypeId,
collections::HashMap,
convert::TryFrom,
fmt::Write as _,
future::Future,
@@ -41,11 +42,11 @@ use std::{
use telemetry::Telemetry;
use thiserror::Error;
use url::Url;
use util::http::{HttpClient, ZedHttpClient};
use util::http::{HttpClient, HttpClientWithUrl};
use util::{ResultExt, TryFutureExt};
pub use rpc::*;
pub use telemetry::Event;
pub use telemetry_events::Event;
pub use user::*;
lazy_static! {
@@ -152,7 +153,7 @@ impl Global for GlobalClient {}
pub struct Client {
id: AtomicU64,
peer: Arc<Peer>,
http: Arc<ZedHttpClient>,
http: Arc<HttpClientWithUrl>,
telemetry: Arc<Telemetry>,
state: RwLock<ClientState>,
@@ -421,11 +422,15 @@ impl settings::Settings for TelemetrySettings {
}
impl Client {
pub fn new(http: Arc<ZedHttpClient>, cx: &mut AppContext) -> Arc<Self> {
pub fn new(
clock: Arc<dyn SystemClock>,
http: Arc<HttpClientWithUrl>,
cx: &mut AppContext,
) -> Arc<Self> {
let client = Arc::new(Self {
id: AtomicU64::new(0),
peer: Peer::new(0),
telemetry: Telemetry::new(http.clone(), cx),
telemetry: Telemetry::new(clock, http.clone(), cx),
http,
state: Default::default(),
@@ -442,7 +447,7 @@ impl Client {
self.id.load(std::sync::atomic::Ordering::SeqCst)
}
pub fn http_client(&self) -> Arc<ZedHttpClient> {
pub fn http_client(&self) -> Arc<HttpClientWithUrl> {
self.http.clone()
}
@@ -965,14 +970,14 @@ impl Client {
}
async fn get_rpc_url(
http: Arc<ZedHttpClient>,
http: Arc<HttpClientWithUrl>,
release_channel: Option<ReleaseChannel>,
) -> Result<Url> {
if let Some(url) = &*ZED_RPC_URL {
return Url::parse(url).context("invalid rpc url");
}
let mut url = http.zed_url("/rpc");
let mut url = http.build_url("/rpc");
if let Some(preview_param) =
release_channel.and_then(|channel| channel.release_query_param())
{
@@ -1105,7 +1110,7 @@ impl Client {
// Open the Zed sign-in page in the user's browser, with query parameters that indicate
// that the user is signing in from a Zed app running on the same device.
let mut url = http.zed_url(&format!(
let mut url = http.build_url(&format!(
"/native_app_signin?native_app_port={}&native_app_public_key={}",
port, public_key_string
));
@@ -1140,7 +1145,7 @@ impl Client {
}
let post_auth_url =
http.zed_url("/native_app_signin_succeeded");
http.build_url("/native_app_signin_succeeded");
req.respond(
tiny_http::Response::empty(302).with_header(
tiny_http::Header::from_bytes(
@@ -1182,7 +1187,7 @@ impl Client {
}
async fn authenticate_as_admin(
http: Arc<ZedHttpClient>,
http: Arc<HttpClientWithUrl>,
login: String,
mut api_token: String,
) -> Result<Credentials> {
@@ -1455,6 +1460,7 @@ mod tests {
use super::*;
use crate::test::FakeServer;
use clock::FakeSystemClock;
use gpui::{BackgroundExecutor, Context, TestAppContext};
use parking_lot::Mutex;
use settings::SettingsStore;
@@ -1465,7 +1471,13 @@ mod tests {
async fn test_reconnection(cx: &mut TestAppContext) {
init_test(cx);
let user_id = 5;
let client = cx.update(|cx| Client::new(FakeHttpClient::with_404_response(), cx));
let client = cx.update(|cx| {
Client::new(
Arc::new(FakeSystemClock::default()),
FakeHttpClient::with_404_response(),
cx,
)
});
let server = FakeServer::for_client(user_id, &client, cx).await;
let mut status = client.status();
assert!(matches!(
@@ -1500,7 +1512,13 @@ mod tests {
async fn test_connection_timeout(executor: BackgroundExecutor, cx: &mut TestAppContext) {
init_test(cx);
let user_id = 5;
let client = cx.update(|cx| Client::new(FakeHttpClient::with_404_response(), cx));
let client = cx.update(|cx| {
Client::new(
Arc::new(FakeSystemClock::default()),
FakeHttpClient::with_404_response(),
cx,
)
});
let mut status = client.status();
// Time out when client tries to connect.
@@ -1573,7 +1591,13 @@ mod tests {
init_test(cx);
let auth_count = Arc::new(Mutex::new(0));
let dropped_auth_count = Arc::new(Mutex::new(0));
let client = cx.update(|cx| Client::new(FakeHttpClient::with_404_response(), cx));
let client = cx.update(|cx| {
Client::new(
Arc::new(FakeSystemClock::default()),
FakeHttpClient::with_404_response(),
cx,
)
});
client.override_authenticate({
let auth_count = auth_count.clone();
let dropped_auth_count = dropped_auth_count.clone();
@@ -1621,7 +1645,13 @@ mod tests {
async fn test_subscribing_to_entity(cx: &mut TestAppContext) {
init_test(cx);
let user_id = 5;
let client = cx.update(|cx| Client::new(FakeHttpClient::with_404_response(), cx));
let client = cx.update(|cx| {
Client::new(
Arc::new(FakeSystemClock::default()),
FakeHttpClient::with_404_response(),
cx,
)
});
let server = FakeServer::for_client(user_id, &client, cx).await;
let (done_tx1, mut done_rx1) = smol::channel::unbounded();
@@ -1675,7 +1705,13 @@ mod tests {
async fn test_subscribing_after_dropping_subscription(cx: &mut TestAppContext) {
init_test(cx);
let user_id = 5;
let client = cx.update(|cx| Client::new(FakeHttpClient::with_404_response(), cx));
let client = cx.update(|cx| {
Client::new(
Arc::new(FakeSystemClock::default()),
FakeHttpClient::with_404_response(),
cx,
)
});
let server = FakeServer::for_client(user_id, &client, cx).await;
let model = cx.new_model(|_| TestModel::default());
@@ -1704,7 +1740,13 @@ mod tests {
async fn test_dropping_subscription_in_handler(cx: &mut TestAppContext) {
init_test(cx);
let user_id = 5;
let client = cx.update(|cx| Client::new(FakeHttpClient::with_404_response(), cx));
let client = cx.update(|cx| {
Client::new(
Arc::new(FakeSystemClock::default()),
FakeHttpClient::with_404_response(),
cx,
)
});
let server = FakeServer::for_client(user_id, &client, cx).await;
let model = cx.new_model(|_| TestModel::default());

View File

@@ -1,13 +1,13 @@
mod event_coalescer;
use crate::TelemetrySettings;
use crate::{ChannelId, TelemetrySettings};
use chrono::{DateTime, Utc};
use clock::SystemClock;
use futures::Future;
use gpui::{AppContext, AppMetadata, BackgroundExecutor, Task};
use once_cell::sync::Lazy;
use parking_lot::Mutex;
use release_channel::ReleaseChannel;
use serde::Serialize;
use settings::{Settings, SettingsStore};
use sha2::{Digest, Sha256};
use std::io::Write;
@@ -15,8 +15,12 @@ use std::{env, mem, path::PathBuf, sync::Arc, time::Duration};
use sysinfo::{
CpuRefreshKind, Pid, PidExt, ProcessExt, ProcessRefreshKind, RefreshKind, System, SystemExt,
};
use telemetry_events::{
ActionEvent, AppEvent, AssistantEvent, AssistantKind, CallEvent, CopilotEvent, CpuEvent,
EditEvent, EditorEvent, Event, EventRequestBody, EventWrapper, MemoryEvent, SettingEvent,
};
use tempfile::NamedTempFile;
use util::http::{self, HttpClient, Method, ZedHttpClient};
use util::http::{self, HttpClient, HttpClientWithUrl, Method};
#[cfg(not(debug_assertions))]
use util::ResultExt;
use util::TryFutureExt;
@@ -24,7 +28,8 @@ use util::TryFutureExt;
use self::event_coalescer::EventCoalescer;
pub struct Telemetry {
http_client: Arc<ZedHttpClient>,
clock: Arc<dyn SystemClock>,
http_client: Arc<HttpClientWithUrl>,
executor: BackgroundExecutor,
state: Arc<Mutex<TelemetryState>>,
}
@@ -33,7 +38,7 @@ struct TelemetryState {
settings: TelemetrySettings,
metrics_id: Option<Arc<str>>, // Per logged-in user
installation_id: Option<Arc<str>>, // Per app installation (different for dev, nightly, preview, and stable)
session_id: Option<Arc<str>>, // Per app launch
session_id: Option<String>, // Per app launch
release_channel: Option<&'static str>,
app_metadata: AppMetadata,
architecture: &'static str,
@@ -46,93 +51,6 @@ struct TelemetryState {
max_queue_size: usize,
}
#[derive(Serialize, Debug)]
struct EventRequestBody {
installation_id: Option<Arc<str>>,
session_id: Option<Arc<str>>,
is_staff: Option<bool>,
app_version: Option<String>,
os_name: &'static str,
os_version: Option<String>,
architecture: &'static str,
release_channel: Option<&'static str>,
events: Vec<EventWrapper>,
}
#[derive(Serialize, Debug)]
struct EventWrapper {
signed_in: bool,
#[serde(flatten)]
event: Event,
}
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum AssistantKind {
Panel,
Inline,
}
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(tag = "type")]
pub enum Event {
Editor {
operation: &'static str,
file_extension: Option<String>,
vim_mode: bool,
copilot_enabled: bool,
copilot_enabled_for_language: bool,
milliseconds_since_first_event: i64,
},
Copilot {
suggestion_id: Option<String>,
suggestion_accepted: bool,
file_extension: Option<String>,
milliseconds_since_first_event: i64,
},
Call {
operation: &'static str,
room_id: Option<u64>,
channel_id: Option<u64>,
milliseconds_since_first_event: i64,
},
Assistant {
conversation_id: Option<String>,
kind: AssistantKind,
model: &'static str,
milliseconds_since_first_event: i64,
},
Cpu {
usage_as_percentage: f32,
core_count: u32,
milliseconds_since_first_event: i64,
},
Memory {
memory_in_bytes: u64,
virtual_memory_in_bytes: u64,
milliseconds_since_first_event: i64,
},
App {
operation: String,
milliseconds_since_first_event: i64,
},
Setting {
setting: &'static str,
value: String,
milliseconds_since_first_event: i64,
},
Edit {
duration: i64,
environment: &'static str,
milliseconds_since_first_event: i64,
},
Action {
source: &'static str,
action: String,
milliseconds_since_first_event: i64,
},
}
#[cfg(debug_assertions)]
const MAX_QUEUE_LEN: usize = 5;
@@ -144,7 +62,6 @@ const FLUSH_INTERVAL: Duration = Duration::from_secs(1);
#[cfg(not(debug_assertions))]
const FLUSH_INTERVAL: Duration = Duration::from_secs(60 * 5);
static ZED_CLIENT_CHECKSUM_SEED: Lazy<Option<Vec<u8>>> = Lazy::new(|| {
option_env!("ZED_CLIENT_CHECKSUM_SEED")
.map(|s| s.as_bytes().into())
@@ -156,7 +73,11 @@ static ZED_CLIENT_CHECKSUM_SEED: Lazy<Option<Vec<u8>>> = Lazy::new(|| {
});
impl Telemetry {
pub fn new(client: Arc<ZedHttpClient>, cx: &mut AppContext) -> Arc<Self> {
pub fn new(
clock: Arc<dyn SystemClock>,
client: Arc<HttpClientWithUrl>,
cx: &mut AppContext,
) -> Arc<Self> {
let release_channel =
ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());
@@ -175,7 +96,7 @@ impl Telemetry {
log_file: None,
is_staff: None,
first_event_date_time: None,
event_coalescer: EventCoalescer::new(),
event_coalescer: EventCoalescer::new(clock.clone()),
max_queue_size: MAX_QUEUE_LEN,
}));
@@ -205,6 +126,7 @@ impl Telemetry {
// TODO: Replace all hardware stuff with nested SystemSpecs json
let this = Arc::new(Self {
clock,
http_client: client,
executor: cx.background_executor().clone(),
state,
@@ -311,14 +233,13 @@ impl Telemetry {
copilot_enabled: bool,
copilot_enabled_for_language: bool,
) {
let event = Event::Editor {
let event = Event::Editor(EditorEvent {
file_extension,
vim_mode,
operation,
operation: operation.into(),
copilot_enabled,
copilot_enabled_for_language,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
});
self.report_event(event)
}
@@ -329,12 +250,11 @@ impl Telemetry {
suggestion_accepted: bool,
file_extension: Option<String>,
) {
let event = Event::Copilot {
let event = Event::Copilot(CopilotEvent {
suggestion_id,
suggestion_accepted,
file_extension,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
});
self.report_event(event)
}
@@ -345,12 +265,11 @@ impl Telemetry {
kind: AssistantKind,
model: &'static str,
) {
let event = Event::Assistant {
let event = Event::Assistant(AssistantEvent {
conversation_id,
kind,
model,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
model: model.to_string(),
});
self.report_event(event)
}
@@ -359,24 +278,22 @@ impl Telemetry {
self: &Arc<Self>,
operation: &'static str,
room_id: Option<u64>,
channel_id: Option<u64>,
channel_id: Option<ChannelId>,
) {
let event = Event::Call {
operation,
let event = Event::Call(CallEvent {
operation: operation.to_string(),
room_id,
channel_id,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
channel_id: channel_id.map(|cid| cid.0),
});
self.report_event(event)
}
pub fn report_cpu_event(self: &Arc<Self>, usage_as_percentage: f32, core_count: u32) {
let event = Event::Cpu {
let event = Event::Cpu(CpuEvent {
usage_as_percentage,
core_count,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
});
self.report_event(event)
}
@@ -386,28 +303,16 @@ impl Telemetry {
memory_in_bytes: u64,
virtual_memory_in_bytes: u64,
) {
let event = Event::Memory {
let event = Event::Memory(MemoryEvent {
memory_in_bytes,
virtual_memory_in_bytes,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
});
self.report_event(event)
}
pub fn report_app_event(self: &Arc<Self>, operation: String) {
self.report_app_event_with_date_time(operation, Utc::now());
}
fn report_app_event_with_date_time(
self: &Arc<Self>,
operation: String,
date_time: DateTime<Utc>,
) -> Event {
let event = Event::App {
operation,
milliseconds_since_first_event: self.milliseconds_since_first_event(date_time),
};
pub fn report_app_event(self: &Arc<Self>, operation: String) -> Event {
let event = Event::App(AppEvent { operation });
self.report_event(event.clone());
@@ -415,11 +320,10 @@ impl Telemetry {
}
pub fn report_setting_event(self: &Arc<Self>, setting: &'static str, value: String) {
let event = Event::Setting {
setting,
let event = Event::Setting(SettingEvent {
setting: setting.to_string(),
value,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
});
self.report_event(event)
}
@@ -430,40 +334,24 @@ impl Telemetry {
drop(state);
if let Some((start, end, environment)) = period_data {
let event = Event::Edit {
let event = Event::Edit(EditEvent {
duration: end.timestamp_millis() - start.timestamp_millis(),
environment,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
environment: environment.to_string(),
});
self.report_event(event);
}
}
pub fn report_action_event(self: &Arc<Self>, source: &'static str, action: String) {
let event = Event::Action {
source,
let event = Event::Action(ActionEvent {
source: source.to_string(),
action,
milliseconds_since_first_event: self.milliseconds_since_first_event(Utc::now()),
};
});
self.report_event(event)
}
fn milliseconds_since_first_event(self: &Arc<Self>, date_time: DateTime<Utc>) -> i64 {
let mut state = self.state.lock();
match state.first_event_date_time {
Some(first_event_date_time) => {
date_time.timestamp_millis() - first_event_date_time.timestamp_millis()
}
None => {
state.first_event_date_time = Some(date_time);
0
}
}
}
fn report_event(self: &Arc<Self>, event: Event) {
let mut state = self.state.lock();
@@ -480,8 +368,24 @@ impl Telemetry {
}));
}
let date_time = self.clock.utc_now();
let milliseconds_since_first_event = match state.first_event_date_time {
Some(first_event_date_time) => {
date_time.timestamp_millis() - first_event_date_time.timestamp_millis()
}
None => {
state.first_event_date_time = Some(date_time);
0
}
};
let signed_in = state.metrics_id.is_some();
state.events_queue.push(EventWrapper { signed_in, event });
state.events_queue.push(EventWrapper {
signed_in,
milliseconds_since_first_event,
event,
});
if state.installation_id.is_some() {
if state.events_queue.len() >= state.max_queue_size {
@@ -536,21 +440,22 @@ impl Telemetry {
{
let state = this.state.lock();
let request_body = EventRequestBody {
installation_id: state.installation_id.clone(),
installation_id: state.installation_id.as_deref().map(Into::into),
session_id: state.session_id.clone(),
is_staff: state.is_staff.clone(),
app_version: state
.app_metadata
.app_version
.map(|version| version.to_string()),
os_name: state.app_metadata.os_name,
.unwrap_or_default()
.to_string(),
os_name: state.app_metadata.os_name.to_string(),
os_version: state
.app_metadata
.os_version
.map(|version| version.to_string()),
architecture: state.architecture,
architecture: state.architecture.to_string(),
release_channel: state.release_channel,
release_channel: state.release_channel.map(Into::into),
events,
};
json_bytes.clear();
@@ -569,7 +474,7 @@ impl Telemetry {
let request = http::Request::builder()
.method(Method::POST)
.uri(&this.http_client.zed_url("/api/events"))
.uri(this.http_client.build_zed_api_url("/telemetry/events"))
.header("Content-Type", "text/plain")
.header("x-zed-checksum", checksum)
.body(json_bytes.into());
@@ -590,35 +495,37 @@ impl Telemetry {
mod tests {
use super::*;
use chrono::TimeZone;
use clock::FakeSystemClock;
use gpui::TestAppContext;
use util::http::FakeHttpClient;
#[gpui::test]
fn test_telemetry_flush_on_max_queue_size(cx: &mut TestAppContext) {
init_test(cx);
let clock = Arc::new(FakeSystemClock::new(
Utc.with_ymd_and_hms(1990, 4, 12, 12, 0, 0).unwrap(),
));
let http = FakeHttpClient::with_200_response();
let installation_id = Some("installation_id".to_string());
let session_id = "session_id".to_string();
cx.update(|cx| {
let telemetry = Telemetry::new(http, cx);
let telemetry = Telemetry::new(clock.clone(), http, cx);
telemetry.state.lock().max_queue_size = 4;
telemetry.start(installation_id, session_id, cx);
assert!(is_empty_state(&telemetry));
let first_date_time = Utc.with_ymd_and_hms(1990, 4, 12, 12, 0, 0).unwrap();
let first_date_time = clock.utc_now();
let operation = "test".to_string();
let event =
telemetry.report_app_event_with_date_time(operation.clone(), first_date_time);
let event = telemetry.report_app_event(operation.clone());
assert_eq!(
event,
Event::App {
Event::App(AppEvent {
operation: operation.clone(),
milliseconds_since_first_event: 0
}
})
);
assert_eq!(telemetry.state.lock().events_queue.len(), 1);
assert!(telemetry.state.lock().flush_events_task.is_some());
@@ -627,15 +534,14 @@ mod tests {
Some(first_date_time)
);
let mut date_time = first_date_time + chrono::Duration::milliseconds(100);
clock.advance(chrono::Duration::milliseconds(100));
let event = telemetry.report_app_event_with_date_time(operation.clone(), date_time);
let event = telemetry.report_app_event(operation.clone());
assert_eq!(
event,
Event::App {
Event::App(AppEvent {
operation: operation.clone(),
milliseconds_since_first_event: 100
}
})
);
assert_eq!(telemetry.state.lock().events_queue.len(), 2);
assert!(telemetry.state.lock().flush_events_task.is_some());
@@ -644,15 +550,14 @@ mod tests {
Some(first_date_time)
);
date_time += chrono::Duration::milliseconds(100);
clock.advance(chrono::Duration::milliseconds(100));
let event = telemetry.report_app_event_with_date_time(operation.clone(), date_time);
let event = telemetry.report_app_event(operation.clone());
assert_eq!(
event,
Event::App {
Event::App(AppEvent {
operation: operation.clone(),
milliseconds_since_first_event: 200
}
})
);
assert_eq!(telemetry.state.lock().events_queue.len(), 3);
assert!(telemetry.state.lock().flush_events_task.is_some());
@@ -661,16 +566,15 @@ mod tests {
Some(first_date_time)
);
date_time += chrono::Duration::milliseconds(100);
clock.advance(chrono::Duration::milliseconds(100));
// Adding a 4th event should cause a flush
let event = telemetry.report_app_event_with_date_time(operation.clone(), date_time);
let event = telemetry.report_app_event(operation.clone());
assert_eq!(
event,
Event::App {
Event::App(AppEvent {
operation: operation.clone(),
milliseconds_since_first_event: 300
}
})
);
assert!(is_empty_state(&telemetry));
@@ -680,28 +584,29 @@ mod tests {
#[gpui::test]
async fn test_connection_timeout(executor: BackgroundExecutor, cx: &mut TestAppContext) {
init_test(cx);
let clock = Arc::new(FakeSystemClock::new(
Utc.with_ymd_and_hms(1990, 4, 12, 12, 0, 0).unwrap(),
));
let http = FakeHttpClient::with_200_response();
let installation_id = Some("installation_id".to_string());
let session_id = "session_id".to_string();
cx.update(|cx| {
let telemetry = Telemetry::new(http, cx);
let telemetry = Telemetry::new(clock.clone(), http, cx);
telemetry.state.lock().max_queue_size = 4;
telemetry.start(installation_id, session_id, cx);
assert!(is_empty_state(&telemetry));
let first_date_time = Utc.with_ymd_and_hms(1990, 4, 12, 12, 0, 0).unwrap();
let first_date_time = clock.utc_now();
let operation = "test".to_string();
let event =
telemetry.report_app_event_with_date_time(operation.clone(), first_date_time);
let event = telemetry.report_app_event(operation.clone());
assert_eq!(
event,
Event::App {
Event::App(AppEvent {
operation: operation.clone(),
milliseconds_since_first_event: 0
}
})
);
assert_eq!(telemetry.state.lock().events_queue.len(), 1);
assert!(telemetry.state.lock().flush_events_task.is_some());

View File

@@ -1,6 +1,9 @@
use chrono::{DateTime, Duration, Utc};
use std::sync::Arc;
use std::time;
use chrono::{DateTime, Duration, Utc};
use clock::SystemClock;
const COALESCE_TIMEOUT: time::Duration = time::Duration::from_secs(20);
const SIMULATED_DURATION_FOR_SINGLE_EVENT: time::Duration = time::Duration::from_millis(1);
@@ -12,30 +15,20 @@ struct PeriodData {
}
pub struct EventCoalescer {
clock: Arc<dyn SystemClock>,
state: Option<PeriodData>,
}
impl EventCoalescer {
pub fn new() -> Self {
Self { state: None }
pub fn new(clock: Arc<dyn SystemClock>) -> Self {
Self { clock, state: None }
}
pub fn log_event(
&mut self,
environment: &'static str,
) -> Option<(DateTime<Utc>, DateTime<Utc>, &'static str)> {
self.log_event_with_time(Utc::now(), environment)
}
// pub fn close_current_period(&mut self) -> Option<(DateTime<Utc>, DateTime<Utc>)> {
// self.environment.map(|env| self.log_event(env)).flatten()
// }
fn log_event_with_time(
&mut self,
log_time: DateTime<Utc>,
environment: &'static str,
) -> Option<(DateTime<Utc>, DateTime<Utc>, &'static str)> {
let log_time = self.clock.utc_now();
let coalesce_timeout = Duration::from_std(COALESCE_TIMEOUT).unwrap();
let Some(state) = &mut self.state else {
@@ -78,18 +71,22 @@ impl EventCoalescer {
#[cfg(test)]
mod tests {
use chrono::TimeZone;
use clock::FakeSystemClock;
use super::*;
#[test]
fn test_same_context_exceeding_timeout() {
let clock = Arc::new(FakeSystemClock::new(
Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap(),
));
let environment_1 = "environment_1";
let mut event_coalescer = EventCoalescer::new();
let mut event_coalescer = EventCoalescer::new(clock.clone());
assert_eq!(event_coalescer.state, None);
let period_start = Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap();
let period_data = event_coalescer.log_event_with_time(period_start, environment_1);
let period_start = clock.utc_now();
let period_data = event_coalescer.log_event(environment_1);
assert_eq!(period_data, None);
assert_eq!(
@@ -102,12 +99,12 @@ mod tests {
);
let within_timeout_adjustment = Duration::from_std(COALESCE_TIMEOUT / 2).unwrap();
let mut period_end = period_start;
// Ensure that many calls within the timeout don't start a new period
for _ in 0..100 {
period_end += within_timeout_adjustment;
let period_data = event_coalescer.log_event_with_time(period_end, environment_1);
clock.advance(within_timeout_adjustment);
let period_data = event_coalescer.log_event(environment_1);
let period_end = clock.utc_now();
assert_eq!(period_data, None);
assert_eq!(
@@ -120,10 +117,12 @@ mod tests {
);
}
let period_end = clock.utc_now();
let exceed_timeout_adjustment = Duration::from_std(COALESCE_TIMEOUT * 2).unwrap();
// Logging an event exceeding the timeout should start a new period
let new_period_start = period_end + exceed_timeout_adjustment;
let period_data = event_coalescer.log_event_with_time(new_period_start, environment_1);
clock.advance(exceed_timeout_adjustment);
let new_period_start = clock.utc_now();
let period_data = event_coalescer.log_event(environment_1);
assert_eq!(period_data, Some((period_start, period_end, environment_1)));
assert_eq!(
@@ -138,13 +137,16 @@ mod tests {
#[test]
fn test_different_environment_under_timeout() {
let clock = Arc::new(FakeSystemClock::new(
Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap(),
));
let environment_1 = "environment_1";
let mut event_coalescer = EventCoalescer::new();
let mut event_coalescer = EventCoalescer::new(clock.clone());
assert_eq!(event_coalescer.state, None);
let period_start = Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap();
let period_data = event_coalescer.log_event_with_time(period_start, environment_1);
let period_start = clock.utc_now();
let period_data = event_coalescer.log_event(environment_1);
assert_eq!(period_data, None);
assert_eq!(
@@ -157,8 +159,9 @@ mod tests {
);
let within_timeout_adjustment = Duration::from_std(COALESCE_TIMEOUT / 2).unwrap();
let period_end = period_start + within_timeout_adjustment;
let period_data = event_coalescer.log_event_with_time(period_end, environment_1);
clock.advance(within_timeout_adjustment);
let period_end = clock.utc_now();
let period_data = event_coalescer.log_event(environment_1);
assert_eq!(period_data, None);
assert_eq!(
@@ -170,10 +173,12 @@ mod tests {
})
);
clock.advance(within_timeout_adjustment);
// Logging an event within the timeout but with a different environment should start a new period
let period_end = period_end + within_timeout_adjustment;
let period_end = clock.utc_now();
let environment_2 = "environment_2";
let period_data = event_coalescer.log_event_with_time(period_end, environment_2);
let period_data = event_coalescer.log_event(environment_2);
assert_eq!(period_data, Some((period_start, period_end, environment_1)));
assert_eq!(
@@ -188,13 +193,16 @@ mod tests {
#[test]
fn test_switching_environment_while_within_timeout() {
let clock = Arc::new(FakeSystemClock::new(
Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap(),
));
let environment_1 = "environment_1";
let mut event_coalescer = EventCoalescer::new();
let mut event_coalescer = EventCoalescer::new(clock.clone());
assert_eq!(event_coalescer.state, None);
let period_start = Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap();
let period_data = event_coalescer.log_event_with_time(period_start, environment_1);
let period_start = clock.utc_now();
let period_data = event_coalescer.log_event(environment_1);
assert_eq!(period_data, None);
assert_eq!(
@@ -207,9 +215,10 @@ mod tests {
);
let within_timeout_adjustment = Duration::from_std(COALESCE_TIMEOUT / 2).unwrap();
let period_end = period_start + within_timeout_adjustment;
clock.advance(within_timeout_adjustment);
let period_end = clock.utc_now();
let environment_2 = "environment_2";
let period_data = event_coalescer.log_event_with_time(period_end, environment_2);
let period_data = event_coalescer.log_event(environment_2);
assert_eq!(period_data, Some((period_start, period_end, environment_1)));
assert_eq!(
@@ -221,22 +230,26 @@ mod tests {
})
);
}
// // 0 20 40 60
// // |-------------------|-------------------|-------------------|-------------------
// // |--------|----------env change
// // |-------------------
// // |period_start |period_end
// // |new_period_start
// 0 20 40 60
// |-------------------|-------------------|-------------------|-------------------
// |--------|----------env change
// |-------------------
// |period_start |period_end
// |new_period_start
#[test]
fn test_switching_environment_while_exceeding_timeout() {
let clock = Arc::new(FakeSystemClock::new(
Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap(),
));
let environment_1 = "environment_1";
let mut event_coalescer = EventCoalescer::new();
let mut event_coalescer = EventCoalescer::new(clock.clone());
assert_eq!(event_coalescer.state, None);
let period_start = Utc.with_ymd_and_hms(1990, 4, 12, 0, 0, 0).unwrap();
let period_data = event_coalescer.log_event_with_time(period_start, environment_1);
let period_start = clock.utc_now();
let period_data = event_coalescer.log_event(environment_1);
assert_eq!(period_data, None);
assert_eq!(
@@ -249,9 +262,10 @@ mod tests {
);
let exceed_timeout_adjustment = Duration::from_std(COALESCE_TIMEOUT * 2).unwrap();
let period_end = period_start + exceed_timeout_adjustment;
clock.advance(exceed_timeout_adjustment);
let period_end = clock.utc_now();
let environment_2 = "environment_2";
let period_data = event_coalescer.log_event_with_time(period_end, environment_2);
let period_data = event_coalescer.log_event(environment_2);
assert_eq!(
period_data,
@@ -270,6 +284,7 @@ mod tests {
})
);
}
// 0 20 40 60
// |-------------------|-------------------|-------------------|-------------------
// |--------|----------------------------------------env change

View File

@@ -15,6 +15,15 @@ use util::TryFutureExt as _;
pub type UserId = u64;
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub struct ChannelId(pub u64);
impl std::fmt::Display for ChannelId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ParticipantIndex(pub u32);

View File

@@ -9,5 +9,10 @@ license = "GPL-3.0-or-later"
path = "src/clock.rs"
doctest = false
[features]
test-support = ["dep:parking_lot"]
[dependencies]
chrono.workspace = true
parking_lot = { workspace = true, optional = true }
smallvec.workspace = true

View File

@@ -1,19 +1,28 @@
mod system_clock;
use smallvec::SmallVec;
use std::{
cmp::{self, Ordering},
fmt, iter,
};
pub use system_clock::*;
/// A unique identifier for each distributed node.
pub type ReplicaId = u16;
/// A [Lamport sequence number](https://en.wikipedia.org/wiki/Lamport_timestamp).
pub type Seq = u32;
/// A [Lamport timestamp](https://en.wikipedia.org/wiki/Lamport_timestamp),
/// used to determine the ordering of events in the editor.
#[derive(Clone, Copy, Default, Eq, Hash, PartialEq)]
pub struct Lamport {
pub replica_id: ReplicaId,
pub value: Seq,
}
/// A vector clock
/// A [vector clock](https://en.wikipedia.org/wiki/Vector_clock).
#[derive(Clone, Default, Hash, Eq, PartialEq)]
pub struct Global(SmallVec<[u32; 8]>);

View File

@@ -0,0 +1,59 @@
use chrono::{DateTime, Utc};
pub trait SystemClock: Send + Sync {
/// Returns the current date and time in UTC.
fn utc_now(&self) -> DateTime<Utc>;
}
pub struct RealSystemClock;
impl SystemClock for RealSystemClock {
fn utc_now(&self) -> DateTime<Utc> {
Utc::now()
}
}
#[cfg(any(test, feature = "test-support"))]
pub struct FakeSystemClockState {
now: DateTime<Utc>,
}
#[cfg(any(test, feature = "test-support"))]
pub struct FakeSystemClock {
// Use an unfair lock to ensure tests are deterministic.
state: parking_lot::Mutex<FakeSystemClockState>,
}
#[cfg(any(test, feature = "test-support"))]
impl Default for FakeSystemClock {
fn default() -> Self {
Self::new(Utc::now())
}
}
#[cfg(any(test, feature = "test-support"))]
impl FakeSystemClock {
pub fn new(now: DateTime<Utc>) -> Self {
let state = FakeSystemClockState { now };
Self {
state: parking_lot::Mutex::new(state),
}
}
pub fn set_now(&self, now: DateTime<Utc>) {
self.state.lock().now = now;
}
/// Advances the [`FakeSystemClock`] by the specified [`Duration`](chrono::Duration).
pub fn advance(&self, duration: chrono::Duration) {
self.state.lock().now += duration;
}
}
#[cfg(any(test, feature = "test-support"))]
impl SystemClock for FakeSystemClock {
fn utc_now(&self) -> DateTime<Utc> {
self.state.lock().now
}
}

View File

@@ -7,6 +7,17 @@ ZED_ENVIRONMENT = "development"
LIVE_KIT_SERVER = "http://localhost:7880"
LIVE_KIT_KEY = "devkey"
LIVE_KIT_SECRET = "secret"
BLOB_STORE_ACCESS_KEY = "the-blob-store-access-key"
BLOB_STORE_SECRET_KEY = "the-blob-store-secret-key"
BLOB_STORE_BUCKET = "the-extensions-bucket"
BLOB_STORE_URL = "http://127.0.0.1:9000"
BLOB_STORE_REGION = "the-region"
ZED_CLIENT_CHECKSUM_SEED = "development-checksum-seed"
# CLICKHOUSE_URL = ""
# CLICKHOUSE_USER = "default"
# CLICKHOUSE_PASSWORD = ""
# CLICKHOUSE_DATABASE = "default"
# RUST_LOG=info
# LOG_JSON=true

View File

@@ -17,20 +17,24 @@ required-features = ["seed-support"]
[dependencies]
anyhow.workspace = true
async-tungstenite = "0.16"
aws-config = { version = "1.1.5" }
aws-sdk-s3 = { version = "1.15.0" }
axum = { version = "0.5", features = ["json", "headers", "ws"] }
axum-extra = { version = "0.3", features = ["erased-json"] }
base64 = "0.13"
chrono.workspace = true
clap = { version = "3.1", features = ["derive"], optional = true }
clock = { path = "../clock" }
collections = { path = "../collections" }
clock.workspace = true
clickhouse.workspace = true
collections.workspace = true
dashmap = "5.4"
envy = "0.4.2"
futures.workspace = true
hex.workspace = true
hyper = "0.14"
lazy_static.workspace = true
lipsum = { version = "0.8", optional = true }
live_kit_server = { path = "../live_kit_server" }
live_kit_server.workspace = true
log.workspace = true
nanoid = "0.4"
parking_lot.workspace = true
@@ -38,63 +42,67 @@ prometheus = "0.13"
prost.workspace = true
rand.workspace = true
reqwest = { version = "0.11", features = ["json"], optional = true }
rpc = { path = "../rpc" }
rpc.workspace = true
scrypt = "0.7"
sea-orm = { version = "0.12.x", features = ["sqlx-postgres", "postgres-array", "runtime-tokio-rustls", "with-uuid"] }
semver.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
sha-1 = "0.9"
sha2.workspace = true
smallvec.workspace = true
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "json", "time", "uuid", "any"] }
text = { path = "../text" }
telemetry_events.workspace = true
text.workspace = true
time.workspace = true
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = "0.17"
toml.workspace = true
tonic = "0.6"
tower = "0.4"
tower-http = { workspace = true, features = ["trace"] }
tracing = "0.1.34"
tracing-log = "0.1.3"
tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] }
util = { path = "../util" }
util.workspace = true
uuid.workspace = true
[dev-dependencies]
release_channel = { path = "../release_channel" }
async-trait.workspace = true
audio = { path = "../audio" }
call = { path = "../call", features = ["test-support"] }
channel = { path = "../channel" }
client = { path = "../client", features = ["test-support"] }
collab_ui = { path = "../collab_ui", features = ["test-support"] }
collections = { path = "../collections", features = ["test-support"] }
audio.workspace = true
call = { workspace = true, features = ["test-support"] }
channel.workspace = true
client = { workspace = true, features = ["test-support"] }
collab_ui = { workspace = true, features = ["test-support"] }
collections = { workspace = true, features = ["test-support"] }
ctor.workspace = true
editor = { path = "../editor", features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }
env_logger.workspace = true
file_finder = { path = "../file_finder" }
fs = { path = "../fs", features = ["test-support"] }
git = { path = "../git", features = ["test-support"] }
gpui = { path = "../gpui", features = ["test-support"] }
file_finder.workspace = true
fs = { workspace = true, features = ["test-support"] }
git = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
indoc.workspace = true
language = { path = "../language", features = ["test-support"] }
language = { workspace = true, features = ["test-support"] }
lazy_static.workspace = true
live_kit_client = { path = "../live_kit_client", features = ["test-support"] }
lsp = { path = "../lsp", features = ["test-support"] }
menu = { path = "../menu" }
node_runtime = { path = "../node_runtime" }
notifications = { path = "../notifications", features = ["test-support"] }
live_kit_client = { workspace = true, features = ["test-support"] }
lsp = { workspace = true, features = ["test-support"] }
menu.workspace = true
node_runtime.workspace = true
notifications = { workspace = true, features = ["test-support"] }
pretty_assertions.workspace = true
project = { path = "../project", features = ["test-support"] }
rpc = { path = "../rpc", features = ["test-support"] }
project = { workspace = true, features = ["test-support"] }
release_channel.workspace = true
rpc = { workspace = true, features = ["test-support"] }
sea-orm = { version = "0.12.x", features = ["sqlx-sqlite"] }
serde_json.workspace = true
settings = { path = "../settings", features = ["test-support"] }
settings = { workspace = true, features = ["test-support"] }
sqlx = { version = "0.7", features = ["sqlite"] }
theme = { path = "../theme" }
theme.workspace = true
unindent.workspace = true
util = { path = "../util" }
workspace = { path = "../workspace", features = ["test-support"] }
util.workspace = true
workspace = { workspace = true, features = ["test-support"] }
[features]
seed-support = ["clap", "lipsum", "reqwest"]

View File

@@ -9,7 +9,7 @@ kind: Service
apiVersion: v1
metadata:
namespace: ${ZED_KUBE_NAMESPACE}
name: collab
name: ${ZED_SERVICE_NAME}
annotations:
service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
service.beta.kubernetes.io/do-loadbalancer-certificate-id: ${ZED_DO_CERTIFICATE_ID}
@@ -17,7 +17,7 @@ metadata:
spec:
type: LoadBalancer
selector:
app: collab
app: ${ZED_SERVICE_NAME}
ports:
- name: web
protocol: TCP
@@ -29,17 +29,17 @@ apiVersion: apps/v1
kind: Deployment
metadata:
namespace: ${ZED_KUBE_NAMESPACE}
name: collab
name: ${ZED_SERVICE_NAME}
spec:
replicas: 1
selector:
matchLabels:
app: collab
app: ${ZED_SERVICE_NAME}
template:
metadata:
labels:
app: collab
app: ${ZED_SERVICE_NAME}
annotations:
ad.datadoghq.com/collab.check_names: |
["openmetrics"]
@@ -55,10 +55,11 @@ spec:
]
spec:
containers:
- name: collab
- name: ${ZED_SERVICE_NAME}
image: "${ZED_IMAGE_ID}"
args:
- serve
- ${ZED_SERVICE_NAME}
ports:
- containerPort: 8080
protocol: TCP
@@ -90,6 +91,11 @@ spec:
secretKeyRef:
name: api
key: token
- name: ZED_CLIENT_CHECKSUM_SEED
valueFrom:
secretKeyRef:
name: zed-client
key: checksum-seed
- name: LIVE_KIT_SERVER
valueFrom:
secretKeyRef:
@@ -105,6 +111,51 @@ spec:
secretKeyRef:
name: livekit
key: secret
- name: BLOB_STORE_ACCESS_KEY
valueFrom:
secretKeyRef:
name: blob-store
key: access_key
- name: BLOB_STORE_SECRET_KEY
valueFrom:
secretKeyRef:
name: blob-store
key: secret_key
- name: BLOB_STORE_URL
valueFrom:
secretKeyRef:
name: blob-store
key: url
- name: BLOB_STORE_REGION
valueFrom:
secretKeyRef:
name: blob-store
key: region
- name: BLOB_STORE_BUCKET
valueFrom:
secretKeyRef:
name: blob-store
key: bucket
- name: CLICKHOUSE_URL
valueFrom:
secretKeyRef:
name: clickhouse
key: url
- name: CLICKHOUSE_USER
valueFrom:
secretKeyRef:
name: clickhouse
key: user
- name: CLICKHOUSE_PASSWORD
valueFrom:
secretKeyRef:
name: clickhouse
key: password
- name: CLICKHOUSE_DATABASE
valueFrom:
secretKeyRef:
name: clickhouse
key: database
- name: INVITE_LINK_PREFIX
value: ${INVITE_LINK_PREFIX}
- name: RUST_BACKTRACE

View File

@@ -163,7 +163,8 @@ CREATE TABLE "room_participants" (
"calling_connection_id" INTEGER NOT NULL,
"calling_connection_server_id" INTEGER REFERENCES servers (id) ON DELETE SET NULL,
"participant_index" INTEGER,
"role" TEXT
"role" TEXT,
"in_call" BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE UNIQUE INDEX "index_room_participants_on_user_id" ON "room_participants" ("user_id");
CREATE INDEX "index_room_participants_on_room_id" ON "room_participants" ("room_id");
@@ -217,7 +218,8 @@ CREATE TABLE IF NOT EXISTS "channel_messages" (
"sender_id" INTEGER NOT NULL REFERENCES users (id),
"body" TEXT NOT NULL,
"sent_at" TIMESTAMP,
"nonce" BLOB NOT NULL
"nonce" BLOB NOT NULL,
"reply_to_message_id" INTEGER DEFAULT NULL
);
CREATE INDEX "index_channel_messages_on_channel_id" ON "channel_messages" ("channel_id");
CREATE UNIQUE INDEX "index_channel_messages_on_sender_id_nonce" ON "channel_messages" ("sender_id", "nonce");
@@ -351,3 +353,35 @@ CREATE TABLE contributors (
signed_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_id)
);
CREATE TABLE extensions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
external_id TEXT NOT NULL,
name TEXT NOT NULL,
latest_version TEXT NOT NULL,
total_download_count INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE extension_versions (
extension_id INTEGER REFERENCES extensions(id),
version TEXT NOT NULL,
published_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
authors TEXT NOT NULL,
repository TEXT NOT NULL,
description TEXT NOT NULL,
download_count INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (extension_id, version)
);
CREATE UNIQUE INDEX "index_extensions_external_id" ON "extensions" ("external_id");
CREATE INDEX "index_extensions_total_download_count" ON "extensions" ("total_download_count");
CREATE TABLE hosted_projects (
id INTEGER PRIMARY KEY AUTOINCREMENT,
channel_id INTEGER NOT NULL REFERENCES channels(id),
name TEXT NOT NULL,
visibility TEXT NOT NULL,
deleted_at TIMESTAMP NULL
);
CREATE INDEX idx_hosted_projects_on_channel_id ON hosted_projects (channel_id);
CREATE UNIQUE INDEX uix_hosted_projects_on_channel_id_and_name ON hosted_projects (channel_id, name) WHERE (deleted_at IS NULL);

View File

@@ -0,0 +1 @@
ALTER TABLE channel_messages ADD reply_to_message_id INTEGER DEFAULT NULL

View File

@@ -0,0 +1,3 @@
-- Add migration script here
ALTER TABLE room_participants ADD COLUMN in_call BOOL NOT NULL DEFAULT FALSE;

View File

@@ -0,0 +1,4 @@
-- Add migration script here
ALTER TABLE rooms DROP COLUMN enviroment;
ALTER TABLE rooms DROP COLUMN environment;
ALTER TABLE room_participants DROP COLUMN in_call;

View File

@@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS extensions (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
external_id TEXT NOT NULL,
latest_version TEXT NOT NULL,
total_download_count BIGINT NOT NULL DEFAULT 0
);
CREATE TABLE IF NOT EXISTS extension_versions (
extension_id INTEGER REFERENCES extensions(id),
version TEXT NOT NULL,
published_at TIMESTAMP NOT NULL DEFAULT now(),
authors TEXT NOT NULL,
repository TEXT NOT NULL,
description TEXT NOT NULL,
download_count BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY(extension_id, version)
);
CREATE UNIQUE INDEX "index_extensions_external_id" ON "extensions" ("external_id");
CREATE INDEX "trigram_index_extensions_name" ON "extensions" USING GIN(name gin_trgm_ops);
CREATE INDEX "index_extensions_total_download_count" ON "extensions" ("total_download_count");

View File

@@ -0,0 +1,11 @@
-- Add migration script here
CREATE TABLE hosted_projects (
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
channel_id INT NOT NULL REFERENCES channels(id),
name TEXT NOT NULL,
visibility TEXT NOT NULL,
deleted_at TIMESTAMP NULL
);
CREATE INDEX idx_hosted_projects_on_channel_id ON hosted_projects (channel_id);
CREATE UNIQUE INDEX uix_hosted_projects_on_channel_id_and_name ON hosted_projects (channel_id, name) WHERE (deleted_at IS NULL);

View File

@@ -0,0 +1,3 @@
-- Add migration script here
CREATE UNIQUE INDEX uix_channels_parent_path_name ON channels(parent_path, name) WHERE (parent_path IS NOT NULL AND parent_path != '');

View File

@@ -1,3 +1,6 @@
pub mod events;
pub mod extensions;
use crate::{
auth,
db::{ContributorSelector, User, UserId},
@@ -20,7 +23,9 @@ use std::sync::Arc;
use tower::ServiceBuilder;
use tracing::instrument;
pub fn routes(rpc_server: Arc<rpc::Server>, state: Arc<AppState>) -> Router<Body> {
pub use extensions::fetch_extensions_from_blob_store_periodically;
pub fn routes(rpc_server: Option<Arc<rpc::Server>>, state: Arc<AppState>) -> Router<Body> {
Router::new()
.route("/user", get(get_authenticated_user))
.route("/users/:id/access_tokens", post(create_access_token))
@@ -130,8 +135,12 @@ async fn trace_panic(panic: Json<Panic>) -> Result<()> {
}
async fn get_rpc_server_snapshot(
Extension(rpc_server): Extension<Arc<rpc::Server>>,
Extension(rpc_server): Extension<Option<Arc<rpc::Server>>>,
) -> Result<ErasedJson> {
let Some(rpc_server) = rpc_server else {
return Err(Error::Internal(anyhow!("rpc server is not available")));
};
Ok(ErasedJson::pretty(rpc_server.snapshot().await))
}

Some files were not shown because too many files have changed in this diff Show More