Compare commits

...

990 Commits

Author SHA1 Message Date
Nate Butler
a3e04867ab Update git_ui.rs 2024-12-16 15:30:27 -05:00
Nate Butler
3abf165c1d Update git_panel.rs 2024-12-16 15:30:25 -05:00
Nate Butler
48eae645f2 Revert "Merge branch 'main' into git-panel-commit-editor"
This reverts commit 78b6cae754, reversing
changes made to 1cac4b6c00.
2024-12-16 15:29:44 -05:00
Nate Butler
78b6cae754 Merge branch 'main' into git-panel-commit-editor 2024-12-16 15:26:45 -05:00
Nate Butler
1cac4b6c00 Revert "wip"
This reverts commit aee641d79d.
2024-12-16 15:12:49 -05:00
Danilo Leal
ec741d61ed assistant2: Adjust thread history list item visuals (#21998)
Most notably, adding the `outlined` property in the `ListItem`
component.

<img width="800" alt="Screenshot 2024-12-13 at 20 35 39"
src="https://github.com/user-attachments/assets/adac4463-66f9-4b5e-b1c0-93c34f068dc4"
/>

Release Notes:

- N/A
2024-12-16 16:42:09 -03:00
Nate Butler
426f94b310 git_ui: Update todos (#22100)
`todo!()` -> `TODO`

Release Notes:

- N/A
2024-12-16 13:39:40 -05:00
Marshall Bowers
eff61ee764 assistant2: Remove WeakView<Workspace> optionality for inline assist (#22099)
This PR removes the optionality for the `WeakView<Workspace>` that we
pass to the inline assist.

This was always `Some` in practice, so it seems we don't need to have it
be an `Option`.

Release Notes:

- N/A
2024-12-16 13:26:11 -05:00
Nate Butler
aee641d79d wip 2024-12-16 13:24:55 -05:00
Marshall Bowers
caefdcd7f1 assistant2: Factor out ContextStrip (#22096)
This PR factors a `ContextStrip` view out of the `MessageEditor` so that
we can use it in other places.

Release Notes:

- N/A
2024-12-16 12:45:01 -05:00
Kirill Bulatov
ff2ad63037 Allow splitting terminal items in the central pane group (#22088)
Follow-up of https://github.com/zed-industries/zed/pull/22004
Closes https://github.com/zed-industries/zed/issues/22078

Release Notes:

- Fixed splitting terminal items in the center
2024-12-16 19:23:01 +02:00
Marshall Bowers
88f7942f11 assistant2: Add support for referencing other threads as context (#22092)
This PR adds the ability to reference other threads as context:

<img width="1159" alt="Screenshot 2024-12-16 at 11 29 54 AM"
src="https://github.com/user-attachments/assets/bb8a24ff-56d3-4406-ab8c-6657e65d8c70"
/>

<img width="1159" alt="Screenshot 2024-12-16 at 11 29 35 AM"
src="https://github.com/user-attachments/assets/7a02ebda-a2f5-40e9-9dd4-1bb029cb1c43"
/>


Release Notes:

- N/A
2024-12-16 11:50:57 -05:00
uncenter
188c55c8a6 docs: Fix context_servers key for example extension manifest (#22079)
Pretty sure this isn't meant to be kebab-case.

Release Notes:

- N/A
2024-12-16 11:00:26 -05:00
Danilo Leal
2562b488b1 Refine interaction in foldable multibuffer header (#22084)
- Ensuring that the fold button is big enough to avoid clicking on the
header as a whole (and then moving to the actual file)
- Adding tooltips to the fold button
- Refining the container structure so that the tooltip for the folder
button and the header click don't overlap
- Adding keybindings to tooltips


https://github.com/user-attachments/assets/82284b59-3025-4d6d-b916-ad4d1ecdb119

Release Notes:

- N/A
2024-12-16 12:54:06 -03:00
Kirill Bulatov
bc113e4b51 Move task centering code closer to user input (#22082)
Follow-up of https://github.com/zed-industries/zed/pull/22004 

* Reuse center terminals for tasks, when requested
* Extend task templates with `RevealTarget`, moving it from
`TaskSpawnTarget` into the core library
* Use `reveal_target` instead of `target` to avoid misinterpretations in
the task template context
* Do not expose `SpawnInTerminal` to user interface, avoid it
implementing `Serialize` and `Deserialize`
* Remove `NewCenterTask` action, extending `task::Spawn` interface
instead
* Do not require any extra unrelated parameters during task resolution,
instead, use task overrides on the resolved tasks on the modal side
* Add keybindings for opening the task modal in the
`RevealTarget::Center` mode

Release Notes:

- N/A
2024-12-16 16:15:58 +02:00
Thorsten Ball
ea012075fc Trigger completions even if inline completion is visible (#22077)
This is related to #22069 and #21858: before both of these PRs, we would
only ever show inline completions OR completions, never both at the same
time.

Now we show both at the same, but we still had this piece of logic here,
that prevented non-inline completions from showing up if there was
already an inline completion.

With this change, it's possible to get LSP completions without having to
dismiss inline completions before.

Release Notes:

- Inline completions (Copilot, Supermaven, ...) don't stop other
completions from showing up anymore. Both can now be visible at the same
time.

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-12-16 15:10:33 +01:00
Helge Mahrt
ce727fbc07 workspace: Fix doc comments (#22063)
Happened to see that the doc comments here were not correct while
implementing something else.

Release Notes:

- N/A
2024-12-16 08:27:14 -05:00
tims
62b3acee5f Project panel: Deselect entries on remaining blank space click + Remove hover color for selected entries (#22073)
Closes #22072

Clicking on the remaining space now allows a single click to deselect
all selected items. Check the issue for a preview of the current state
and how it works in VSCode.

Bonus: I found the hover color on selected items to be distracting. When
I have many entries selected and hover over them, it becomes hard to
tell if a particular entry is selected while the mouse pointer is on it.
This PR removes hover coloring for selected entries, mimicking how
VSCode handles it.

This PR:
<img
src="https://github.com/user-attachments/assets/9c4b20fc-df93-4868-b7fe-4045433e85b2"
alt="zed" width="450px" />

Release Notes:

- Clicking on empty space in the Project Panel now deselects all
selected items.
2024-12-16 14:05:54 +01:00
Thorsten Ball
38c0aa303e vim: Don't dismiss inline completion when switching to normal mode (#22075)
I'm not sure about this yet.

On one hand: it's nice that the completion doesn't just disappear when I
hit escape because I was typing and in the flow.

On the other hand: no other inline completion provider keeps the
suggestion when leaving insert mode.

I'm going to merge this so we can get it into nightly and try it out for
the next couple of days. cc @ConradIrwin

Release Notes:

- vim: Do not dismiss inline completions when leaving insert/replace
mode with `<esc>`.
2024-12-16 11:23:20 +01:00
Bennet Bo Fenner
040d9ae222 zeta: Prevent diff popover from going offscreen (#22070)
https://github.com/user-attachments/assets/4ce806f1-d790-41d0-9825-e68055281446

Release Notes:

- N/A
2024-12-16 11:22:20 +01:00
Thorsten Ball
d135ec2b73 completions: Restore tab behavior when both visible (#22069)
This reverts part of #21858 by changing how `tab` works again:

- If both, completions and inline completions, are visible, then `tab`
accepts the completion and `shif-tab` the inline completion.
- If only one of them is shown, then `tab` accepts it.

I'm not a fan of this solution, but I think it's a short-term fix that
avoids breaking people's `tab` muscle memory.

Release Notes:

- (These release notes invalidate the release notes contained in:
https://github.com/zed-industries/zed/pull/21858)
- Changed how inline completions (Copilot, Supermaven, ...) and normal
completions (from language servers) interact. Zed will now also show
inline completions when the completion menu is visible. The user can
accept the inline completion with `<shift-tab>` and the active entry in
the completion menu with `<tab>`.
2024-12-16 11:02:54 +01:00
Michael Sloan
a94afbc062 Switch from Arc/RwLock to Rc/RefCell for CodeContextMenu (#22035)
`CodeContextMenu` is always accessed on one thread, so only `Rc`s and
`Rc<RefCell<_>>` are needed. There should be tiny performance benefits
from this. The main benefit of this is that when seeing code accessing a
`RwLock` it would be reasonable to wonder whether it will block. The
only potential downside is the potential for panics due to overlapping
borrows of the RefCells. I think this is an acceptable risk because most
errors of this nature will be local or will be caught by clippy via the
check for holding a RefCell reference over an `await`.

Release Notes:

- N/A
2024-12-16 01:50:21 -07:00
Michael Sloan
7b721efe2c Stop mutating completion match state + reject fuzzy match text change (#22061)
This fixes #21837, where CompletionsMenu fuzzy match positions were
desynchronized from completion label text. The solution is to not mutate
`match_candidates` and instead offset the highlight positions in the
rendering code.

This solution requires that the fuzzy match text not change on
completion resolution. This is a property we want anyway, since fuzzy
match text changing means items unexpectedly changing position in the
menu.

What happened:

* #21521 updated completion resolution to modify labels on resolution.

- This interacted poorly with the code
[here](341e65e122/crates/editor/src/code_context_menus.rs (L604)),
where the fuzzy match results are updated to include the full label, and
the fuzzy match result positions are offset to be in the correct place.
The fuzzy mach positions were now invalid because they were based on the
old text.

* #21705 caused completion resolution to occur more frequently. Before
this only the selected item was being resolved. This caused the panic
due to invalid positions to happen much more frequently.

Closes #21837

Release Notes:

- N/A
2024-12-16 01:21:26 -07:00
Peter Tripp
18b6d142c3 docs: Suggest installing PHP to use PHP (#22058) 2024-12-16 01:21:20 -05:00
Michael Sloan
53c9af3e61 Add and use CodeLabel::filter_text() (#22054)
Release Notes:

- N/A
2024-12-15 22:24:41 -07:00
Kirill Bulatov
af50261ae2 Allow folding buffers inside multi buffers (#22046)
Closes https://github.com/zed-industries/zed/issues/4925


https://github.com/user-attachments/assets/e7b87375-893f-41ae-a2d9-d501499e40d1


Allows to fold any buffer inside multi buffers, either by clicking the
chevron icon on the header, or by using
`editor::Fold`/`editor::UnfoldLines`/`editor::ToggleFold`/`editor::FoldAll`
and `editor::UnfoldAll` actions inside the multi buffer (those were noop
there before).

Every fold has a fake line inside it, so it's possible to navigate into
that via the keyboard and unfold it with the corresponding editor
action.

The state is synchronized with the outline panel state: any fold inside
multi buffer folds the corresponding file entry; any file entry fold
inside the outline panel folds the corresponding buffer inside the multi
buffer, any directory fold inside the outline panel folds the
corresponding buffers inside the multi buffer for each nested file entry
in the panel.


Release Notes:

- Added a possibility to fold buffers inside multi buffers

---------

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
2024-12-16 00:32:07 +02:00
Michael Sloan
f64fcedabb Fix fuzzy string match invariant check (#22032)
Version in #21983 only handled out of range issues rather than utf-8
boundary issues (thanks to @s3bba for pointing this out)

Release Notes:

- N/A
2024-12-15 01:15:22 -07:00
Michael Sloan
7e6233d70f Remove an unnecessary clone in get_permalink_to_line (#22027)
Release Notes:

- N/A
2024-12-14 15:52:39 -07:00
Michael Sloan
d459f010b6 Rename GitRepository.path() to GitRepository.dot_git_dir() (#22026)
Release Notes:

- N/A
2024-12-14 15:30:56 -07:00
Michael Sloan
25970650a7 Improve StringMatchCandidate::new interface (#22011)
Release Notes:

- N/A
2024-12-14 13:35:36 -07:00
Kirill Bulatov
9daa426e93 Fix terminal pane tabs arrangement and closing (#22013)
* Fixes the inability to drag and drop terminal tabs to reorder them;
fixed incorrect terminal tab move on drag and drop into existing pane
(follow-up of https://github.com/zed-industries/zed/pull/21238)
* Fixes save dialogue appearing when on closing terminal tabs with
running tasks (follow-up of
https://github.com/zed-industries/zed/pull/21374)

Release Notes:

- Fixed terminal pane tabs arrangement and closing
2024-12-14 16:13:04 +02:00
Michael Sloan
6e1cc5dad3 Remove Task::get_ready method I added, which is unusable in practice (#22012)
Does seem like such a mechanism should be possible, but not yet sure how
to define it.

Release Notes:

- N/A
2024-12-14 03:21:41 -07:00
Michael Sloan
c5fe6ef100 Hide the implementation of Task (#22009)
The `Option<T>` within `Ready` is confusing and using `None` for it can
cause crashes. There was actually one instance of this!

Release Notes:

- N/A
2024-12-14 02:52:22 -07:00
Kirill Bulatov
1ac60289fe Fix the compilation (#22010)
https://github.com/zed-industries/zed/pull/21706 was merged after
https://github.com/zed-industries/zed/pull/22004 and the CI missed that.

Release Notes:

- N/A
2024-12-14 10:02:46 +02:00
IViktorov
cbc226597c Prefer project (worktree) tasks to language/global tasks in task::Spawn (#21706)
`Inventory::list_tasks()` in `project` crate now is ordered by task
types. Worktree tasks comes first, language tasks second and global
tasks last.
That leads to `spawn_task_with_name()` from `task_ui` crate will find
worktree task first, so it's possible to override global tasks at
project level.

* `Inventory::templates_from_settings()` splitted to
`Inventory::global_templates_from_settings()` and
`Inventory::worktree_templates_from_settings()`.

* In tests function `list_tasks()` renamed to
`list_tasks_sorted_by_last_used()`, because it call's
`Inventory::used_and_current_resolved_tasks()`. Also added
`list_tasks()` which calls `Inventory::list_tasks()`.

Closes #20987 

Release Notes:

- Fix task::Spawn to search for task name in project tasks first.
2024-12-14 09:30:48 +02:00
Aaron Feickert
ff2d20780f Add setting for hover delay (#22006)
This PR adds a new `hover_popover_delay` setting that allows the user to
specify how long to wait before showing informational hover boxes. It
defaults to the existing delay.

Release Notes:

- Added a setting to control the delay for informational hover boxes
2024-12-13 20:34:16 -08:00
Ulysse Buonomo
cd5d8b4173 settings: Add max tabs option (#18933)
Add a `max_tabs` option to the settings that ensure no more than this
amount of tabs are open in a pane. If set to `null`, there is no limit.

Closes #4784

Release Notes:

- Added a `max_tabs` option to cap the maximum number of open tabs.
2024-12-13 20:32:55 -08:00
Wes Higbee
0be7cf8ea8 Show restart transformation button after successful inline assist (#20439)
When using inline assist, after successfully generating a transformation
it's not possible to generate a new transformation. Currently, you have
to modify the prompt (i.e. add a `<SPACE>` and hit `<ENTER>`) to
regenerate.

So, I changed the restart button to be visible after a successful
transformation. And in that case I map it to a different keyboard
shortcut because `menu::Confirm` is mapped to accept the current
suggestion.

Now, I can invoke a series of transforms back to back until I get what I
want!

It might also be desired to keep the accept button visible after
modifying the prompt (before submitting it). In that case we'll need to
remap accept to an alternate key (perhaps the same alt-shift-enter I am
using for restart. That wouldn't be too insane to remember. But maybe
someone has a better idea.

I don't care what the shortcut is, I just want the ability to regenerate
without adding/deleting spaces.

## Before

**Two choices** after a suggestions is presented. Also, a great example
of why I would want to regenerate the suggestion, it left some tokens
`<rewrite_this>`!

![CleanShot 2024-12-13 at 00 34
09](https://github.com/user-attachments/assets/3c1786ca-8ec5-48e2-b3dd-64de36e61f6a)

## After

**Three choices** after a suggestion is presented, the circular icon is
for regenerate, just like you see if you modify the prompt text.
![CleanShot 2024-12-13 at 00 37
58](https://github.com/user-attachments/assets/ceda300f-0851-48bf-ad3a-be44308c734e)


## Release Notes:

- Added Restart Button to Inline Assistant When Prompt Is Unchanged

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2024-12-13 20:31:54 -08:00
Mikayla Maki
4f96706161 Add the ability for tasks to target the center pane (#22004)
Closes #20060
Closes #20720
Closes #19873
Closes #9445

Release Notes:

- Fixed a bug where tasks would be spawned with their working directory
set to a file in some cases
- Added the ability to spawn tasks in the center pane, when spawning
from a keybinding:

```json5
[
  {
    // Assuming you have a task labeled "echo hello"
    "ctrl--": [
      "task::Spawn",
      { "task_name": "echo hello", "target": "center" }
    ]
  }
]
```
2024-12-13 19:39:46 -08:00
Nate Butler
4f439ae35f Update git_panel.rs 2024-12-13 21:19:16 -05:00
Brian Tan
85c3aec6e7 vim: Maintain block cursor for navigating/non-modifying operators (#21502)
The cursor shape now only changes to underline for operators that modify
text (like: delete, change, yank) while maintaining block shape for
navigation operators (like: find, till).

This better matches Vim/Nvim's behavior where the cursor only changes
shape when an operator that will modify text is pending.

Release Notes:

- vim: Improved cursor shape behavior to better match Vim
2024-12-13 19:06:18 -07:00
Nate Butler
c2eea3a474 start on commit editor 2024-12-13 21:06:18 -05:00
Nate Butler
695f06c020 Checkpoint 2024-12-13 20:18:09 -05:00
Marshall Bowers
901dbedf8d assistant2: Refine context pickers (#21996)
This PR adds some visual refinements to the context pickers in
Assistant2.

<img width="1159" alt="Screenshot 2024-12-13 at 5 11 24 PM"
src="https://github.com/user-attachments/assets/f85ce87f-6800-4fc2-8a10-8ec3232d30e9"
/>

<img width="1159" alt="Screenshot 2024-12-13 at 5 11 31 PM"
src="https://github.com/user-attachments/assets/9b13c76d-cb7c-4441-a855-1ec4de685e0c"
/>

Release Notes:

- N/A
2024-12-13 17:26:10 -05:00
Piotr Osiewicz
99dc85e6ec Format code/fix broken CI build (#21997)
In #21981 the CI didn't run for whatever reason. I've merged based off
of CI state alone and that led to CI breaking on main.

Release Notes:

- N/A
2024-12-13 17:25:54 -05:00
Peter Tripp
735849e201 Improve Editor::DuplicateSelection (#21976)
Improves the new `Editor::DuplicateSelection` @CharlesChen0823 added in
https://github.com/zed-industries/zed/pull/21154.

- Merge `duplicate_selection` and `duplicate_line` into single function.
- Add keyboard shortcuts to JetBrains and SublimeText keymaps.
- If the selection is empty (e.g. just a cursor) make
`Editor::DuplicateSelection` fallback to being the same as
`Editor::DuplicateLineDown`.
- Tested with multiple cursors and for multiple selections.

| Editor      | Action              | macOS       | Linux        |
| ----------- | ------------------- | ----------- | ------------ |
| VSCode      | Duplicate Selection |             |              |
| JetBrains   | Duplicate Selection | cmd-d       | ctrl-d       |
| XCode       | Duplicate           | cmd-d       | N/A          |
| SublimeText | duplicate_line      | cmd-shift-d | ctrl-shift-d |

This matches behavior of the `duplicate` functionality in all other
major editors, with one exception: other editors change the selection so
that the newly duplicated object, current Zed behavior leaves the
original selection unchanged (TODO?)
2024-12-13 16:32:33 -05:00
Silvano Cerza
06edcd18be Fix running Python commands that include paths with spaces (#21981)
This PR fixes running Python commands that include paths with spaces by
wrapping python commands and their arguments in quotation marks.

I fixed this only in Python as I noticed this while trying to run
`pytest` in Zed.

Probably this is not the best approach as it doesn't fix other languages
too, though I don't know enough about the codebase to fix it like that.
I'm not even sure if it's actually feasible right now.

I didn't add tests for this either as I couldn't really understand how
to easily to that, I tried to look at other languages but couldn't find
one that tests their `ContextProvider` directly.

Release Notes:

- Fix running Python commands that include paths with spaces

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-12-13 22:31:08 +01:00
Peter Tripp
e53c1a8ee3 ci: GitHub Actions Runner Cleanup (#21993)
- Only run top issues on zed-industries/zed
- Move Nightly ARM build to BuildJet
2024-12-13 16:30:53 -05:00
Joseph T. Lyons
421974f923 Use consistent casing for provider name in telemetry (#21991)
Release Notes:

- N/A
2024-12-13 16:13:47 -05:00
Marshall Bowers
c57cc35b03 assistant2: Add ability to fetch URLs as context (#21988)
This PR adds the ability to fetch URLs as context in Assistant2.

In the picker we use the search area as an input for the user to enter
the URL they wish to fetch:

<img width="1159" alt="Screenshot 2024-12-13 at 2 45 41 PM"
src="https://github.com/user-attachments/assets/b3b20648-2c22-4509-b592-d0291d25b202"
/>

<img width="1159" alt="Screenshot 2024-12-13 at 2 45 47 PM"
src="https://github.com/user-attachments/assets/7e6bab2d-2731-467f-9781-130c6e4ea5cf"
/>

Release Notes:

- N/A
2024-12-13 15:03:55 -05:00
Nate Butler
19d6e067af Toggle & Switch (#21979)
![CleanShot 2024-12-13 at 11 27
39@2x](https://github.com/user-attachments/assets/7c7828c0-c5c7-4dc6-931e-722366d4f15a)

- Adds the Switch component
- Updates `Selected`, `Selectable` -> `ToggleState`, `Toggleable`
- Adds `checkbox` and `switch` functions to align better with other
elements in our layout system.

We decided not to merge Switch and Checkbox. However, in a followup I'll
introduce a Toggle or AnyToggle enum so we can update
`CheckboxWithLabel` -> `ToggleWithLabel` as this component will work
exactly the same with either a Checkbox or a Switch.

Release Notes:

- N/A
2024-12-13 14:23:02 -05:00
Conrad Irwin
2f2e7f0317 Revert "Resolve documentation for visible completions (#21705)" (#21985)
This reverts commit ab595b0d55.

Release Notes:

- (preview only) Fixed a panic in completions
2024-12-13 12:22:26 -07:00
Michael Sloan
2b699053e6 Log invariant violations in fuzzy string match iterator (#21983)
Seeing frequent inscrutable panics here

Release Notes:

- N/A
2024-12-13 11:16:30 -07:00
Antonio Scandurra
01e5ac0a49 Maintain inline completion order, simplifying how we track pending completions (#21977)
Release Notes:

- N/A
2024-12-13 17:24:07 +01:00
Thorsten Ball
306f1c6838 zeta: Increase context lines to 32 (#21968)
Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-13 15:41:43 +01:00
Thorsten Ball
2f722e63a1 Highlight whitespace-only inline completions with background (#21954)
Noticed that whitespace-only insertions are really hard to make out, so
this changes it to make them visible by giving them a green background.

![screenshot-2024-12-13-10 49
09@2x](https://github.com/user-attachments/assets/10d83067-46f2-4cb5-97fa-0f44d254890d)


Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-13 13:40:34 +01:00
Jaagup Averin
6838b6203a python: Refine highlighting (#21389)
Fixes:
* Types in binary unions as per [PEP
604](https://peps.python.org/pep-0604/) not highlighted;
   * `except*` keyword not highlighted;
* Classes beginning with `_` not recognized as such, however `_` is a
valid first character for private classes; additionally the regex for
parsing constant/class names appeared inconsistent and incomplete so was
adjusted;
   * Builtin types such as `float`, `dict`, etc not recognized as types;
   * **Update:** decorators with arguments not recognized as decorators;
* **Update:** docstrings after type alias assignments not recognized as
docstrings;
* **Update:** `and/in/is/not/or/is not/not in` not capturable as
keywords;
* **Update:** decorators with "nesting" (@x.y.z) not recognized as
decorators;

Before:

![new_before](https://github.com/user-attachments/assets/6f05262e-be3b-41bf-aee6-26438c2bf254)

After:

![new_after](https://github.com/user-attachments/assets/408c481c-5eb9-40c9-8e18-52ebf5a121d3)

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-12-13 12:40:16 +01:00
tims
5318f529de Improve editor open URL command to open the selected portion of URL (#21825)
Closes #21718

Just like in Vim, if a URL is selected, it opens exactly that portion of
the URL. Otherwise, if only the cursor is on a URL, it opens the entire
URL.

Zed currently does the latter. This PR also adds support for the former.


https://github.com/user-attachments/assets/8bdd2952-ceec-487c-b27a-5cea4258eb03

Release Notes:

- Updated the `editor: open url` to also handle the selected portion of
a URL.
2024-12-12 22:15:21 -08:00
Danilo Leal
096bbfead5 zeta: Adjust reviewing UI (#21932)
Most notably, adding a title bar-ish in the left column as so to add the
"from most recent to oldest" info, which is supposed to make scanning
the list of completions easier to do (at least it would've helped me
figure out that was sorted that way when I was wondering about it!).

<img width="800" alt="Screenshot 2024-12-12 at 16 24 36"
src="https://github.com/user-attachments/assets/1acc9951-3df0-4cd2-96ff-94ed555ecae5"
/>

Release Notes:

- N/A
2024-12-13 00:52:23 -03:00
Danilo Leal
0b4495a920 zeta: Adjust the "Jump To Edit" button visuals (#21933)
| One Dark | One Light |
|--------|--------|
| <img width="1495" alt="Screenshot 2024-12-12 at 16 27 12"
src="https://github.com/user-attachments/assets/897ee786-a6f7-4d4e-8722-301ac13e6d8c"
/> | <img width="1495" alt="Screenshot 2024-12-12 at 16 27 18"
src="https://github.com/user-attachments/assets/a78aa5e4-f327-41da-bc9c-6e102bc67fe2"
/> |

| One Dark | One Light |
|--------|--------|
| <img width="1495" alt="Screenshot 2024-12-12 at 16 26 54"
src="https://github.com/user-attachments/assets/0357468e-7b5f-4f92-bcdb-5f94e353d8b2"
/> | <img width="1495" alt="Screenshot 2024-12-12 at 16 26 59"
src="https://github.com/user-attachments/assets/20e0f47e-e20f-46a7-b053-8e528b0975d7"
/> |


Release Notes:

- N/A
2024-12-13 00:52:12 -03:00
Bennet Bo Fenner
636c28b652 project panel: Reintroduce project panel knockout color (#21926)
Reintroduces #20760 after it was reverted in #21807

Closes #20572

/cc @danilo-leal 

Release Notes:

- N/A

---------

Co-authored-by: Cole <cole@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2024-12-13 00:52:03 -03:00
Danilo Leal
6ceec5d9a2 Fix project and buffer search input width (#21949)
Closes https://github.com/zed-industries/zed/issues/21922

Now, both the project and buffer search inputs have a min-width set so
that text inside it, as well as the additional controls, are always
visible even at the window's smallest possible size, which looks like
this:

<img width="407" alt="Screenshot 2024-12-13 at 00 35 46"
src="https://github.com/user-attachments/assets/e6e2c4c6-4f75-4663-8c65-590e02141a5d"
/>


Release Notes:

- N/A
2024-12-13 00:51:51 -03:00
Nate Butler
9f0f63f92b Git panel refinements 2 (#21947)
Add entry list, scrollbar

Release Notes:

- N/A
2024-12-12 22:30:00 -05:00
0x2CA
b38e9e44d6 Fix hover popover font fallbacks (#21945)
Closes #21848

Release Notes:

- Fixed Hover Popover Font Callbacks
2024-12-12 18:30:25 -08:00
Wang Can
e0cbbf8d06 Fix opening repos when .git is a soft link (#21153)
Closes #ISSUE

## background
If a project is big, some times it will be splited into many small git
repos.
[google repo](https://gerrit.googlesource.com/git-repo/) is a tool to
manage a group of git repos.

But, any small git repo manged by this tool, have a difference with
normal git repo.
That is , the path `.git` in the root of the git repo, is not a normal
directory, but a soft link to real git bare dir.

### zed can not recognize the `git-repo` managed git repos
you can use the procedure to genreate this problem
```bash
# tested on linux
mkdir -p bad_git_repo_project
cd bad_git_repo_project
git init
echo "hello" > hi.txt
git add .
git commit -m "init commit"
echo "hello world" >> hi.txt

# modify the repo
mv .git ../.real_git_repo
ln -sf ../.real_git_repo .git
```
with vscode, after opening this project, git works well.
but for Zed, git not work(not git status, no git blame)


## how to fix
libgit2 can recognize git repo from the root of the project(dir that
have `.git`).
so, we can recognize the git project by opening from the project root
dir, but not the `.git` dir

This fix also works with normal git project.

### before fix

![image](https://github.com/user-attachments/assets/1fb53ff4-4ab1-402e-9640-608ca79e12a4)


### after fix

![image](https://github.com/user-attachments/assets/6b16bc54-34f0-4436-b642-3c5fa8b669bd)

Release Notes:
- Fix opening repos when .git is a soft link
2024-12-12 18:29:37 -08:00
Mikayla Maki
4eaa1c2514 Only debounce the cursor position in multibuffer excerpts (#21946)
Follow up to: https://github.com/zed-industries/zed/pull/20211

Release Notes:

- Improved the performance of the cursor position indicator in single
buffers
2024-12-12 18:27:06 -08:00
CharlesChen0823
b3de19a6bd editor: Add duplicate selection command (#21154)
Closes #4890 

Release Notes:

- Add duplicate selection command for editor
2024-12-12 17:57:24 -08:00
CharlesChen0823
241b14eeaf project_panel: Create items when the editor is dismissed via the mouse (#21045)
Closes #5036 

Release Notes:

- Created project panel items when the editor is dismissed via the mouse
2024-12-12 17:24:25 -08:00
Ozan
72d8f2e595 editor: Add "selection" key context (#21927)
This change allows defining keybindings that are active when there is a
text selection.

This is especially useful, as an example, for Emacs-like keybindings
where movement keybindings expand the selection.

Here is a snippet from my keymap.json that implements Emacs movements
when selection is active:

```json
{
    "context": "Editor && selection",
    "bindings": {
      "ctrl-f": "editor::SelectRight",
      "ctrl-b": "editor::SelectLeft",
      "ctrl-n": "editor::SelectDown",
      "ctrl-p": "editor::SelectUp",
      "ctrl-a": "editor::SelectToBeginningOfLine",
      "ctrl-e": "editor::SelectToEndOfLine",
      "alt-f": "editor::SelectToNextWordEnd",
      "alt-b": "editor::SelectToPreviousWordStart",
      "alt-<": "editor::SelectToBeginning",
      "alt->": "editor::SelectToEnd"
    }
  }
  ```

What do you think about inclusion of this feature? Should I add more granular `selection=single` `selection=multi`? 

Release Notes:

- Added "selection" context for keybindings that are active when there is a text selection.
2024-12-12 16:56:42 -08:00
Dan Dascalescu
3f6ac53856 Update GitHub bug issue template to refer to bugs instead of features (#21727)
Release Notes:

- N/A
2024-12-12 16:54:37 -08:00
João Otávio Biondo
74d7ce2d2b elixir: Improve ElixirLS LSP autocomplete to show labelDetails information (#21666)
Closes https://github.com/zed-industries/zed/issues/19688

Release Notes:

- Improved ElixirLS LSP autocomplete to show module, function and struct
field details

![image](https://github.com/user-attachments/assets/2f05183f-8f7f-42c3-ba14-28fc58522488)

![image](https://github.com/user-attachments/assets/bfdea373-79ec-4dec-a9c7-5d15ad9403ee)

![image](https://github.com/user-attachments/assets/c0fd66d5-0e01-4e1e-a2d5-0a78d38e0b72)
2024-12-12 16:16:23 -08:00
tims
6a37307302 Add .prettierignore support (#21297)
Closes #11115

**Context**:

Consider a monorepo setup like this: the root has Prettier installed,
but the individual monorepos do not. In this case, only one Prettier
instance is used, with its installation located at the root. The
monorepos also use this same instance for formatting.

However, monorepo can have its own `.prettierignore` file, which will
take precedence over the `.prettierignore` file at the root level (if
one exists) for files in that monorepo.

<img
src="https://github.com/user-attachments/assets/742f16ac-11ad-4d2f-a5a2-696e47a617b9"
alt="prettier" width="200px" />

**Implementation**:

From the context above, we should keep ignore dir decoupled from the
Prettier instance. This means that even if the project has only one
Prettier installation (and thus a single Prettier instance), there can
still be multiple `.prettierignore` in play.

This approach also allows us to respect `.prettierignore` even when the
project does not have Prettier installed locally and instead relies on
the editor’s Prettier instance.

**Tests**:

1. No Prettier in project, using editor Prettier: Ensures
`.prettierignore` is respected even without a local Prettier
installation.
2. Monorepo with root Prettier and child `.prettierignore`: Confirms
that the child project’s ignore file is correctly used.
3. Monorepo with root and child `.prettierignore` files: Verifies the
child ignore file takes precedence over the root’s.

Release Notes:

- Added `.prettierignore` support to the Prettier integration.
2024-12-12 15:45:44 -08:00
xzbdmw
8dd1c23b92 editor: Add debounce setting for triggering DocumentHighlight (#21702)
Closes https://github.com/zed-industries/zed/issues/6843


I don't see where is the logic to remove old document highlight when new
one applies,
ideally, old highlight should be cleared as soon as possible when cursor
moves if the new position does not
sits in old highlight ranges to avoid linger highlights described in
https://github.com/zed-industries/zed/issues/13682#issuecomment-2498368680.

So current solution is still not ideal, because only when lsp responses
highlight ranges (even is a empty set) can we clear the old one.

Release Notes:

- Added a setting `lsp_highlight_debounce` to configure delay for
querying highlights from language server.

---------

Co-authored-by: mgsloan@gmail.com <michael@zed.dev>
2024-12-12 15:37:58 -08:00
Evren Sen
57874717c1 Add metal icon (#21720)
Release Notes:

- Added file icon for metal

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2024-12-12 15:23:20 -08:00
Aaron Feickert
bab6a79ab6 Fix audio tooltip logic (#21941)
Earlier work by @osiewicz in #21931 aims to fix audio control tooltips
in the title bar to close #21929. However, its logic is not quite
correct, and does not match the toggle behavior for the controls.

This PR corrects the logic to match the toggle behavior for the
controls. It also updates capitalization and wording for consistency.

Release Notes:

- N/A
2024-12-12 15:20:21 -08:00
uncenter
9a806f98e6 Improve diff syntax highlighting queries (#21740)
Brings over the improvements made for the same grammar:
https://github.com/nvim-treesitter/nvim-treesitter/pull/6619.

Related to #19986 but not really- the problem brought up there is an
issue of themes not supporting the `diff.plus` and `diff.minus` captures
(already used before this PR).

<details><summary>Theme previews (before/after)</summary>

| Before | After |
| --- | --- |
| ![CleanShot 2024-12-09 at 07 33
31](https://github.com/user-attachments/assets/698122df-fb63-4d7c-95aa-9559c7dcc684)
| ![CleanShot 2024-12-09 at 07 31
08](https://github.com/user-attachments/assets/ef927c0d-6c77-4fd4-b513-8359fb2442f7)
|

| Before | After |
| --- | --- |
| ![CleanShot 2024-12-09 at 07 34
15](https://github.com/user-attachments/assets/53b825ec-2987-4122-837d-1ebce334f153)
| ![CleanShot 2024-12-09 at 07 31
36](https://github.com/user-attachments/assets/079f19fb-4cc4-4256-b390-868f33e775c5)
|

| Before | After |
| --- | --- |
| ![CleanShot 2024-12-09 at 07 34
27](https://github.com/user-attachments/assets/4e3a80da-edff-4a53-bbf8-abc17cd49c5e)
| ![CleanShot 2024-12-09 at 07 31
53](https://github.com/user-attachments/assets/c6e12d79-5e59-4ebf-9fb9-ef3b0f8c9a81)
|

| Before | After |
| --- | --- |
| ![CleanShot 2024-12-09 at 07 33
44](https://github.com/user-attachments/assets/a007df22-7012-4de7-a71e-0ce5b523b561)
| ![CleanShot 2024-12-09 at 07 32
13](https://github.com/user-attachments/assets/c8c63292-5a64-4560-ad7c-9235b8b98ca3)
|

| Before | After |
| --- | --- |
| ![CleanShot 2024-12-09 at 07 33
57](https://github.com/user-attachments/assets/1a9c3656-3805-45a6-97af-747ef50e3b6c)
| ![CleanShot 2024-12-09 at 07 32
25](https://github.com/user-attachments/assets/76bac31c-8786-4907-8570-bf3c2888823e)
|

</details>

Release Notes:

- Improved diff syntax highlighting
2024-12-12 15:18:36 -08:00
CharlesChen0823
e778635487 search: Add ToggleRegex for buffer search (#21799)
Closes #21790 

IMO, this is lost

Release Notes:

- Add ToggleRegex for buffer search
2024-12-12 15:16:39 -08:00
5de0bcc990 gpui: Fix for setting window titles on Windows (#21907)
Windows requires `WM_NCCREATE` to be processed by default procedure to
set window title properly.

Release Notes:

- N/A
2024-12-12 14:58:30 -08:00
Marshall Bowers
9143fd2924 language_model_selector: Don't recreate the Picker view each render (#21939)
While working on Assistant2, I noticed that the `LanguageModelSelector`
was recreating its `Picker` view on every single render.

This PR makes it so we create the view once and hold onto it in the
parent view.

Release Notes:

- N/A
2024-12-12 17:08:48 -05:00
Joseph T. Lyons
d7eba54016 Add version control file icon for gitcommit files (#21935)
Closes: https://github.com/zed-industries/zed/issues/21734

<img width="976" alt="SCR-20241212-nlci"
src="https://github.com/user-attachments/assets/d567e2c8-d803-4148-b159-ae781eb59b50"
/>

I added the same file extensions that are used in the `Git Firefly`
extension.


b521b71324/languages/gitcommit/config.toml (L5-L9)

Release Notes:

- Added version control file icon for gitcommit files.
2024-12-12 16:23:17 -05:00
Marshall Bowers
52c0d712a6 assistant2: Add initial support for attaching file context (#21934)
This PR adds the initial support for attaching files as context to a
thread in Assistant2.

Release Notes:

- N/A
2024-12-12 15:30:17 -05:00
Piotr Osiewicz
111e844753 title_bar: Adjust tooltip for mute/deafen buttons (#21931)
Closes #21929 

Release Notes:

- N/A
2024-12-12 20:09:52 +01:00
Kyle Kelley
0eb992219b Set User Agent for Jupyter websocket connections (#21910)
Some VPN configurations require that websockets present a user agent.
This adds it in directly for the repl usage. I wish there was a way to
reuse the user agent from the `cx.http_client`, but I'm not seeing a
simple way to do that for the moment since it's not on the `HttpClient`
trait.

No release notes since this feature hasn't been announced/exposed.

Release Notes:

- N/A
2024-12-12 09:26:16 -08:00
Nate Butler
573e096fc5 More Git panel refinements (#21928)
- Add and wire through git method stubs
- Organize render methods
- Track modifier changes
- Swap commit buttons when `option`/`alt` is held
- More TODOs

Release Notes:

- N/A
2024-12-12 12:21:08 -05:00
Cole Miller
ee6f834028 Fuse LLM completion stream to avoid a panic (#21914)
`LanguageModel::stream_completion_text` can poll the `stream_completion`
stream (ultimately a `futures::Unfold`) after it's returned
`Ready(None)`, which leads to a panic; avoid this by fusing the stream.

Release Notes:

- Fixed a panic when streaming language model completions
2024-12-12 11:39:35 -05:00
Antonio Scandurra
b4c8e04544 Clear completion if model doesn't produce any edit (#21925)
Release Notes:

- N/A
2024-12-12 17:23:22 +01:00
Richard Feldman
bcf8a2f9fc Inline terminal assistant v2 (#21888)
Follow-up to https://github.com/zed-industries/zed/pull/21828 to add it
to the terminal as well.


https://github.com/user-attachments/assets/505d1443-4081-4dd8-9725-17d85532f52d

As with the previous PR, there's plenty of code duplication here; the
plan is to do more code sharing in separate PRs!


Release Notes:

- N/A
2024-12-12 11:06:09 -05:00
Piotr Osiewicz
77d066200a lsp: Fill in a bunch of missing capabilities (#21924)
Also state explicitly that we do support UTF-16 encoding and nothing
else.

See also #19788

Release Notes:

- N/A
2024-12-12 16:39:29 +01:00
Peter Tripp
5d0e75dd73 Improve emacs keybind with better home/end behavior (#21923)
Improve behavior of ctrl-a/ctrl-e home/end in emacs keybind.
Follow up to #21921 to add those to Linux emacs keymap too.

Release Notes:

- emacs: Improved `ctrl-a` / `ctrl-e` / `home` / `end` behavior
- emacs: Added for `ctrl-s` / `ctrl-r` / `ctrl-g` for navigating buffer
search results
2024-12-12 10:37:15 -05:00
Aaron Feickert
181af7804b Fix docstring for CallSettingsContent.share_on_join (#21884) 2024-12-12 10:09:28 -05:00
Antonio Scandurra
ad4c4aff13 Always let two completions race with each other (#21919)
When a user types, chances are the model will anticipate what they are
about to do. Previously, we would continuously cancel the pending
completion until the user stopped typing. With this commit, we allow at
most two completions to race with each other (the first and the last
one):

- If the completion that was requested first completes first, we will
show it (assuming we can interpolate it) but avoid canceling the last
one.
- When the completion that was requested last completes, we will cancel
the first one if it's pending.

In both cases, if a completion is already on-screen we have a special
case for when the completions are just insertions and the new completion
is a superset of the existing one. In this case, we will replace the
existing completion with the new one. Otherwise we will keep showing the
old one to avoid thrashing the UI.

This should make latency a lot better. Note that I also reduced the
debounce timeout to 8ms.

Release Notes:

- N/A
2024-12-12 16:01:05 +01:00
Peter Tripp
91b02a6259 Add emacs keybinds for previous/next/cancel in search (#21921) 2024-12-12 09:50:54 -05:00
xuoe
1f296d8f3b docs: Include restore_on_startup (#21918)
Signed-off-by: xuoe <xuoe@pm.me>
2024-12-12 09:21:27 -05:00
Danilo Leal
c204b0d01a zeta: Add adjustments to the review modal UI (#21920)
Most notably, adding a current iteration of a possible logo to feel it
out! :) Also, I'm hiding the input and instructions container after the
review has been sent. In the future, if we allow changing an already
sent review, we can change this behavior.

<img width="800" alt="Screenshot 2024-12-12 at 10 42 44"
src="https://github.com/user-attachments/assets/37e63d0d-d847-445e-bdf8-bf5c97d0fe4c"
/>

Release Notes:

- N/A
2024-12-12 11:17:08 -03:00
Nate Butler
8e0ae441f3 Initial git panel refinements (#21912)
- Wire up settings
- Update static Panel impl
- Tidy up renders

Release Notes:

- N/A
2024-12-12 09:13:40 -05:00
Raphael Kieling
02fbad18ce toolbar: Add gap between the Kernel and REPL button (#21871)
Before:

![image](https://github.com/user-attachments/assets/dbc382a8-2ba5-4639-964f-35c934875e88)

After:

![image](https://github.com/user-attachments/assets/5faf2144-63c3-41d4-b1b8-fcd6f6fd7b7e)

Also works with dark themes:

![image](https://github.com/user-attachments/assets/1f3e9bfb-94f8-44f2-9727-e46fddccb153)

Release Notes:

- N/A

Co-authored-by: raphael.kieling <raphael.kieling-ext@ab-inbev.com>
2024-12-12 09:49:17 -03:00
Thorsten Ball
227f21f035 zeta: Show timestamps and latency in rating modal (#21863)
Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Cole <cole@zed.dev>
2024-12-12 09:30:20 +01:00
Cole Miller
543a3ef5e4 linux: Don't watch parent directory when target path already exists (#21854)
The Linux watcher was unconditionally watching the parent directory of
every watched path. This is needed in the case of config files that may
not exist when the watch is set up, but not in other cases. Scoping the
parent watch more narrowly cuts down on the amount of error logging from
irrelevant file change notifications being sent to Zed (in my case it
was picking up changes to a random file in `$HOME`).

Release Notes:

- N/A
2024-12-12 01:54:14 -05:00
Cole Miller
cc97e682d5 worktree: Fix privacy check for singleton files (#21861)
Closes #20676

Release Notes:

- Fixed private files not being redacted when not part of a larger
worktree
2024-12-12 01:53:00 -05:00
Nate Butler
59afc27f03 Add placeholder git panel (#21894)
Adds a simple git placeholder panel for us to iterate from. Also
includes a number of assets from the git prototyping branch that we will
use.

Note: This panel is staff flagged for now.

Release Notes:

- N/A
2024-12-11 22:13:52 -05:00
Peter Tripp
611abcadc0 Add schema to .github/ISSUE_TEMPLATE/config.yml (#21836)
Workaround for upstream issue where yaml-language-server
2024-12-11 17:16:21 -05:00
Peter Tripp
fff12ec1e5 Mention Lllama 3.3 in Ollama config panel (#21866)
Trivial, but makes us not look outdated.
2024-12-11 16:38:03 -05:00
Conrad Irwin
13a81e454a Start to split out initialization and registration (#21787)
Still TODO:

* [x] Factor out `start_language_server` so we can call it on register
(instead of on detect language)
* [x] Only call register in singleton editors (or when
editing/go-to-definition etc. in a multibuffer?)
* [x] Refcount on register so we can unregister when no buffer remain
* [ ] (maybe) Stop language servers that are no longer needed after some
time

Release Notes:

- Fixed language servers starting when doing project search
- Fixed high CPU usage when ignoring warnings in the diagnostics view

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Cole <cole@zed.dev>
2024-12-11 14:05:10 -07:00
Jason Lee
de89f8cf83 gpui: Add linear gradient support to fill background (#20812)
Release Notes:

- gpui: Add linear gradient support to fill background

Run example:

```
cargo run -p gpui --example gradient
cargo run -p gpui --example gradient --features macos-blade
```

## Demo

In GPUI (sRGB):

<img width="761" alt="image"
src="https://github.com/user-attachments/assets/568c02e8-3065-43c2-b5c2-5618d553dd6e">

In GPUI (Oklab):

<img width="761" alt="image"
src="https://github.com/user-attachments/assets/b008b0de-2705-4f99-831d-998ce48eed42">

In CSS (sRGB): 

https://codepen.io/huacnlee/pen/rNXgxBY

<img width="505" alt="image"
src="https://github.com/user-attachments/assets/239f4b65-24b3-4797-9491-a13eea420158">

In CSS (Oklab):

https://codepen.io/huacnlee/pen/wBwBKOp

<img width="658" alt="image"
src="https://github.com/user-attachments/assets/56fdd55f-d219-45de-922f-7227f535b210">


---

Currently only support 2 color stops with linear-gradient. I think this
is we first introduce the gradient feature in GPUI, and the
linear-gradient is most popular for use. So we can just add this first
and then to add more other supports.
2024-12-11 21:52:52 +02:00
Richard Feldman
c594ccb0af Inline assistant v2 (#21828)
This is behind the Assistant v2 feature flag. As @maxdeviant and I
discussed, the state is currently decoupled from the Assistant Panel's
state, although in the future we plan to introduce a way to refer to
conversations from the panel. Also, we're intentionally duplicating some
code with the v2 panel right now; the plan is to do a future PR to make
them share code more.


https://github.com/user-attachments/assets/bb163bd3-a02d-4a91-8f8f-2a8e60acbc34

It doesn't include the terminal inline assistant, which will be in a
separate PR.

Release Notes:

- N/A
2024-12-11 14:32:30 -05:00
Marshall Bowers
937186da12 gpui: Don't export named Context from prelude (#21869)
This PR updates the `gpui::prelude` to not export the `Context` trait
named.

This prevents some naming clashes in downstream consumers.

Release Notes:

- N/A
2024-12-11 13:21:40 -05:00
Marshall Bowers
b3ffbea376 assistant2: Allow removing individual context (#21868)
This PR adds the ability to remove individual pieces of context from the
message editor:

<img width="1159" alt="Screenshot 2024-12-11 at 12 38 45 PM"
src="https://github.com/user-attachments/assets/77d04272-f667-4ebb-a567-84b382afef3d"
/>

Release Notes:

- N/A
2024-12-11 12:51:05 -05:00
Thorsten Ball
124e63d07c Show inline completions when completion menu is visible (#21858)
This changes the behavior of how we display inline completions and
non-inline completions (i.e. completion menu).

Previously we would never show inline completions if a completion menu
was visible, meaning that we'd never show Copilot/Supermaven/...
suggestions if the language server had a suggestion.

With this change, we now display the inline completions even if there is
a completion menu visible.

In that case `<tab>` then accepts the inline completion and `<enter>`
accepts the selected entry in the completion menu.

Release Notes:

- Changed how inline completions (Copilot, Supermaven, ...) and normal
completions (from language servers) interact. Zed will now also show
inline completions when the completion menu is visible. The user can
accept the inline completion with `<tab>` and the active entry in the
completion menu with `<enter>`. Previously, `<tab>` would also select
the active entry in the completion menu.

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-11 17:13:22 +01:00
Antonio Scandurra
dd66a20d78 Move prediction diff computation to background thread (#21862)
Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Cole <cole@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-12-11 17:12:58 +01:00
Joseph T. Lyons
e8c72d91c3 v0.167.x dev 2024-12-11 11:00:35 -05:00
Danilo Leal
dfe455b054 zeta: Improve UI for feedback instructions (#21857)
If the instructions are added as the input placeholder, when in a
smaller window size (like the one from the screenshot), scrolling is
needed to see them all. So, thought of extracting it out of there. Also
thought it looked more refined this way!

<img width="800" alt="Screenshot 2024-12-11 at 11 48 17"
src="https://github.com/user-attachments/assets/46974b94-6365-4a59-bf71-a6c0863aac68"
/>

Release Notes:

- N/A
2024-12-11 12:07:41 -03:00
Danilo Leal
db7e38464a zeta: Show keybinding on rating buttons (#21853)
<img width="800" alt="Screenshot 2024-12-11 at 10 57 00"
src="https://github.com/user-attachments/assets/6055639c-5b38-444d-b76d-bf7584a82efc"
/>

Release Notes:

- N/A
2024-12-11 11:54:39 -03:00
Kyle Kelley
f8b6d71670 Optimize REPL kernel spec refresh (#21844)
Python kernelspec refresh now only performed on (known) python files. 

Release Notes:

- N/A
2024-12-11 06:20:44 -08:00
Thorsten Ball
ae351298b4 zeta: Fixes to completion-rating modal (#21852)
Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-11 15:00:27 +01:00
Thorsten Ball
664468d468 zeta: Invalidate completion in different buffers (#21850)
Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-11 14:37:53 +01:00
Piotr Osiewicz
714f183ede multi_buffer: optimize runnables layout (#21849)
Related to #21481 ; it fixes a bunch of hotspots I saw while looking at
the provided profiles. MultiBuffer still takes up 100% CPU on the
foreground thread for me - this time around it's on selection updates
(when dragging the selected text towards an edge of a screen).

Release Notes:

- N/A
2024-12-11 13:46:08 +01:00
Mikayla Maki
b36dcf3b92 Improve Zeta rating ergonomics (#21845)
This PR adds keyboard shortcuts to common interactions you might want to
do in the Zeta rating panel.

This PR also adds a way to fake inline completion requests, as well as
the test data used to create this PR, to make it easier to adjust the UI
in the future.

It also changes the status bar from the text "Zeta" to "ζ", because I
thought it looked cool.

Release Notes:

- N/A
2024-12-11 01:57:46 -08:00
Danilo Leal
63e1bf01a4 zeta: Improve reviewing UI (#21838)
Starting to fine-tune it.

| No edits scenario | Rated edits scenario |
|--------|--------|
| <img width="1577" alt="Screenshot 2024-12-11 at 01 57 46"
src="https://github.com/user-attachments/assets/42926e84-7a7f-4692-af44-672b52d3d377">
| <img width="1577" alt="Screenshot 2024-12-11 at 01 58 37"
src="https://github.com/user-attachments/assets/ee8ab0ef-75af-424c-b916-9f1ce8b5264d">

Release Notes:

- N/A
2024-12-11 02:19:57 -03:00
Connor Tsui
62a6a755ec Add musl package for Arch Linux (#21830)
It seems like `musl` is required to build on Arch Linux, but it is not included in the dependencies list.
2024-12-10 21:05:53 -05:00
Ethan Budd
28faba12a2 Recognize .C and .H as supported cpp extensions (#21647)
Co-authored-by: Peter Tripp <peter@zed.dev>
2024-12-10 19:55:21 -05:00
Marshall Bowers
c255e55599 assistant2: Sketch in sending file context to model (#21829)
This PR sketches in support for sending file context attached to a
message to the model.

Right now the context is just mocked.

<img width="1159" alt="Screenshot 2024-12-10 at 4 18 41 PM"
src="https://github.com/user-attachments/assets/3ee4e86a-7893-42dc-98f9-982aa202d310">

<img width="1159" alt="Screenshot 2024-12-10 at 4 18 53 PM"
src="https://github.com/user-attachments/assets/8a3c2dd7-a466-4dbf-83ec-1c7d969c1a4b">

Release Notes:

- N/A
2024-12-10 16:35:53 -05:00
Joseph T. Lyons
f80eb73213 Update event type to conform to standard (#21827)
Release Notes:

- N/A
2024-12-10 16:14:31 -05:00
strowk
faf79e52fe zed_extension_api: Add a short explanation of repo format (#21824)
Improved extension api documentation for latest_github_release function

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-12-10 15:04:47 -05:00
Michael Sloan
ab595b0d55 Resolve documentation for visible completions (#21705)
Release Notes:

- Improved LSP resolution of documentation for completions. It now
queries documentation for visible completions and avoids doing too many
redundant queries.

---

In #21286, documentation resolution was made more efficient by only
resolving the current completion. However, this meant that single line
documentation shown inline in the menu was missing until scrolled
to. This also meant that it would wait for navigation to resolve
completion docs, leading to lag for displaying documentation.

This change resolves this by attempting to fetch all the completions
that will be shown. It also mostly avoids re-resolving completions. It
intentionally re-resolves the current selection on navigation, as some
language servers will respond with more information later on.
2024-12-10 12:25:30 -07:00
Michael Sloan
ab1e9bf270 On windows, recreate renderer swap chain on restore from minimized (#21756)
Closes #21688

Release Notes:

- Windows: Fix freeze after window minimize and maximize
2024-12-10 11:59:44 -07:00
Minqi Pan
adc66473e7 gpui: Add cursor style methods of nesw nwse resize (#21801)
Release Notes:

- N/A

---

This change adds two new methods to the cursor_style_methods function in
the gpui_macros crate (according to the Tailwind CSS documentation
https://tailwindcss.com/docs/cursor):
1. `cursor_nesw_resize`: Sets the cursor style to nesw-resize when
hovering over an element. This is useful for indicating resizing
diagonally from top-right to bottom-left.
2. `cursor_nwse_resize`: Sets the cursor style to nwse-resize when
hovering over an element. This is used for resizing diagonally from
top-left to bottom-right.
2024-12-10 11:54:26 -07:00
Marshall Bowers
119b5de384 assistant2: Change chat keybinding to just Enter (#21819)
This PR changes the Assistant2 chat keybinding from `Cmd-Enter` to just
`Enter`.

Release Notes:

- N/A
2024-12-10 12:34:54 -05:00
Marshall Bowers
c80ea60860 assistant2: Update to match latest designs (#21818)
This PR updates the Assistant2 panel to match the latest designs.

<img width="1159" alt="Screenshot 2024-12-10 at 11 49 14 AM"
src="https://github.com/user-attachments/assets/53739709-e7b9-4e35-8a5d-97b6560623ed">

Release Notes:

- N/A
2024-12-10 12:05:30 -05:00
Peter Tripp
bac6896786 Add Dart docs for line length (#21815) 2024-12-10 11:22:17 -05:00
Bennet Bo Fenner
c6932d1f51 zeta: Add action to clear edit history (#21813)
Co-Authored-by: Antonio <antonio@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-10 16:57:24 +01:00
Conrad Irwin
03efd0d1d9 Stop sending data to Clickhouse (#21763)
Release Notes:

- N/A
2024-12-10 08:47:29 -07:00
Thorsten Ball
43ba0c9fa6 zeta: Extend text in popover until EOL (#21811)
Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-12-10 16:21:45 +01:00
Thorsten Ball
4300ef840b zeta: Use word-wise diff when computing edits (#21810)
Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-12-10 16:05:34 +01:00
Bennet Bo Fenner
e0f4c01794 Revert "Improve project_panel diagnostic icon knockout colors (#20760)" (#21807)
This reverts commit 571c7d4f66.

Manually tracking the hovered entities causes issues with hightlighting:


https://github.com/user-attachments/assets/932dc022-a0ad-485c-a9db-ef03d7b86032

cc @danilo-leal @nilskch 

Release Notes:

- Fixed an issue where hovering over project panel would not update the
background correctly
2024-12-10 15:37:33 +01:00
Bennet Bo Fenner
58f9301253 image viewer: Allow dropping images on pane (#21803)
Partially addresses #21484


https://github.com/user-attachments/assets/777da5de-15c3-4af3-a597-1835c0155326

Release Notes:

- Support opening images by dropping them onto a pane
2024-12-10 15:01:14 +01:00
Thorsten Ball
96499b7b25 zeta: Refresh LLM token in case it expired (#21796)
Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-12-10 14:12:49 +01:00
Finn Evers
09006aaee9 Add option to activate left neighbour tab on tab close (#21800)
Closes #21738

Release Notes:

- Added `left_neighbour` option to the `tabs.activate_on_close` setting
to activate the left adjacent tab on tab close.
2024-12-10 15:05:36 +02:00
Kirill Bulatov
2ca3b440a9 Fix a panic when drop-splitting the terminal panel (#21795)
Closes https://github.com/zed-industries/zed/issues/21792

Release Notes:

- (Preview only) Fixed a panic when drop-splitting the terminal panel
2024-12-10 13:50:19 +02:00
Piotr Osiewicz
9219b05c85 chore: Move more local code into LocalLspStore (#21794)
Closes #ISSUE

Release Notes:

- N/A
2024-12-10 12:48:44 +01:00
Nils Koch
bd2087675b Fix git colors in image tabs (#21773)
Note that the git coloring of the icons got removed in
https://github.com/zed-industries/zed/pull/21383

Closes #21772

Release Notes:

- N/A
2024-12-10 01:40:25 -07:00
Jason Lee
44164dbbb8 gpui: Update Bounds, Point, and Axis to be serializable (#21783)
Makes `Bounds`, `Point`, and `Axis` be serializable, for dumping to JSON without conversion.

Release Notes:

- N/A
2024-12-10 00:43:55 -07:00
Conrad Irwin
3c053c7bc4 LspStore: move language_server_ids to local state too (#21786)
Attempt to further clarify what state is present in which mode

Release Notes:

- N/A
2024-12-10 00:15:06 -07:00
Conrad Irwin
48eed7499f Move diagnostics to the LocalLspStore (#21782)
This should be a no-op, but clarifies that some fields of the LspStore
were never actually used in the remote case.

Release Notes:

- N/A
2024-12-09 22:47:13 -07:00
Conrad Irwin
a35ef5b79f Fix diagnostics randomized tests (#21775)
These were silently passing after the delay in updating diagnostics was
added.

Co-Authored-By: Max <max@zed.dev>

cc @someonetoignore

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-12-09 21:56:43 -07:00
Marshall Bowers
8a85d6ef96 collab: Make metrics_id required in LlmTokenClaims (#21771)
This PR makes the `metrics_id` field on the `LlmTokenClaims` required,
as we always have one in practice.

Release Notes:

- N/A
2024-12-09 17:58:14 -05:00
Marshall Bowers
158cdc33ba collab: Attach additional properties to Language Model Used event (#21770)
This PR attaches two new properties to the `Language Model Used` event:

- `has_llm_subscription` - This will tell us if a user is a paid
subscriber.
- `max_monthly_spend_in_cents` - This will indicate what their maximum
monthly spend is set to.

Release Notes:

- N/A
2024-12-09 17:13:41 -05:00
Marshall Bowers
bdeac79d48 collab: Prevent max_monthly_llm_usage_spending_in_cents from being negative (#21768)
This PR fixes an issue where the
`max_monthly_llm_usage_spending_in_cents` preference could be set to a
negative value.

Release Notes:

- N/A
2024-12-09 16:55:26 -05:00
Mikayla Maki
73e0d816c4 Move ContextMenu out of editor.rs and rename ContextMenu to CodeContextMenu (#21766)
This is a no-functionality refactor of where the `ContextMenu` type is
defined. Just the type definition and implementation is up to almost
1,000 lines; so I've moved it to it's own file and renamed the type to
`CodeContextMenu`

Release Notes:

- N/A
2024-12-09 13:31:20 -08:00
Conrad Irwin
6538227f07 Revert "Avoid endless loop of the diagnostic updates (#21209)" (#21764)
This reverts commit 9999c31859.

Release Notes:

- Fixes diagnostics not updating in some circumstances
2024-12-09 14:15:23 -07:00
Marshall Bowers
ef45eca88e extension_host: Fix uploading dev extensions to the remote server (#21761)
This PR fixes an issue where dev extensions were not working when
uploaded to the remote server.

The `extension.toml` for dev extensions may not contain all of the
information (such as the list of languages), as this is something that
we derive from the filesystem at packaging time. This meant that
uploading a dev extension that contained languages could have them
absent from the uploaded `extension.toml`.

For dev extensions we now upload a serialized version of the in-memory
extension manifest, which should have all of the information present.

Release Notes:

- SSH Remoting: Fixed an issue where some dev extensions would not work
after being uploaded to the remote server.

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-12-09 15:23:28 -05:00
Michael Sloan
803855e7b1 Add async_task::spawn_local variant that includes caller in panics (#21758)
For debugging #21020. Copy-modified [from async_task
here](ca9dbe1db9/src/runnable.rs (L432))

Release Notes:

- N/A
2024-12-09 12:45:37 -07:00
Kirill Bulatov
25a5ad54ae Sync newly added diff hunks (#21759)
Fixed project diff multi buffer not expanding its diff until edited

Release Notes:

- N/A
2024-12-09 21:43:25 +02:00
Michael Sloan
a5355e92e3 Add per-language settings show_completions_on_input and show_completion_documentation (#21722)
Release Notes:

- Added `show_completions_on_input` and `show_completion_documentation`
per-language settings. These settings were available before, but were
not configurable per-language.
2024-12-09 11:53:50 -07:00
Piotr Osiewicz
b7edf31170 lsp: Disable usage of follow-up completion invokes (#21755)
Some of our users ran into a peculiar bug: autoimports with vtsls were
leaving behind an extra curly brace. I think we were slightly incorrect
in always requesting a follow-up completion without regard for last
result of completion request (whether it was incomplete or not).
Specifically, we're falling into this branch in current form:
037c2b615b/packages/service/src/service/completion.ts (L121)
which then leads to incorrect edits being returned from vtsls.

Release Notes:

- Fixed an edge case with appliance of autocompletions in VTSLS that
could result in incorrect edits being applied.
2024-12-09 19:10:34 +01:00
Michael Sloan
7bd69130f8 Make space for documentation aside during followup completion select (#21716)
The goal of #7115 appears to be to limit the disruptiveness of
completion documentation load causing the completion selector to move
around. The approach was to debounce load of documentation via a setting
`completion_documentation_secondary_query_debounce`. This particularly
had a nonideal interaction with #21286, where now this debounce interval
was used between the documentation fetches of every individual
completion item.

I think a better solution is to continue making space for documentation
to be shown as soon as any documentation is shown. #21704 implemented
part of this, but it did not persist across followup completions.

Release Notes:

- Fixed completion list moving around on load of documentation. The
previous approach to mitigating this was to rate-limit the fetch of
docs, configured by a
`completion_documentation_secondary_query_debounce` setting, which is
now deprecated.
2024-12-09 10:47:14 -07:00
Alexandre Hamez
2af9fa7785 docs: Add missing ':' (#21751)
Release Notes:

- N/A
2024-12-09 12:22:19 -05:00
Michael Sloan
16ecbafa7a Skip spawning task for background_executor.timer(Duration::ZERO) (#21729)
Release Notes:

- N/A
2024-12-09 10:18:18 -07:00
Travis Stevens
e5f3a683f0 Fixing Missing comma (#21749)
Fix a missing comma in the docs

Release Notes:

- N/A
2024-12-09 18:49:40 +02:00
Marshall Bowers
8c91eecb67 call: Add test-support feature for livekit_client_macos (#21748)
This PR updates the `call` crate to include the `test-support` feature
for `livekit_client_macos` when `call` is used with `test-support`.

This fixes running `cargo test -p copilot` and `cargo test -p editor`
(and perhaps some other crates).

Release Notes:

- N/A
2024-12-09 11:21:02 -05:00
Thorsten Ball
8fcaf8b870 collab: Fix compilation error by removing dependency on livekit_client (#21744)
This fixes collab not being able to compile anymore for Linux:


https://github.com/zed-industries/zed/actions/runs/12236650046/job/34130962682

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2024-12-09 15:14:46 +01:00
Antonio Scandurra
77b8296fbb Introduce staff-only inline completion provider (#21739)
Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
2024-12-09 14:26:36 +01:00
Piotr Osiewicz
39e8944dcc language_tools: Split LSP log view selector into two (#21742)
This should make it easier to interact with LSP log view when there are
multiple language servers. I often find the current UI clunky when I
have over 5 servers running (which isn't uncommon with multiple projects
open)


https://github.com/user-attachments/assets/2ecaf17f-4b40-4c8f-aa6f-03b437a3d979


Closes #ISSUE

Release Notes:

- N/A
2024-12-09 14:10:11 +01:00
Danilo Leal
a7d12eea39 Enhance the Vim Mode toggle discoverability (#21589)
Closes https://github.com/zed-industries/zed/issues/21522

This PR adds an info tooltip on the Welcome screen, informing users how
Vim Mode can be toggled on and off. It also adds the Vim Mode toggle in
the Editor Controls menu. This is all so that folks who accidentally
turn it on better know how to turn it off. We're of course already able
to toggle this setting via the command palette, but that may be harder
to reach for beginners. So, maybe that's enough to close the linked
issue? Open to feedback.

(Note: I also added a max-width to the tooltip's label in this PR. I'm
confident that this won't make any tooltip look weird/broken, but if it
does, it may be because of this new property).

| Welcome Page | Editor Controls |
|--------|--------|
| <img width="800" alt="Screenshot 2024-12-05 at 11 20 04"
src="https://github.com/user-attachments/assets/1229f866-6be5-45cd-a6b8-c805f72144a6">
| <img width="800" alt="Screenshot 2024-12-05 at 11 12 15"
src="https://github.com/user-attachments/assets/f082d7f9-7d56-41d1-bc86-c333ad6264c7">
|

Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-12-09 09:28:40 -03:00
Nils Koch
ce9e4629be Add go version to gopls cache key (#20922)
Closes #8071

Release Notes:

- Changed the Go integration to check whether an existing `gopls` was compiled for the current `go` version.

Previously we cached gopls (the go language server) as a file called
`gopls_{GOPLS_VERSION}`. The go version that gopls was built with is
crucial, so we need to cache the go version as well.

It's actually super interesting and very clever; gopls uses go to parse
the AST and do all the analyzation etc. Go exposes its internals in its
standard lib (`go/parser`, `go/types`, ...), which gopls uses to analyze
the user code. So if there is a new go release that contains new
syntax/features/etc. (the libraries `go/parser`, `go/types`, ...
change), we can rebuild the same version of `gopls` with the new version
of go (with the updated `go/xxx` libraries) to support the new language
features.

We had some issues around that (e.g., range over integers introduced in
go1.22, or custom iterators in go1.23) where we never updated gopls,
because we were on the latest gopls version, but built with an old go
version.

After this PR gopls will be cached under the name
`gopls_{GOPLS_VERSION}_go_{GO_VERSION}`.

Most users do not see this issue anymore, because after
https://github.com/zed-industries/zed/pull/8188 we first check if we can
find gopls in the PATH before downloading and caching gopls, but the
issue still exists.
2024-12-09 12:56:01 +01:00
Remco Smits
e58cdca044 Added JavaScript runnable detection for context and suite methods (#21719)
Fixes
https://github.com/zed-industries/zed/pull/21246#issuecomment-2525578141

<img width="545" alt="Screenshot 2024-12-08 at 22 58 33"
src="https://github.com/user-attachments/assets/2f303bfe-9718-4aa9-910e-613feca15ea8">
<img width="409" alt="Screenshot 2024-12-08 at 22 58 44"
src="https://github.com/user-attachments/assets/c4576cf7-fd71-44d2-911e-3ed944c9b794">

Release Notes:

- Added JavaScript runnable detection for `context` and `suite` methods
for mochajs framework
2024-12-09 13:17:51 +02:00
mgsloan@gmail.com
4564273322 Add comment explaining project panel behavior on right-click outside selection 2024-12-08 21:21:16 -07:00
João Marcos
55ee72d84a Simplify TextHighlights map (#21724)
Remove unnecessary `Option` wrapping.
2024-12-08 20:27:54 -07:00
tims
2ce01ead93 Fix right click selection behavior in project panel (#21707)
Closes #21605

Consider you have set of entries selected or even a single entry
selected, and you right click some other entry which is **not** part of
your selected set. This doesn't not clear existing entries selection
(which it should clear, as how file manager right-click logic works, see
more below).

This issue might lead unexpected operation like deletion applied on
those existing selected entries. This PR fixes it.

Release Notes:

- Fix right click selection behavior in project panel
2024-12-08 19:13:12 -07:00
Hendrik
bf1525588d Add .jj to default file exclusion (#21708)
Relates to #21538

Release Notes:

- Added `**/.jj` to the default file exclusion list.
2024-12-08 18:44:46 -07:00
Michael Sloan
d0e99f6496 Bump x11rb version to v0.13.1 (#21723)
From diff looks like no material differences. With a local checkout of
`v0.13.0` I get build errors due to warning checking when I use a `path
= ...` dependency, but it is fixed with `v0.13.1`.

I see mention of this in the [renovate configuration
PR](https://github.com/zed-industries/zed/pull/15132) but doesn't seem
like that initial batch of renovation happened.

Release Notes:

- N/A
2024-12-08 18:42:44 -07:00
Cole Miller
ac07b9197a gpui: Don't panic on failing to set X11 cursor style (#21689)
One more panic (well, two) that should be a `log_err`.

Release Notes:

- N/A
2024-12-08 13:30:23 -05:00
Michael Sloan
4b93a5ca44 Make completions selector continue to show docs aside if ever shown (#21704)
In #21286, documentation fetch was made more efficient by only
fetching the current completion. This has a side effect of causing the
aside to disappear and reappear when navigating the list. This is
particularly jarring when there isn't enough space for the aside,
causing the completions list to jump to the left.

The solution here is to continue to show the aside even if the current
selection does not yet have docs fetched.

Release Notes:

- N/A
2024-12-08 09:44:48 -07:00
Cole Miller
c5b6d78d5b project_diff: Keep going after failing to rescan a buffer (#21673)
I ran into a case locally where the project diff view was unexpectedly
empty because the first file to be scanned wasn't valid UTF-8, and the
inmost loop in `schedule_worktree_rescan` currently breaks when any
loading task fails. It seems like it might make more sense to continue
with the rest of the buffers in this case and also when
`Project::open_unstaged_changes` fails. I've left the error handling for
`update` as-is.

Release Notes:

- Fix project diff view missing files
2024-12-07 12:56:52 -05:00
Danilo Leal
eb3d3eaebf Adjust diagnostic in tabs behavior (#21671)
Follow up to https://github.com/zed-industries/zed/pull/21637

After discussing about this feature with the team, we've decided that
diagnostic display in tabs should be: 1) turned off by default, and 2)
only shown when there are file icons. The main reason here being to keep
Zed's UI uncluttered.

This means that you can technically have this setting:

```
  "tabs": {
    "show_diagnostics": "all"
  },
```

...and still don't see any diagnostics because you're missing
`file_icons": true`.

| Error with file icons | Error with no file icons |
|--------|--------|
| <img width="800" alt="Screenshot 2024-12-06 at 21 05 13"
src="https://github.com/user-attachments/assets/babf9cc3-b3b0-492e-9748-3e97d96ce90e">
| <img width="800" alt="Screenshot 2024-12-06 at 21 05 24"
src="https://github.com/user-attachments/assets/5247a5f1-55a0-4c56-8aaf-a0cdd115464f">
|


Release Notes:

- N/A
2024-12-07 11:00:31 -03:00
Piotr Osiewicz
fdc7751457 toolchains: Do not use as_json representation for PartialEq (#21682)
Closes #21679

Release Notes:

- N/A
2024-12-07 14:52:55 +01:00
Piotr Osiewicz
f561a91daf lsp: Add support for didRename/willRename LSP messages (#21651)
Closes #21564

Notably, RA will now rename module references if you change the source
file name via our project panel.

This PR is a tad bigger than necessary as I torn out the Model<> from
didSave watchers (I tried to reuse that code for the same purpose).
Release Notes:

- Added support for language server actions being executed on file
rename.
2024-12-07 13:08:18 +01:00
Kirill Bulatov
14ba4a9c94 Fix zoomed terminal pane issues on split (#21668)
Closes https://github.com/zed-industries/zed/issues/21652

* prevents zooming out the panel when any terminal pane is closed
* forces focus on new terminal panes, to prevent the workspace from
getting odd pane events in the background

Release Notes:

- (Preview only) Fixed zoomed terminal pane issues on split
2024-12-07 10:39:01 +02:00
Cole Miller
fa7dddd6b5 gpui: Don't panic when failing to exec system opener (#21674) 2024-12-06 22:11:40 -05:00
Conrad Irwin
4d22a07a1e Remove last few alt- bindings (#21669)
Although I hoped we could keep the non-ascii alt characters, it turns
out this is not the case for all keyboards.

Fixes #21175

Release Notes:

- (breaking change) editor::ShowInlineCompetion is now `option-tab` on
macOS
(not `option-/`). editor::{Next,Previous}Completion are `option-tab` and
  `option-shift-tab` (not `option-[` and `option-]`). This fixes typing
  characters generated by option-{/,[,]} on keyboards like Croatian.
2024-12-06 16:43:12 -07:00
Conrad Irwin
9e287b33e5 Update NorwegianExtended equivalents (#21665)
Release Notes:

- Impoved key equivalents for Norwegian Extended layout
2024-12-06 16:42:58 -07:00
Conrad Irwin
9d44ed0894 Stop overriding cancelOperation (#21667)
This was added before we were handling key equivalents, and is no longer
needed. Furthermore in the gpui2 re-write we stopped sending the correct
modifiers so this hasn't worked for the last year.

Fixes #21520

Release Notes:

- Fixed a bug where cmd-escape could act like .
2024-12-06 16:42:50 -07:00
Matin Aniss
21a6664cf8 gpui: Support animated WebP image (#20778)
Add support for decoding animated WebP images into their individual
frames.

Release Notes:

- N/A
2024-12-06 14:53:27 -08:00
Joseph T. Lyons
e019d1405a Send an event when user changes their max monthly spend limit (#21664)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-12-06 17:35:00 -05:00
feeiyu
e5374f5d7d windows: Ignore WM_SIZE event when minimizing window (#21533)
Closes #21364

Release Notes:

- Fixed minimize window and then reopen cause the layout changed


![layout1204](https://github.com/user-attachments/assets/e823da90-0cc6-4fc9-8b8e-82680357c6fe)
2024-12-06 14:15:04 -08:00
Mikayla Maki
de939e718a Simplify livekit config so that cargo check Just Works (#21661)
Supersedes https://github.com/zed-industries/zed/pull/21653

This enables us to use `cargo test -p workspace` on macOS and Linux.

Note that the line diffs in `shared_screen.rs` are spurious, I just
re-ordered the `macos` and `cross-platform` modules to match the order
in the call crate.

Release Notes:

- N/A
2024-12-06 13:50:59 -08:00
geemili
7d80d1208c vim: Add delete action to HelixNormal mode (#21544)
Related issue: https://github.com/zed-industries/zed/issues/4642

Release-Notes:

* N/A
2024-12-06 14:05:41 -07:00
Conrad Irwin
78ca297282 Make use_key_equivalents opt-in (#21662)
When revamping international keyboard shortcuts I wanted to make the
default to use key equivalents; in hindsight, this is not what people
expect.

Release Notes:

- (Breaking) In keymap.json `"use_layout_keys": true` is now the
default. If you want to opt-out of this behaviour, set
`"use_key_equivalents": true` to have keys mapped for your keyboard. See
[documentation](https://zed.dev/docs/key-bindings#non-qwerty-keyboards)

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-12-06 14:05:03 -07:00
The Bearodactyl
17448f23a6 docs: Add clarification in Windows build instructions (#21659) 2024-12-06 15:19:36 -05:00
Conrad Irwin
e730a9d029 Bump to livekit 1.1.6 (#21660)
Co-Authored-By: Mikayla <mikayla@zed.dev>

This bumps to the latest v1 version of swift SDK. We could bump to 2,
but it
sounds like this will already have some race condition fixes (and a
click
around locally seems less prone to deadlocking so far...)

Release Notes:

- N/A
2024-12-06 12:06:55 -08:00
Marshall Bowers
5142e38d2b editor: Add actions for inserting UUIDs (#21656)
This PR adds two new actions for generating and inserting UUIDs into the
buffer:


https://github.com/user-attachments/assets/a3445a98-07e2-40b8-9773-fd750706cbcc

Release Notes:

- Added `editor: insert uuid v4` and `editor: insert uuid v7` actions
for inserting generated UUIDs into the editor.
2024-12-06 14:32:09 -05:00
Peter Tripp
7a1a7929bd docs: Add x.ai Grok example (#21655)
- Closes https://github.com/zed-industries/zed/issues/21635

<img width="639" alt="Screenshot 2024-12-06 at 13 57 42"
src="https://github.com/user-attachments/assets/a4434edb-3c7d-40c0-9df8-7e928a9307d0">


Release Notes:

- Document support for x.ai Grok
2024-12-06 13:59:40 -05:00
renovate[bot]
0368fff030 Update cloudflare/wrangler-action digest to 6d58852 (#21551)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[cloudflare/wrangler-action](https://redirect.github.com/cloudflare/wrangler-action)
| action | digest | `05f17c4` -> `6d58852` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 13:16:53 -05:00
Jax Young
99c31816c9 docs: Correct default values (#20897)
Some default values in the doc are outdated.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-12-06 12:47:05 -05:00
uncenter
feb2d85a13 Add YAML/TOML frontmatter injections for markdown (#21503)
Closes #7938. Adds front-matter injections for TOML/YAML in markdown. 
- See: https://github.com/tree-sitter-grammars/tree-sitter-markdown/blob/split_parser/tree-sitter-markdown/queries/injections.scm.

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-12-06 12:34:15 -05:00
renovate[bot]
d6e11c58db Update Rust crate pathdiff to v0.2.3 (#21568)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pathdiff](https://redirect.github.com/Manishearth/pathdiff) |
workspace.dependencies | patch | `0.2.2` -> `0.2.3` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 12:33:33 -05:00
renovate[bot]
8a6c2bb749 Update Rust crate rsa to v0.9.7 (#21570)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [rsa](https://redirect.github.com/RustCrypto/RSA) |
workspace.dependencies | patch | `0.9.6` -> `0.9.7` |

---

### Release Notes

<details>
<summary>RustCrypto/RSA (rsa)</summary>

###
[`v0.9.7`](https://redirect.github.com/RustCrypto/RSA/compare/v0.9.6...v0.9.7)

[Compare
Source](https://redirect.github.com/RustCrypto/RSA/compare/v0.9.6...v0.9.7)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 12:32:45 -05:00
Bennet Bo Fenner
b4f59284a9 markdown preview: Allow clicking on image to navigate to source location (#21630)
Follow up to #21082

Similar to checkboxes, you can now click on the image to navigate to the
source location, cmd-clicking opens the url in the browser.


https://github.com/user-attachments/assets/edaaa580-9d8f-490b-a4b3-d6ffb21f197c


Release Notes:

- N/A
2024-12-06 18:31:58 +01:00
tims
bffdc55d63 linux: Make prompt detail selectable (#21405)
Closes #21305

As Linux doesn’t have native prompts, Zed uses a custom GPU-based
prompt, like the "About Zed" prompt. Currently, the detail in the prompt
isn’t selectable.

This PR fixes that by using the editor's multi-line selectable
functionality to make the detail selectable (and thus copyable). It
achieves this by disabling editing and setting the cursor to
transparent. The editor also does all the heavy lifting, like
double-clicking to select a word or triple-clicking to select a line,
like what user expects from selectable.

Before/After:

<img
src="https://github.com/user-attachments/assets/2012a6cc-a1ed-4efe-8bfb-440a9259f07a"
alt="before" width="360px" />

<img
src="https://github.com/user-attachments/assets/31922ef5-cb2d-4e90-a1a1-00843e767432"
alt="after" width="360px" />

When detail is `None` or empty string:

<img
src="https://github.com/user-attachments/assets/2be5c921-bda1-4db3-85cd-b4b0e2df86d2"
alt="none" width="360px" />

Release Notes:

- N/A
2024-12-06 09:26:47 -08:00
renovate[bot]
9ca0d99cfd Update Rust crate ctor to v0.2.9 (#21561)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ctor](https://redirect.github.com/mmastrac/rust-ctor) |
workspace.dependencies | patch | `0.2.8` -> `0.2.9` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 12:22:35 -05:00
tims
e5251f4091 Fix incorrect language selected in language selector (#21648)
Due to filtering after enumeration, initial candidate ids are assigned
incorrectly. This later causes the wrong item to be picked up when
accessed via index in the vector.
2024-12-06 12:03:58 -05:00
Cole Miller
304158ed79 Catch panic from oo7 when reading credentials (#21617) 2024-12-06 08:45:03 -05:00
Danilo Leal
e8f0ebc881 Refine diagnostic icons in tabs (#21637)
Follow up to https://github.com/zed-industries/zed/pull/21383

Mostly adjusting the alignment when there are no file icons.

<img width="800" alt="Screenshot 2024-12-06 at 08 35 48"
src="https://github.com/user-attachments/assets/6a4206cc-2af5-4317-a92e-49dffa37de99">

Release Notes:

- N/A
2024-12-06 09:17:48 -03:00
Danilo Leal
7b1d1bf79e Update panel.focused_border token across themes (#21612)
Follow up to https://github.com/zed-industries/zed/pull/21593

This PR updates all built-in themes `panel.focused_border` tokens using
the same HEX code used for `text_accent`.

There shouldn't be any visual change here given the project panel item,
when focused, was using `Color::Selected`, which maps to `text_accent`,
to color its border. In the linked PR above, the project panel item was
updated to use the dedicated token for that. This is good because now
theme markers will be able to customize them separately (e.g., having a
different `text_accent` color than `panel.focused_border`).

Release Notes:

- N/A
2024-12-06 09:17:34 -03:00
Nils Koch
4b16b73f80 Fix panel.background color override (#21559)
Closes #21266

Release Notes:

- Fixes not using the `panel.background` color in the file tree

See comments in https://github.com/zed-industries/zed/issues/21266 for
more details.

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2024-12-06 09:17:24 -03:00
Bennet Bo Fenner
7e40addb5f markdown preview: Fix panic when parsing empty image tag (#21616)
Closes #21534

While investigating the panic, I noticed that the code was pretty
complicated and decided to refactor parts of it to reduce redundancy.

Release Notes:

- Fixed an issue where the app could crash when opening the markdown
preview with a malformed image tag
2024-12-06 10:01:57 +01:00
Max Brunsfeld
f6b5e1734e Get unstaged changes when excerpts of new buffers are added (#21619)
This fixes an error on nightly, introduced in
https://github.com/zed-industries/zed/pull/21258, where diffs were not
shown for buffers that were added to multi-buffers after construction.

Release Notes:

- N/A
2024-12-05 16:52:14 -08:00
Mikayla Maki
cf4e847c62 Implement session-global include_warnings in the diagnostic item (#21618)
Release Notes:

- Make the include warnings toggle in the diagnostic tab global for a
zed session.
2024-12-05 16:32:17 -08:00
Nick Breaton
aff17322f3 Detect wider variety of usernames for SSH-based remotes (#21508)
Closes #21507

Release Notes:

- Fixed detection of git remotes when using SSH and username is not
"git".
2024-12-05 15:23:37 -08:00
renovate[bot]
28650b2fac Update Rust crate blake3 to v1.5.5 (#21554)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [blake3](https://redirect.github.com/BLAKE3-team/BLAKE3) |
workspace.dependencies | patch | `1.5.4` -> `1.5.5` |

---

### Release Notes

<details>
<summary>BLAKE3-team/BLAKE3 (blake3)</summary>

###
[`v1.5.5`](https://redirect.github.com/BLAKE3-team/BLAKE3/releases/tag/1.5.5)

[Compare
Source](https://redirect.github.com/BLAKE3-team/BLAKE3/compare/1.5.4...1.5.5)

version 1.5.5

Changes since 1.5.4:

-   `b3sum --check` now supports checkfiles with Windows-style newlines.
    `b3sum` still emits Unix-style newlines, even on Windows, but
    sometimes text editors or version control tools will swap them.
-   The "digest" feature (deleted in v1.5.2) has been added back to the
    `blake3` crate. This is for backwards compatibility only, and it's
    insta-deprecated. All callers should prefer the "traits-preview"
    feature.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-05 15:23:08 -08:00
Michael Sloan
6a4cd53fd8 Use LiveKit's Rust SDK on Linux while continue using Swift SDK on Mac (#21550)
Similar to #20826 but keeps the Swift implementation. There were quite a
few changes in the `call` crate, and so that code now has two variants.

Closes #13714

Release Notes:

- Added preliminary Linux support for voice chat and viewing
screenshares.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-12-05 15:06:17 -08:00
Danilo Leal
0511768b22 project panel: Use theme token for focused border color (#21593)
Closes https://github.com/zed-industries/zed/issues/12723

This PR makes the border color of a focused project panel item use the
`panel_focused_border` theme token. This allow theme makers to customize
that independently of the `text_accent` color, which was the one being
previously used.

### One Dark

| Before | After |
|--------|--------|
| <img width="800" alt="Screenshot 2024-12-05 at 18 37 00"
src="https://github.com/user-attachments/assets/8b21f1e3-1738-42ab-af30-ad7d589007c1">
| <img width="800" alt="Screenshot 2024-12-05 at 18 39 42"
src="https://github.com/user-attachments/assets/1a424765-a1b6-48eb-ae75-1ffba2b59da3">
|
| <img width="800" alt="Screenshot 2024-12-05 at 18 37 08"
src="https://github.com/user-attachments/assets/d1955cf2-e194-46a5-9518-dc3af7f70cfe">
| <img width="800" alt="Screenshot 2024-12-05 at 18 39 51"
src="https://github.com/user-attachments/assets/99413075-f021-4961-8f03-ad1b40503ea6">
|

### Gruvbox Hard

| Before | After |
|--------|--------|
| <img width="800" alt="Screenshot 2024-12-05 at 18 38 05"
src="https://github.com/user-attachments/assets/cf84ce75-ac8a-4cb6-aaab-81e02bfb4835">
| <img width="800" alt="Screenshot 2024-12-05 at 18 40 15"
src="https://github.com/user-attachments/assets/f62b815b-8bed-41d8-85a1-7091d04bfbd2">
|
| <img width="800" alt="Screenshot 2024-12-05 at 18 38 16"
src="https://github.com/user-attachments/assets/fb458fa2-6ce1-4af0-a7a6-83584f3e5ed0">
| <img width="800" alt="Screenshot 2024-12-05 at 18 39 57"
src="https://github.com/user-attachments/assets/8bf44fe6-7090-4ef0-8b56-b8aa2e1f314d">
|

Release Notes:

- N/A
2024-12-05 19:17:26 -03:00
Marshall Bowers
c8b3c4c6cd assistant2: Add ability to delete past threads (#21607)
This PR adds the ability to delete past threads in Assistant2.

Release Notes:

- N/A
2024-12-05 15:57:35 -05:00
Kirill Bulatov
1efd165ead Restore project diff test (#21606)
Restores a basic project diff test

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2024-12-05 21:48:33 +02:00
Marshall Bowers
787c75cbda assistant2: Add thread history (#21599)
This PR adds support for thread history to the Assistant 2 panel.

We also now generate summaries for the threads.

<img width="986" alt="Screenshot 2024-12-05 at 12 56 53 PM"
src="https://github.com/user-attachments/assets/46cb1309-38a2-4ab9-9fcc-c1275d4b5f2c">

<img width="986" alt="Screenshot 2024-12-05 at 12 56 58 PM"
src="https://github.com/user-attachments/assets/8c91ba57-a6c5-4b88-be05-b22fb615ece5">

Release Notes:

- N/A

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-12-05 13:22:25 -05:00
Thorsten Ball
2d43ad12e6 git: Make worktrees work for bare git repositories (#21596)
Fixes #21210 by ensuring that Zed can open worktrees of bare git repositories.

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-12-05 12:55:40 -05:00
Nils Koch
6ebd6c2893 Show error and warning indicators in tabs (#21383)
Closes #21179

Release Notes:

- Add setting to display error and warning indicators in tabs.

<img width="454" alt="demo_with_icons"
src="https://github.com/user-attachments/assets/6002b4d4-dca8-4e2a-842d-1df3e281fcd2">
<img width="454" alt="demo_without_icons"
src="https://github.com/user-attachments/assets/df4b67bd-1a6c-4354-847e-d7fea95c1b7e">
2024-12-05 11:43:04 -03:00
Cole Miller
92dea066dd Extend filtering of backtrace frames a bit (#21573)
Both rust_begin_unwind and _rust_begin_unwind appear in practice, not sure why.

Release Notes:

- N/A
2024-12-05 09:33:46 -05:00
Anthony Eid
7335f211fd Add Project Panel navigation actions in netrw mode (#20941)
Release Notes:

- Added "[ c" & "] c" To select prev/next git modified file within the
project panel
- Added "[ d" & "] d" To select prev/next file with diagnostics from an
LSP within the project panel
- Added "{" & "}" To select prev/next directory within the project panel

Note:

I wanted to extend project panel's functionality when netrw is active so
I added some shortcuts that I believe will be helpful for most users. I
tried to keep the default key mappings for the shortcuts inline with
Zed's vim mode.

## Selecting prev/next modified git file

https://github.com/user-attachments/assets/a9c057c7-1015-444f-b273-6d52ac54aa9c


## Selecting prev/next diagnostics 

https://github.com/user-attachments/assets/d1fb04ac-02c6-477c-b751-90a11bb42a78

## Selecting prev/next directories (Only works with visible directoires)

https://github.com/user-attachments/assets/9e96371e-105f-4fe9-bbf7-58f4a529f0dd
2024-12-05 14:07:13 +01:00
Kirill Bulatov
78fea0dd8e Defer is_staff check for the project_diff::Deploy action (#21582)
During workspace registration, it's too early to check for the
`is_staff` flag due to no connection being established yet.
As a compromise, allow the action to appear and be registered, but do
nothing for non-staff users.

Release Notes:

- N/A
2024-12-05 11:55:06 +02:00
tims
9487fffc55 Fix snippet completion will be trigger, when certain symbols are pressed (#21578)
Closes #21576

This issue is caused by the fuzzy matching for snippets I added
[here](https://github.com/zed-industries/zed/pull/21524). When
encountering symbols such as `:`, `(`, `.`, etc., the `last_word`
becomes empty, which results in an empty string being passed to
`fuzzy_match`, leading to the return of all templates.

This fix adds an early return when `last_word` is empty.

Release Notes:

- N/A
2024-12-05 09:01:35 +01:00
Cole Miller
b9c390c22e Revert "Open folds containing selections when jumping from multibuffer (#21433)" (#21566)
This reverts commit dc32ab25a0.

This has been causing panics, backing it out while figuring out what's
up.

Release Notes:

- N/A
2024-12-04 19:26:09 -05:00
renovate[bot]
31c976d8d9 Update Rust crate cargo_metadata to v0.19.1 (#21556)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [cargo_metadata](https://redirect.github.com/oli-obk/cargo_metadata) |
workspace.dependencies | patch | `0.19.0` -> `0.19.1` |

---

### Release Notes

<details>
<summary>oli-obk/cargo_metadata (cargo_metadata)</summary>

###
[`v0.19.1`](https://redirect.github.com/oli-obk/cargo_metadata/compare/0.19.0...0.19.1)

[Compare
Source](https://redirect.github.com/oli-obk/cargo_metadata/compare/0.19.0...0.19.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 18:07:45 -05:00
renovate[bot]
5b169fa535 Update Rust crate anyhow to v1.0.94 (#21552)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anyhow](https://redirect.github.com/dtolnay/anyhow) |
workspace.dependencies | patch | `1.0.93` -> `1.0.94` |

---

### Release Notes

<details>
<summary>dtolnay/anyhow (anyhow)</summary>

###
[`v1.0.94`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.94)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.93...1.0.94)

-   Documentation improvements

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 18:04:24 -05:00
Max Brunsfeld
a2115e7242 Restructure git diff state management to allow viewing buffers with different diff bases (#21258)
This is a pure refactor of our Git diff state management. Buffers are no
longer are associated with one single diff (the unstaged changes).
Instead, there is an explicit project API for retrieving a buffer's
unstaged changes, and the `Editor` view layer is responsible for
choosing what diff to associate with a buffer.

The reason for this change is that we'll soon want to add multiple "git
diff views" to Zed, one of which will show the *uncommitted* changes for
a buffer. But that view will need to co-exist with other views of the
same buffer, which may want to show the unstaged changes.

### Todo

* [x] Get git gutter and git hunks working with new structure
* [x] Update editor tests to use new APIs
* [x] Update buffer tests
* [x] Restructure remoting/collab protocol
* [x] Update assertions about staged text in
`random_project_collaboration_tests`
* [x] Move buffer tests for git diff management to a new spot, using the
new APIs

Release Notes:

- N/A

---------

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Cole <cole@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-12-04 15:02:33 -08:00
Marshall Bowers
31796171de assistant2: Sketch in context picker (#21560)
This PR sketches in a context picker into the message editor in
Assistant 2. Not functional yet.

<img width="1138" alt="Screenshot 2024-12-04 at 5 45 19 PM"
src="https://github.com/user-attachments/assets/053d6224-de76-4fde-914b-41fe835761eb">

Release Notes:

- N/A
2024-12-04 18:00:28 -05:00
Marshall Bowers
a30ea2fc68 assistant2: Factor out ActiveThread view (#21555)
This PR factors a new `ActiveThread` view out of the `AssistantPanel` to
group together the state that pertains solely to the active view.

There was a bunch of related state on the `AssistantPanel` pertaining to
the active thread that needed to be initialized/reset together and it
makes for a clearer narrative is this state is encapsulated in its own
view.

Release Notes:

- N/A
2024-12-04 16:39:39 -05:00
Kirill Bulatov
55ecb3c51b Regenerate completion labels on resolve (#21521)
Closes https://github.com/zed-industries/zed/issues/21516

Technically, this is an LSP violation from `vtsls`, but seems that it's
not going to be fixed adequately on that side, see
https://github.com/yioneko/vtsls/issues/213 for more context.
So, we have to accommodate at least for now.

Release Notes:

- Fixed completion item labels not being updated after the resolve for
non-LSP compliant servers
2024-12-04 23:37:24 +02:00
Kirill Bulatov
8d18dfa4c1 Add a prototype with a multi buffer having all project git changes (#21543)
Part of https://github.com/zed-industries/zed/issues/20925

This prototype is behind a feature flag and being merged to avoid
conflicts with further git-related resturctures.
To be a proper, public feature, this needs at least:
* showing deleted files
* better performance 
* randomized tests
* `TODO`s in the `project_diff.rs` file fixed

The good thing is, >90% of the changes are in the `project_diff.rs` file
only, have a basic test and already work on simple cases.

Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <thorsten@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
2024-12-04 23:36:36 +02:00
Michael Sloan
f0fac41ca4 Add action editor::OpenContextMenu (#21494)
This addresses the editor context menu portion of #17819.

Release Notes:

- Added `editor::OpenContextMenu` action to open context menu at current
cursor position.
2024-12-04 14:13:50 -07:00
Marshall Bowers
0bde0f8e2f assistant2: Add ability to open past threads (#21548)
This PR adds the ability to open past threads in Assistant 2.

There are also some mocked threads in the history for testing purposes.

Release Notes:

- N/A
2024-12-04 14:35:44 -05:00
Conrad Irwin
44264ffedc Revert accidental change to Rust outline files (#21545)
Release Notes:

- Preview only: Fixed impl blocks in the rust outline view
2024-12-04 11:58:56 -07:00
Marshall Bowers
7cfc972df6 assistant2: Add empty state for new threads (#21542)
This PR adds an empty state for new threads in Assistant2:

<img width="1138" alt="Screenshot 2024-12-04 at 12 17 46 PM"
src="https://github.com/user-attachments/assets/ff7b4533-d3b8-4722-bd4b-43fac6d35a77">

This is mostly just a sketch in its current state.

Release Notes:

- N/A
2024-12-04 12:44:03 -05:00
Stanislav Alekseev
fee0624299 Force code actions to be single line (#21409)
Addresses #21403 partially. Is consistent with the behaviour in VSCode

Before:
<img width="332" alt="391571084-1bef4ef9-b8f5-4c8f-9a32-9c0ab6c91af1"
src="https://github.com/user-attachments/assets/d4d83826-23a1-43a1-94f9-feb0b0ddd5ce">

After:
<img width="330" alt="Screenshot 2024-12-02 at 18 35 11"
src="https://github.com/user-attachments/assets/c04f0494-4f34-476a-a090-1443d61851e5">

Release Notes:

- Fixed an issue with multiline code actions' rendering by forcing them
to be single line
2024-12-04 18:39:23 +01:00
Peter Tripp
cf781dff71 v0.166.x dev 2024-12-04 12:01:28 -05:00
Piotr Osiewicz
706372fe4e title_bar: Add show_user_picture setting to let users hide their profile picture (#21526)
Fixes #21464

Closes #21464

Release Notes:

- Added `show_user_picture` setting (default: true) to allow users to
hide their profile picture in titlebar.
2024-12-04 17:59:27 +01:00
Vedant Matanhelia
5948ea217b Configure Highlight settings on yank vim (#21479)
Release Notes:

- Add settings / config variables to control `highlight_on_yank` or
`highlight_on_copy`

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-12-04 09:23:31 -07:00
Marshall Bowers
207eb51df1 assistant2: Style inline code in Markdown (#21536)
This PR adds some styling for inline code within the messages to
differentiate them from the surrounding text:

<img width="1138" alt="Screenshot 2024-12-04 at 10 58 14 AM"
src="https://github.com/user-attachments/assets/3bb92711-e2f7-454a-b4be-449c6a9bf591">


Release Notes:

- N/A
2024-12-04 11:14:35 -05:00
David Soria Parra
0ee99c6d9c context_server: Add missing types for MCP spec to protocol 2024-11-05 (#21498)
This commit syncs missing types for the mcp spec 2024-11-05.

Release Notes:

- N/A
2024-12-04 10:45:25 -05:00
tims
d8732adfb2 Add fuzzy matching for snippets completions (#21524)
Closes #21439

This PR uses fuzzy matching for snippet completions instead of
fixed-prefix matching. This mimics the behavior of VSCode.

<img
src="https://github.com/user-attachments/assets/68537114-c5cf-4e4d-bc5c-4bb69ce947e5"
alt="fuzzy" width="450px" />

Release Notes:

- Improved suggestions for snippets.
2024-12-04 13:40:53 +01:00
Conrad Irwin
196fd65601 Fix panic folding in multi-buffers (#21511)
Closes #19054

Rename `max_buffer_row()` to `widest_line_number()` to (hopefully)
prevent
people assuming it means the same as `max_point().row`.

Release Notes:

- Fixed a panic when folding in a multibuffer
2024-12-04 00:01:32 -07:00
Conrad Irwin
e231321655 Fix panic in update_ime_position (#21510)
This can call back into the app, so must be done when the platform lock
is not
held.

Release Notes:

- Fixes a (rare) panic when changing tab
2024-12-03 23:20:25 -07:00
Waleed Dahshan
8f08787cf0 Implement Helix Support (WIP) (#19175)
Closes #4642 

- Added the ability to switch to helix normal mode, with an additional
helix visual mode.
- <kbd>ctrl</kbd><kbd>h</kbd> from Insert mode goes to Helix Normal
mode. <kbd> i </kbd> and <kbd> a </kbd> to go back.
- Need to find a way to perform the helix normal mode selection with
<kbd> w </kbd>, <kbd>e </kbd>, <kbd> b </kbd> as a first step. Need to
figure out how the mode will interoperate with the VIM mode as the new
additions are in the same crate.
2024-12-03 23:19:52 -07:00
Cole Miller
c5d15fd065 Add FoldFunctionBodies editor action (#21504)
Related to #19424

This uses the new text object support, so will only work for languages
that have `textobjects.scm`. It does not integrate with
indentation-based folding for now, and the syntax-based folds don't have
matching fold markers in the gutter (unless they are folded).

Release Notes:

- Add an editor action to fold all function bodies

Co-authored-by: Conrad <conrad@zed.dev>
2024-12-03 23:23:16 -05:00
Cole Miller
ce5f492404 Update rustls and sqlx (#21506)
Release Notes:

- N/A
2024-12-03 23:22:26 -05:00
Marshall Bowers
3019960f83 markdown: Make cx the last parameter to Markdown::new_text (#21497)
This PR is a follow-up to
https://github.com/zed-industries/zed/pull/21487 to make sure that the
`cx` is the last parameter to `Markdown::new_text` as well.

Release Notes:

- N/A
2024-12-03 18:39:00 -05:00
Marshall Bowers
9f459ba573 assistant2: Render messages as Markdown (#21496)
This PR updates Assistant 2 to render the messages in the thread as
Markdown:

<img width="1138" alt="Screenshot 2024-12-03 at 6 09 27 PM"
src="https://github.com/user-attachments/assets/c1c44fde-1efb-43cf-b9c9-768e6974c753">

Release Notes:

- N/A
2024-12-03 18:32:13 -05:00
Peter Tripp
ecaf44511c Fix Perplexity extension URL (#21495) 2024-12-03 18:28:59 -05:00
Cole Miller
dc32ab25a0 Open folds containing selections when jumping from multibuffer (#21433)
When searching within a single buffer, activating a search result causes
any fold containing the result to be unfolded. However, this didn't
happen when jumping to a search result from a project-wide search
multibuffer. This PR fixes that.

Release Notes:

- Fixed folds not opening when jumping from search results multibuffer
2024-12-03 17:14:17 -05:00
Marshall Bowers
aca23da971 assistant2: Render messages in the thread using a list (#21491)
This PR updates the rendering of the messages in the current thread to
use a `gpui::list`.

Release Notes:

- N/A
2024-12-03 16:25:09 -05:00
Conrad Irwin
db34f29300 vim: Add == and fix = in the status bar (#21490)
cc @maxbrunsfeld

Release Notes:

- vim: Add ==
2024-12-03 14:18:19 -07:00
Conrad Irwin
1fccda7b8d Add text objects to extensions (#21488)
Release Notes:

- Adds textobject support to erlang, haskell, lua, php, prisma, proto,
toml, and zig
2024-12-03 13:56:25 -07:00
Conrad Irwin
463c99b503 Fix script/get-released-version (#21489)
Release Notes:

- N/A
2024-12-03 13:56:01 -07:00
Marshall Bowers
88b0d3c78e markdown: Make cx the last parameter to the constructor (#21487)
I noticed that `Markdown::new` didn't have the `cx` as the final
parameter, as is conventional.

This PR fixes that.

Release Notes:

- N/A
2024-12-03 15:27:58 -05:00
Peter Tripp
165d50ff5b Add openbsd netcat to script/linux (#21478)
- Follow-up to: https://github.com/zed-industries/zed/pull/20751

openbsd-netcat is required for interactive SSH Remoting prompts
(password, passphrase, 2fa, etc).
2024-12-03 15:27:12 -05:00
Conrad Irwin
731e6d31f6 Revert "macos: Add default keybind for ctrl-home / ctrl-end (#21007)" (#21476)
This reverts commit 614b3b979b.

This conflicts with the macOS `ctrl-fn-left/right` bindings for moving
windows around (new in Sequoia).

If you want these use:
```
  {
    "context": "Editor",
    "bindings": {
      "ctrl-home": "editor::MoveToBeginning",
      "ctrl-end": "editor::MoveToEnd"
    }
  },
```

Release Notes:

- N/A
2024-12-03 13:10:02 -07:00
Conrad Irwin
b28287ce91 Fix panic in remove_item (#21480)
In #20742 we added a call to remove_item that retain an item index over
an
await point. This led to a race condition that could panic if another
tab was
removed during that time. (cc @mgsloan)

This changes the API to make it harder to misuse.

Release Notes:

- Fixed a panic when closing tabs containing new unsaved files
2024-12-03 13:09:53 -07:00
Conrad Irwin
492ca219d3 Fix panic in autoclosing (#21482)
Closes #14961

Release Notes:

- Fixed a panic when backspacing at the start of a buffer with
`always_treat_brackets_as_autoclosed` enabled.
2024-12-03 13:09:44 -07:00
Jason Lee
afb253b406 ui: Ensure Label with single_line set does not wrap (#21444)
Release Notes:

- N/A

---

Split from #21438, this change for make sure the `single_line` mode
Label will not be wrap.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-12-03 13:03:53 -05:00
Peter Tripp
41a973b13f Publish theme json schema v0.2.0 (#21428)
Fix theme json schema so `./script/import-themes print-schema` works again
Update schema to reflect current structs
([diff](https://gist.github.com/notpeter/26e6d0939985f542e8492458442ac62a/revisions?diff=unified&w=))

https://zed.dev/schema/themes/v0.2.0.json
2024-12-03 12:57:39 -05:00
Conrad Irwin
75c9dc179b Add textobjects queries (#20924)
Co-Authored-By: Max <max@zed.dev>

Release Notes:

- vim: Added motions `[[`, `[]`, `]]`, `][` for navigating by section,
`[m`, `]m`, `[M`, `]M` for navigating by method, and `[*`, `]*`, `[/`,
`]/` for comments. These currently only work for languages built in to
Zed, as they are powered by new tree-sitter queries.
- vim: Added new text objects: `ic`, `ac` for inside/around classes,
`if`,`af` for functions/methods, and `g c` for comments. These currently
only work for languages built in to Zed, as they are powered by new
tree-sitter queries.

---------

Co-authored-by: Max <max@zed.dev>
2024-12-03 10:37:01 -07:00
Conrad Irwin
c443307c19 Fix ctrl-alt-X shortcuts (#21473)
The macOS input handler assumes that you want to insert control
sequences when
you type ctrl-alt-X (you probably don't...).

Release Notes:

- (nightly only) fix ctrl-alt-X shortcuts
2024-12-03 10:26:19 -07:00
Peter Tripp
2dd5138988 docs: Add anchor links for language-specific settings (#21469) 2024-12-03 11:54:06 -05:00
Kirill Bulatov
a464474df0 Properly handle opening of file-less excerpts (#21465)
Follow-up of https://github.com/zed-industries/zed/pull/20491 and
https://github.com/zed-industries/zed/pull/20469
Closes https://github.com/zed-industries/zed/issues/21369

Release Notes:

- Fixed file-less excerpts always opening instead of activating
2024-12-03 18:41:36 +02:00
Kirill Bulatov
a0f2c0799e Debounce diagnostics status bar updates (#21463)
Closes https://github.com/zed-industries/zed/pull/20797

Release Notes:

- Fixed diagnostics status bar flashing when typing
2024-12-03 17:27:59 +02:00
Sebastian Nickels
1270ef3ea5 Enable toolchain venv in new terminals (#21388)
Fixes part of issue #7808 

> This venv should be the one we automatically activate when opening new
terminals, if the detect_venv setting is on.

Release Notes:

- Selected Python toolchains (virtual environments) are now automatically activated in new terminals.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-12-03 16:24:30 +01:00
Danilo Leal
a76cd778c4 Disable hunk diff arrow buttons when there's only one hunk (#21437)
Closes https://github.com/zed-industries/zed/issues/20817

| One hunk | Multiple hunks |
|--------|--------|
| <img width="800" alt="Screenshot 2024-12-03 at 09 42 49"
src="https://github.com/user-attachments/assets/7c2ff80a-d4d9-4a74-84b8-891fadfd4e6c">
| <img width="800" alt="Screenshot 2024-12-02 at 23 36 38"
src="https://github.com/user-attachments/assets/60ea94b8-0b23-43a2-afad-b816b4645d1f">
|

Release Notes:

- Fixed showing prev/next hunk navigation buttons when there is only one
hunk
2024-12-03 10:07:59 -03:00
Jason Lee
a8c7e61021 Fix AI Context menu text wrapping causing overlap (#21438)
Closes https://github.com/zed-industries/zed/issues/20678

| Before | After |
| --- | --- |
| <img width="672" alt="SCR-20241203-jreb"
src="https://github.com/user-attachments/assets/411ba2a6-712f-4ab7-a320-12ac9a35c1e1">
| <img width="771" alt="SCR-20241203-jwhe"
src="https://github.com/user-attachments/assets/022c8ee9-4089-4c09-aa4b-12a0f5528822">
|

Release Notes:

- Fixed AI Context menu text wrapping causing overlap.

Also cc #21409 @WeetHet @osiewicz to use `Label`, this PR has been fixed
`Label` to ensure `whitespace_nowrap` when use `single_line`.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2024-12-03 01:45:15 -03:00
Danilo Leal
2b143784da Improve audio files icon (#21441)
It took me a couple of minutes of staring at this speaker icon to figure
out it was a speaker! I even researched whether the `.wav` file type had
a specific icon, given I thought it was a specific triangle of sorts 😅
I'm sensing audio waves, at this size, will be easier to parse.

Release Notes:

- N/A
2024-12-03 00:40:46 -03:00
Cole Miller
b53b2c0376 Run dependency review for pull requests only (#21432)
This was an oversight in the original PR, dependency-review-action won't
work properly for `push` events
([example](https://github.com/zed-industries/zed/actions/runs/12130053580/job/33819624076)).

Release Notes:

- N/A
2024-12-02 19:39:18 -05:00
Cole Miller
e1c509e0de Check for vulnerable dependencies in CI (#21424)
This PR adds GitHub's dependency review action to CI, to flag PRs that
introduce new Cargo.lock entries for vulnerable crates according to the
GHSA database.

An alternative would be to run `cargo audit`, which checks against the
RustSec database. The state of synchronization between these two
databases seems a bit messy, but as far as I can tell GHSA has most
recent RustSec advisories on file, while RustSec is missing a larger
number of recent GHSA advisories.

The dependency review action should be smart enough not to flag PRs
because an untouched entry in Cargo.lock has a new advisory.

I've turned off the "license check" functionality since we have a
separate CI step for that.

Release Notes:

- N/A
2024-12-02 18:48:03 -05:00
Michael Sloan
f4dbcb6714 Use explicit sort order instead of comparison impls for gpui prims (#21430)
Found this while looking into adding support for the Surface primitive
on Linux, for rendering video shares. In that case it would be
expensive to compare images for equality. `Eq` and `PartialEq` were
being required but not used here due to use of `Ord` and `PartialOrd`.

Release Notes:

- N/A
2024-12-02 16:27:29 -07:00
Kyle Kelley
579bc8f015 Upgrade repl dependencies (#21431)
Bump dependencies for jupyter packages. cc @maxdeviant 

Release Notes:

- N/A
2024-12-02 15:22:03 -08:00
Max Brunsfeld
7c994cd4a5 Add AutoIndent action and '=' vim operator (#21427)
Release Notes:

- vim: Added the `=` operator, for auto-indent

Co-authored-by: Conrad <conrad@zed.dev>
2024-12-02 15:00:04 -08:00
Marshall Bowers
f3140f54d8 assistant2: Wire up error messages (#21426)
This PR wires up the error messages for Assistant 2 so that they are
shown to the user:

<img width="1138" alt="Screenshot 2024-12-02 at 4 28 02 PM"
src="https://github.com/user-attachments/assets/d8a5b9bd-0cef-4304-b561-b2edadbc70ef">
<img width="1138" alt="Screenshot 2024-12-02 at 4 29 09 PM"
src="https://github.com/user-attachments/assets/0dd70841-0d5a-4de6-bebe-82c563246b65">
<img width="1138" alt="Screenshot 2024-12-02 at 4 32 49 PM"
src="https://github.com/user-attachments/assets/a8838866-fad1-43a9-8935-490dc1936016">

@danilo-leal I kept the existing UX from Assistant 1, as I didn't see
any errors in the design prototype, but we can revisit if another
approach would work better.

Release Notes:

- N/A
2024-12-02 16:54:46 -05:00
yoleuh
72afe684b8 assistant: Use a smaller icon for the "New Chat" button (#21425)
Assistant new chat icon is slightly larger than editor pane new icon.

Changes:
Adds `IconSize::Small` to assistant default size new chat icon, not
really noticeable, but matches the new icon in editor pane, and the
assistant dropdown menu that have icon size small.

|old|new|
|---|---|

|![image](https://github.com/user-attachments/assets/cbef5054-a465-4957-9409-b4a73e703363)|![image](https://github.com/user-attachments/assets/baee66ea-76d6-43b4-a4b9-ead34991ff85)|

Release Notes:

- N/A
2024-12-02 16:48:20 -05:00
Piotr Osiewicz
59dc6cf523 toolchains: Run listing tasks on background thread (#21414)
Potentially fixes #21404

This is a speculative fix, as while I was trying to repro this issue
I've noticed that introducing artificial delays in ToolchainLister::list
could impact apps responsiveness. These delays were essentially there to
stimulate PET taking a while to find venvs.

Release Notes:

- Improved app responsiveness in environments with multiple Python
virtual environments
2024-12-02 21:03:31 +01:00
Marshall Bowers
b88daae67b assistant2: Add support for using tools provided by context servers (#21418)
This PR adds support to Assistant 2 for using tools provided by context
servers.

As part of this I introduced a new `ThreadStore`.

Release Notes:

- N/A

---------

Co-authored-by: Cole <cole@zed.dev>
2024-12-02 15:01:18 -05:00
Piotr Osiewicz
f32ffcf5bb workspace: Sanitize pinned tab count before usage (#21417)
Fixes all sorts of panics around usage of incorrect pinned tab count
that has been fixed in app itself, yet persists in user db.

Closes #ISSUE

Release Notes:

- N/A
2024-12-02 19:56:52 +01:00
Piotr Osiewicz
95a047c11b tasks/rust: Add support for running examples as binary targets (#21412)
Closes #21044

Release Notes:

- Added support for running Rust examples as tasks.
2024-12-02 19:53:51 +01:00
Kirill Bulatov
dbe41823d9 Use proper terminal item for splitting context (#21415)
Closes https://github.com/zed-industries/zed/issues/21411

Release Notes:

- N/A
2024-12-02 20:46:28 +02:00
Conrad Irwin
7c40824783 Fix macOS IME overlay positioning (#21416)
Release Notes:

- Improved positioning of macOS IME overlay

---------

Co-authored-by: Richard Feldman <richard@zed.dev>
2024-12-02 11:46:14 -07:00
Conrad Irwin
4e12f0580a Fix dismissing the IME viewer with escape (#21413)
Co-Authored-By: Richard Feldman <richard@zed.dev>

Closes #21392

Release Notes:

- Fixed dismissing the macOS IME menu with escape when no marked text
was present

---------

Co-authored-by: Richard Feldman <richard@zed.dev>
2024-12-02 11:20:27 -07:00
Danilo Leal
f795ce9623 Add language icons to the language selector (#21298)
Closes https://github.com/zed-industries/zed/issues/21290

This is a first attempt to show the language icons to the selector.
Ideally, I wouldn't like to have yet another place mapping extensions to
icons, as we already have the `file_types.json` file doing that, but I'm
not so sure how to pull from it yet. Maybe in a future pass we'll
improve this and make it more solid.

<img width="700" alt="Screenshot 2024-11-28 at 16 10 27"
src="https://github.com/user-attachments/assets/683c3bef-5389-470f-a41e-3d510b927b61">

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-12-02 15:01:09 -03:00
uncenter
995b40f149 Add "Copy Extension ID" action to extension card dropdown (#21395)
Adds a new "Copy Extension ID" action to the dropdown of remote
extension cards in the extensions list UI. Would have liked for it to be
a context menu where you could click anywhere on the card, but couldn't
figure out how to integrate that with the existing setup.

I've been missing this from VSCode's extension panel, which allows this
on right click:

![CleanShot 2024-12-01 at 22 03
14](https://github.com/user-attachments/assets/64796f96-1a37-4ba2-bfe1-971b939aa50a)

This is useful if you, say, want to add some extensions to
https://zed.dev/docs/configuring-zed#auto-install-extensions, where you
need the IDs.

Release Notes:

- Added "Copy Extension ID" action to extension card dropdown

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-12-02 11:19:42 -05:00
Piotr Osiewicz
89e46396f6 workspace: Serialize active panel even if it's not visible (#21408)
Fixes #21285

Closes #21285

Release Notes:

- Fixed workspace serialization of collapsed panels
2024-12-02 17:08:16 +01:00
Finn Evers
3987d0d731 Treat .pcss files as CSS (#21402)
This addresses
https://github.com/zed-industries/zed/pull/19416#discussion_r1865019293
and also follows the [associated PostCSS file extensions for VS
Code](5d003170c5/package.json (L37)).

Release Notes:

- `.pcss` files are now recognized as CSS

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-12-02 10:56:47 -05:00
loczek
6cb758a1cd theme_importer: Add more mappings (#21393)
This PR adds `search_match_background` and `editor_document_highlight_bracket_background` color mappings as they appear to be missing.
2024-12-02 09:37:41 -05:00
Delyan Angelov
0cb3a6ed0e Add V file icon (#20017)
Here is a preview of the new `v.svg` in comparison with some of the
existing icons:

![image](https://github.com/user-attachments/assets/451762ff-b13a-42b9-89ac-695f25a43a84)

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2024-12-02 10:51:28 -03:00
Danilo Leal
2300f40cd9 Add consistent placeholder text for terminal inline assist (#21398)
Ensuring it is consistent with the buffer inline assistant. Just thought
of not having "Transform" here as that felt it made less sense for
terminal-related prompts, where arguably more frequently, one would be
suggesting for actual commands rather than code transformation.

<img width="700" alt="Screenshot 2024-12-02 at 09 11 00"
src="https://github.com/user-attachments/assets/ad96d03e-0366-46e8-8056-581066712d59">

Release Notes:

- N/A
2024-12-02 09:28:46 -03:00
Danilo Leal
dacd919e27 Add setting for making the tab's close button always visible (#21352)
Closes https://github.com/zed-industries/zed/issues/20422

<img width="700" alt="Screenshot 2024-11-29 at 22 00 20"
src="https://github.com/user-attachments/assets/4a17d00c-d64f-4b33-97a7-a57766ce6d17">

Release Notes:

- N/A
2024-12-02 07:48:10 -03:00
Danilo Leal
740ba7817b Fine-tune terminal tab bar actions spacing (#21391)
Just quickly reducing the spacing between the terminal tab bar actions
so they're tighter and matching other similar components.

| Before | After |
|--------|--------|
| <img width="800" alt="Screenshot 2024-12-01 at 19 20 50"
src="https://github.com/user-attachments/assets/938336df-9ce1-42d3-8f3d-9c26b8e88453">
| <img width="800" alt="Screenshot 2024-12-01 at 19 18 19"
src="https://github.com/user-attachments/assets/0a2b5915-f37c-4b8e-af2c-b8018c4750ab">
|

Release Notes:

- N/A
2024-12-02 07:47:57 -03:00
fred-sch
380679fcc2 Fix: Copilot Chat is logged out (#21360)
Closes #21255

Release Notes:

- Fixed Copilot Chat OAuth Token parsing

---------

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-12-02 10:35:29 +01:00
moskirathe
89a56968f6 Fix typos in key-bindings documentation (#21390)
Release Notes:

Fixes two minor typos in the key-bindings documentation.
2024-12-01 19:02:12 -03:00
Kirill Bulatov
5f6b200d8d Do not change selections when opening FS entries (#21382)
Follow-up of https://github.com/zed-industries/zed/pull/21375

When changing selections for FS entries, outline panel will be forced to
change item to the first excerpt which is not what we want.

Release Notes:

- N/A
2024-12-01 14:28:48 +02:00
yoleuh
4d5415273e Docs: Update developing zed docs to match (#21379)
Some changes just so the build docs for the different os matches each
other :)

macos:
- moved `rust wasm toolchain install` up under `rust install` (match
windows docs)
- add instructions to update rust if already installed (match windows
and linux docs)

windows:
- add `(required by a dependency)` to cmake install (match macos docs)

Release Notes:

- N/A
2024-12-01 10:59:29 +02:00
Kirill Bulatov
bf569d720e Always change editor selection when navigating outline panel entries (#21375)
Also scroll to the center when doing so.

This way, related editor's breadcrumbs always update, bringing more
information.

Release Notes:

- Adjust outline panel item opening behavior to always change the editor
selection, and center it
2024-12-01 01:49:41 +02:00
Kirill Bulatov
28849dd2a8 Fix item closing overly triggering save dialogues (#21374)
Closes https://github.com/zed-industries/zed/issues/12029

Allows to introspect project items inside items more deeply, checking
them for being dirty.
For that:
* renames `project::Item` into `project::ProjectItem`
* adds an `is_dirty(&self) -> bool` method to the renamed trait
* changes the closing logic to only care about dirty project items when
checking for save prompts conditions
* save prompts are raised only if the item is singleton without a
project path; or if the item has dirty project items that are not open
elsewhere

Release Notes:

- Fixed item closing overly triggering save dialogues
2024-12-01 01:48:31 +02:00
Agustin Gomes
c2cd84a749 Add musl-gcc as dependency (#21366)
This addition comes after attempting building Zed from source.

As part of the process, one of the components (a crate I presume) called
`ring` failed to compile due to the following sequence of console
messages:

```log
warning: ring@0.17.8: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `musl-gcc` installed?
warning: ring@0.17.8: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `musl-gcc` installed?

error: failed to run custom build command for `ring v0.17.8`
```

Adding this library should help fix the issue on Fedora 41 at least, and
possibly will help fixing it for other RedHat based distributions as
well.

Closes #ISSUE

Release Notes:

- Add musl-gcc as dependency

Signed-off-by: Agustin Gomes <me@agustingomes.com>
2024-11-30 13:20:31 -08:00
tims
d609931e1c linux: Fix mouse cursor size and blur on Wayland (#21373)
Closes #15788, #13258

This is a long-standing issue with a few previous attempts to fix it,
such as [this one](https://github.com/zed-industries/zed/pull/17496).
However, that fix was later reverted because it resolved the blur issue
but caused a size issue. Currently, both blur and size issues persist
when you set a custom cursor size from GNOME Settings and use fractional
scaling.

This PR addresses both issues.

---

### Context

A new Wayland protocol,
[cursor-shape-v1](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194),
allows the compositor to handle rendering the cursor at the correct size
and shape. This protocol is implemented by KDE, wlroots (Sway-like
environments), etc. Zed supports this protocol, so there are no issues
on these desktop environments.

However, GNOME has not yet
[adopted](https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6212) this
protocol. As a result, apps must fall back to manually rendering the
cursor by specifying the theme, size, scale, etc., themselves. Zed also
implements this fallback but does not correctly account for the display
scale.

---

### Scale Fix

For example, if your cursor size is `64px` and you’re using fractional
scaling (e.g., `150%`), the display scale reported by the window query
will be an integer value, `2` in this case. Why `2` if the scale is
`150%`? That’s what the new protocol aims to improve. However, since
GNOME Wayland uses this integer scale everywhere, it’s sufficient for
our use case.

To fix the issue, we set the `buffer_scale` to this value. But that
alone doesn’t solve the problem. We also need to generate a matching
theme cursor size for this scaled version. This can be calculated as
`64px` * `2`, resulting in `128px` as the theme cursor size.

---

### Size Fix

The XDG Desktop Portal’s `cursor-size` event fails to read the cursor
size because it expects an `i32` but encounters a type error with `u32`.
Due to this, the cursor size was interpreted as the default `24px`
instead of the actual size set via user.

---

### Tested

This fix has been tested with all possible combinations of the
following:

- [x] GNOME Normal Scale (100%, 200%, etc.)
- [x] GNOME Fractional Scaling (125%, 150%, etc.)
- [x] GNOME Cursor Sizes (**Settings > Accessibility > Seeing**, e.g.,
`24px`, `64px`, etc.)
- [x] GNOME Experimental Feature `scale-monitor-framebuffer` (both
enabled and disabled)
- [x] KDE (`cursor-shape-v1` protocol)

---

**Result:**

64px custom cursor size + 150% Fractional Scale:


https://github.com/user-attachments/assets/cf3b1a0f-9a25-45d0-ab03-75059d3305e7

---

Release Notes:

- Fixed mouse cursor size and blur issues on Wayland
2024-11-30 13:19:44 -08:00
Remco Smits
fd71801346 Improve JavaScript runnable detection followup (#21363)
Followup: https://github.com/zed-industries/zed/pull/21246

**Before**
<img width="545" alt="Screenshot 2024-11-30 at 13 27 15"
src="https://github.com/user-attachments/assets/3346e485-96c8-482d-b5fd-85b86f37d662">
**After**
<img width="537" alt="Screenshot 2024-11-30 at 13 27 36"
src="https://github.com/user-attachments/assets/3cedcaa5-e285-47fb-909d-16d37d9844ca">

We did not need to add the `*` as it was already matching one of them,
we actually need at least one of them, so making it optional was a
mistake.

Don't think we need to add release notes, as the change is only on main
the branch now.

Release Notes:

- N/A
2024-11-30 13:55:14 +01:00
Haru Kim
c1de606581 Fix the autoscroll_on_clicks setting working incorrectly (#21362) 2024-11-30 14:30:27 +02:00
Kirill Bulatov
57a45d80ad Add a keybinding to the Go to Line button (#21350)
Release Notes:

- N/A
2024-11-30 00:50:38 +02:00
tims
5f29f214c3 linux: Fix file not opening from file explorer (#21137)
Closes #20070

Release Notes:

- Fixed issue where files wouldn't open from the file explorer.
- Fixed "Open a new workspace" option on the desktop entry right-click
menu.

Context:

Zed consists of two binaries:

- `zed` (CLI component, located at `crates/cli/main.rs`)
- `zed-editor` (GUI component, located at `crates/zed/main.rs`)

When `zed` is used in the terminal, it checks if an existing instance is
running. If one is found, it sends data via a socket to open the
specified file. Otherwise, it launches a new instance of `zed-editor`.
For more details, see the `detect` and `boot_background` functions in
`crates/cli/main.rs`.

Root Cause:

Install process creates directories like `.local/zed.app` and
`.local/zed-preview.app`, which contain desktop entries for the
corresponding release. For example, `.local/zed.app/share/applications`
contains `zed.desktop`.

This desktop entry includes a generic `Exec` field, which is correct by
default:

```sh
Comment=A high-performance, multiplayer code editor.
TryExec=zed
StartupNotify=true
```

The issue is in the `install.sh` script. This script copies the above
desktop file to the common directory for desktop entries
(.local/share/applications). During this process, it replaces the
`TryExec` value from `zed` with the exact binary path to avoid relying
on the shell's PATH resolution and to make it explicit.

However, replacement incorrectly uses the path for `zed-editor` instead
of the `zed` CLI binary. This results in not opening a file as if you
use `zed-editor` directly to do this it will throw `zed is already
running` error on production and open new instance on dev.


Note: This PR solves it for new users. For existing users, they will
either have to update `.desktop` file manually, or use `install.sh`
script again. I'm not aware of zed auto-update method, if it runs
`install.sh` under the hood.
2024-11-29 23:01:29 +02:00
tims
4bf59393ec linux: Fix Zed not visible in "Open With" list in file manager for Flatpak (#21177)
- Closes #19030

When `%U` is used in desktop entries, file managers pick this and use
it:

- When you right-click a file and choose "Open with..."
- When you drag and drop files onto an application icon

<img
src="https://github.com/user-attachments/assets/ea5aa008-b81c-4f10-9302-b82332f6b174"
width="200px" alt="image">

Adding it to CLI args, changes Flatpak desktop entry `Exec` from:

```diff
- Exec=/usr/bin/flatpak run --branch=master --arch=x86_64 --command=zed dev.zed.ZedDev --foreground
+ Exec=/usr/bin/flatpak run --branch=master --arch=x86_64 --command=zed --file-forwarding dev.zed.ZedDev --foreground @@u %U @@
```

This is Flatpak's way of doing `%U`, by adding `--file-forwarding` and
wrapping arg with `@@u` and `@@`.
Read more below
([source](https://docs.flatpak.org/en/latest/flatpak-command-reference.html)):

> --file-forwarding
>
> If this option is specified, the remaining arguments are scanned, and
all arguments that are enclosed between a pair of '@@' arguments are
interpreted as file paths, exported in the document store, and passed to
the command in the form of the resulting document path. Arguments
between "@@u" and "@@" are considered URIs, and any "file:" URIs are
exported. The exports are non-persistent and with read and write
permissions for the application.

Release Notes:

- Fixed Zed not visible in the "Open with" list in the file manager for
Flatpak.
2024-11-29 22:59:04 +02:00
moshyfawn
aea6fa0c09 Remove project panel trash action for remote projects (#21300)
Closes #20845

I'm uncertain about my placement for the logic to remove actions from
the command palette list. If anyone has insights or alternative
approaches, I'm open to changing the code.

Release Notes:

- Removed project panel `Trash` action for remote projects.

---------

Co-authored-by: Finn Evers <dev@bahn.sh>
2024-11-29 22:37:24 +02:00
Danilo Leal
4137d1adb9 Make project search landing page scrollable if too small (#21338)
Address
https://github.com/zed-industries/zed/issues/21317#issuecomment-2508011556


https://github.com/user-attachments/assets/089844fc-a485-44a6-8e8b-d294f28e9ea2

Release Notes:

- N/A
2024-11-29 12:45:08 -03:00
Danilo Leal
1903a29cca Expose "Column Git Blame" in the editor controls menu (#21336)
Closes https://github.com/zed-industries/zed/issues/10196

I think having this action exposed in the editor controls menu, close to
the inline Git Blame option, makes more sense than a more prominent item
somewhere else in the app. Maybe having it there will increase its
discoverability. I myself didn't know this until a few weeks ago! Next
steps would be ensuring the menu exposes its keybindings.

(Quick note about the menu item name: I think maybe "_Git Blame Column_"
would make more sense and feel grammatically more correct, but then we
would have two Git Blame-related options, one with "Git Blame" at the
start (Inline...) and another with "Git Blame" at the end (... Column).
I guess one had to be sacrificed for the sake of consistency 😅.)

<img width="750" alt="Screenshot 2024-11-29 at 12 01 33"
src="https://github.com/user-attachments/assets/2f3324ec-a2f0-4303-9582-714d0ee6bd31">

Release Notes:

- N/A
2024-11-29 12:38:12 -03:00
Danilo Leal
69c761f5a5 Adjust project search landing page layout (#21332)
Closes https://github.com/zed-industries/zed/issues/21317


https://github.com/user-attachments/assets/a4970c08-9715-4c90-ad48-8f6e80c6fcd0

Release Notes:

- N/A
2024-11-29 11:39:02 -03:00
Kirill Bulatov
0306bdc695 Use a single action for toggling the language (#21331)
Follow-up of https://github.com/zed-industries/zed/pull/21299

Release Notes:

- N/A
2024-11-29 16:02:57 +02:00
yoleuh
de55bd8307 Status bar: Reduce right tools lateral margin (#21329)
Closes #21316

| Before | After |
|--------|-------|
|
![image](https://github.com/user-attachments/assets/525d16b0-c1f0-4d93-9a8e-19112b927e78)|
![image](https://github.com/user-attachments/assets/c6947c3e-6b46-4498-a672-5f418f5faad0)|

Changes:
changed `Base08` to `Base04` in `render_right_tools`

Release Notes:

- N/A
2024-11-29 10:56:32 -03:00
Kirill Bulatov
a593a04da4 Update the lockfile after a recent dependency update (#21328)
Follow-up of https://github.com/zed-industries/zed/pull/21288

Release Notes:

- N/A
2024-11-29 15:39:18 +02:00
наб
74f265e5cf Update to embed-resource 3.0 (fixes build below windows \?\ path) (#21288)
Accd'g to
https://github.com/zed-industries/zed/pull/9009#issuecomment-1983599232
the manifest is required

Followup for
https://github.com/nabijaczleweli/rust-embed-resource/issues/71

Release Notes:
- N/A
2024-11-29 14:43:40 +02:00
Haru Kim
f9d5de834a Disable editor autoscroll on mouse clicks (#20287)
Closes #18148

Release Notes:

- Stop scrolling when clicking to the edges of the visible text area.
Use `autoscroll_on_clicks` to configure this behavior.


https://github.com/user-attachments/assets/3afd5cbb-5957-4e39-94c6-cd2e927038fd

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-11-29 13:51:36 +02:00
Haru Kim
eadb107339 Allow workspace::ActivatePaneInDirection to navigate out of the terminal panel (#21313)
Enhancement for #21238

Release Notes:

- N/A
2024-11-29 13:04:58 +02:00
Stanislav Alekseev
94faf9dd56 nix: Return to building with crane (#21292)
This removes .envrc, putting it into gitignore as well as building with
crane, as it does not require an up to date hash for a FOD.

Release Notes:

- N/A

cc @mrnugget @jaredramirez
2024-11-29 10:09:33 +01:00
Kirill Bulatov
73f546ea5f Force ashpd crate to not use tokio (#21315)
https://github.com/zed-industries/zed/issues/21304

Fixes a regression after
https://github.com/zed-industries/zed/pull/20939

Release Notes:

- N/A
2024-11-29 11:02:56 +02:00
Danilo Leal
eb2c0b33df Fine-tune status bar left-side spacing (#21306)
Closes https://github.com/zed-industries/zed/issues/21291

This PR also adds a small divider separating the panel-opening controls
from the other items that appear on the left side of the status bar. The
spacing was a bit bigger before because all three items on the left open
panels, whereas each other item does different things (e.g., open the
diagnostics tab, update the app, display language server status, etc.).
Therefore, they needed to be separated somehow to communicate the
difference in behavior. Hopefully, now, the border will help sort of
figuring this out.

| With error | Normal state |
|--------|--------|
| <img width="1179" alt="Screenshot 2024-11-28 at 18 52 58"
src="https://github.com/user-attachments/assets/bf4bad19-5588-481a-9d08-91b2227e44e6">
| <img width="1234" alt="Screenshot 2024-11-28 at 18 53 03"
src="https://github.com/user-attachments/assets/4443a16a-9982-44ce-9005-64d4df46f4f0">
|

Release Notes:

- N/A
2024-11-28 19:15:30 -03:00
Danilo Leal
3458687300 Add keybinding to the language selector tooltip (#21299)
Just making sure sure we're always making keyboard navigation
discoverable.

<img width="700" alt="Screenshot 2024-11-28 at 16 05 40"
src="https://github.com/user-attachments/assets/bd7611f0-190c-4e3b-ad69-9552060e37ea">

Release Notes:

- N/A
2024-11-28 18:28:20 -03:00
Danilo Leal
e76589107d Improve the "go to line" modal (#21301)
Just a small, mostly visual refinement to this component.

<img width="700" alt="Screenshot 2024-11-28 at 16 30 27"
src="https://github.com/user-attachments/assets/d5bbed63-202c-4cd3-b4b0-b7ed23466309">

Release Notes:

- N/A
2024-11-28 18:28:05 -03:00
Danilo Leal
ae85ecba2d Make fetch slash command visible in the command selector (#21302)
The `/fetch` command is naturally already accessible via the completion
menu when you type / in the assistant panel, but it wasn't on the "Add
Context" command selector. I think it should! It's a super nice/powerful
one, and I've seen folks not knowing it existed. Side-note: maybe, in
the near future, it'd be best to rename it to "`/web`, as that's an
easier name to parse and assume what it does.

<img width="700" alt="Screenshot 2024-11-28 at 16 52 07"
src="https://github.com/user-attachments/assets/37134e1c-c788-48ca-81ae-d7416e8c8706">

Release Notes:

- N/A
2024-11-28 18:26:59 -03:00
Kirill Bulatov
0acd98a07e Do not show cursor position for empty files (#21295)
Closes https://github.com/zed-industries/zed/issues/21289

Fixes most of the issues: does not display cursor position in empty
multi buffers and on non-full editors.

Does not fix the startup issue, as it's caused by the AssistantPanel's
`ContextEditor` acting as an `Editor`, so whenever default prompts are
added, those are registered as added editors, and Zed shows some line
numbers for them.

We cannot replace `item.act_as::<Editor>(cx)` with
`item.downcast::<Editor>()` as then multi bufers' navigation will fall
off (arguably, those line numbers do not make that much sense too, but
still seem useful).
This will will fix itself in the future, when assistant panel gets
reworked into readonly view by default, as `assistant2` crate already
shows (there's no `act_as` impl there and nothing cause issue).

Since the remaining issue is minor and will go away on any focus change,
and future changes will alter this, closing the original issue.

Release Notes:

- Improved cursor position display
2024-11-28 20:42:57 +02:00
Matin Aniss
4a96db026c gpui: Implement hover for Windows (#20894) 2024-11-28 18:45:10 +02:00
Danilo Leal
301a8900a5 Add consistency between buffer and project search design (#20754)
Follow up to https://github.com/zed-industries/zed/pull/20242

This PR adds the `SearchInputWidth` util, which sets a threshold
container size in which an input's width stops filling the available
space. In practice, this is in place to make the buffer and project
search input fill the whole container width up to a certain point (where
this point is really an arbitrary number that can be fine-tuned per
taste). For folks using huge monitors, the UX isn't excellent if you
have a gigantic input.

In the future, upon further review, maybe it makes more sense to
reorganize this code better, baking it in as a default behavior of the
input component. Or even exposing this is a function many other
components could use, given we may want to have dynamic width in
different scenarios.

For now, I just wanted to make the design of these search UIs better and
more consistent.

| Buffer Search | Project Search |
|--------|--------|
| <img width="1042" alt="Screenshot 2024-11-15 at 20 39 21"
src="https://github.com/user-attachments/assets/f9cbf0b3-8c58-46d1-8380-e89cd9c89699">
| <img width="1042" alt="Screenshot 2024-11-15 at 20 39 24"
src="https://github.com/user-attachments/assets/ed244a51-ea55-4fe3-a719-a3d9cd119aa9">
|

Release Notes:

- N/A
2024-11-28 13:39:49 -03:00
Kirill Bulatov
f30944543e Do less resolves when showing the completion menu (#21286)
Closes https://github.com/zed-industries/zed/issues/21205

Zed does completion resolve on every menu item selection and when
applying the edit, so resolving all completion menu list is excessive
indeed.

In addition to that, removes the documentation-centric approach of menu
resolves, as we're actually resolving these for more than that, e.g.
additionalTextEdits and have to do that always, even if we do not show
the documentation.

Potentially, we can omit the second resolve too, but that seems
relatively dangerous, and many servers remove the `data` after the first
resolve, so a 2nd one is not that harmful given that we used to do much
more

Release Notes:

- Reduced the amount of `completionItem/resolve` calls done in the
completion menu
2024-11-28 18:16:37 +02:00
Gowtham K
6cba467a4e project-panel: Fix playback GIF images (#21274) 2024-11-28 03:20:10 -08:00
CharlesChen0823
cacec06db6 search: Treat non-word char as whole-char when searching (#19152)
when search somethings like `clone(`, with search options `match case
sensitively` and `match whole words` in zed code base, only `clone(cx)`
hit match, `clone()` will not hit math.

Release Notes:

- Improved buffer search for queries ending with non-letter characters
2024-11-28 11:06:48 +02:00
Zach Bruggeman
3ac119ac4e Fix hovered links underline not showing when using cmd_or_ctrl for multi_cursor_modifier (#20949)
I use `cmd_or_ctrl` for `multi_cursor_modifier`, but noticed that if I
hovered a code reference while holding alt, it wouldn't show the
underline. Instead, it would only show when pressing cmd. Looking at the
code, it seems like this was just a small oversight on always checking
for `modifiers.secondary`, instead of reading from the
`multi_cursor_modifier` setting to determine which button was invoking
link handling.


---

Release Notes:

- Fixed underline when hovering a code link not showing when
`multi_cursor_modifier` is `cmd_or_ctrl`
2024-11-28 11:00:45 +02:00
Jaagup Averin
b12a508ed9 python: Fix highlighting for forward references (#20766)
[PEP484](https://peps.python.org/pep-0484/) defines "Forward references"
for undefined types. This PR treats such annotations as types rather
than strings.
Release Notes:

- Added Python syntax highlighting for forward references.
2024-11-28 09:59:10 +01:00
renovate[bot]
1739de59d4 Update Rust crate proc-macro2 to v1.0.92 (#20967)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [proc-macro2](https://redirect.github.com/dtolnay/proc-macro2) |
dependencies | patch | `1.0.89` -> `1.0.92` |

---

### Release Notes

<details>
<summary>dtolnay/proc-macro2 (proc-macro2)</summary>

###
[`v1.0.92`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.92)

[Compare
Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.91...1.0.92)

- Improve compiler/fallback mismatch panic message
([#&#8203;487](https://redirect.github.com/dtolnay/proc-macro2/issues/487))

###
[`v1.0.91`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.91)

[Compare
Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.90...1.0.91)

- Fix panic *"compiler/fallback mismatch 949"* when using
TokenStream::from_str from inside a proc macro to parse a string
containing doc comment
([#&#8203;484](https://redirect.github.com/dtolnay/proc-macro2/issues/484))

###
[`v1.0.90`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.90)

[Compare
Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.89...1.0.90)

- Improve error recovery in TokenStream's and Literal's FromStr
implementations to work around
[https://github.com/rust-lang/rust/issues/58736](https://redirect.github.com/rust-lang/rust/issues/58736)
such that rustc does not poison compilation on codepaths that should be
recoverable errors
([#&#8203;477](https://redirect.github.com/dtolnay/proc-macro2/issues/477),
[#&#8203;478](https://redirect.github.com/dtolnay/proc-macro2/issues/478),
[#&#8203;479](https://redirect.github.com/dtolnay/proc-macro2/issues/479),
[#&#8203;480](https://redirect.github.com/dtolnay/proc-macro2/issues/480),
[#&#8203;481](https://redirect.github.com/dtolnay/proc-macro2/issues/481),
[#&#8203;482](https://redirect.github.com/dtolnay/proc-macro2/issues/482))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:58:53 +02:00
renovate[bot]
4aa47a9063 Update Rust crate rodio to 0.20.0 (#20955)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [rodio](https://redirect.github.com/RustAudio/rodio) | dependencies |
minor | `0.19.0` -> `0.20.0` |

---

### Release Notes

<details>
<summary>RustAudio/rodio (rodio)</summary>

###
[`v0.20.1`](https://redirect.github.com/RustAudio/rodio/blob/HEAD/CHANGELOG.md#Version-0201-2024-11-08)

[Compare
Source](https://redirect.github.com/RustAudio/rodio/compare/v0.20.0...v0.20.1)

##### Fixed

-   Builds without the `symphonia` feature did not compile

###
[`v0.20.0`](https://redirect.github.com/RustAudio/rodio/blob/HEAD/CHANGELOG.md#Version-0200-2024-11-08)

[Compare
Source](https://redirect.github.com/RustAudio/rodio/compare/v0.19.0...v0.20.0)

##### Added

-   Support for *ALAC/AIFF*
- Add `automatic_gain_control` source for dynamic audio level
adjustment.
-   New test signal generator sources:
- `SignalGenerator` source generates a sine, triangle, square wave or
sawtooth
        of a given frequency and sample rate.
    -   `Chirp` source generates a sine wave with a linearly-increasing
        frequency over a given frequency range and duration.
- `white` and `pink` generate white or pink noise, respectively. These
sources depend on the `rand` crate and are guarded with the "noise"
        feature.
- Documentation for the "noise" feature has been added to `lib.rs`.
-   New Fade and Crossfade sources:
    -   `fade_out` fades an input out using a linear gain fade.
- `linear_gain_ramp` applies a linear gain change to a sound over a
given duration. `fade_out` is implemented as a `linear_gain_ramp` and
        `fade_in` has been refactored to use the `linear_gain_ramp`
        implementation.

##### Fixed

- `Sink.try_seek` now updates `controls.position` before returning.
Calls to `Sink.get_pos`
    done immediately after a seek will now return the correct value.

##### Changed

-   `SamplesBuffer` is now `Clone`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:58:36 +02:00
renovate[bot]
fe30a03921 Update Rust crate ipc-channel to 0.19 (#20951)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ipc-channel](https://redirect.github.com/servo/ipc-channel) |
dependencies | minor | `0.18` -> `0.19` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:58:10 +02:00
renovate[bot]
38900c2321 Update Rust crate bytemuck to v1.20.0 (#20947)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bytemuck](https://redirect.github.com/Lokathor/bytemuck) |
dependencies | minor | `1.19.0` -> `1.20.0` |

---

### Release Notes

<details>
<summary>Lokathor/bytemuck (bytemuck)</summary>

###
[`v1.20.0`](https://redirect.github.com/Lokathor/bytemuck/compare/v1.19.0...v1.20.0)

[Compare
Source](https://redirect.github.com/Lokathor/bytemuck/compare/v1.19.0...v1.20.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:56:36 +02:00
renovate[bot]
6927512e34 Update Rust crate ashpd to 0.10.0 (#20939)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ashpd](https://redirect.github.com/bilelmoussaoui/ashpd) |
workspace.dependencies | minor | `0.9.1` -> `0.10.0` |

---

### Release Notes

<details>
<summary>bilelmoussaoui/ashpd (ashpd)</summary>

###
[`v0.10.2`](https://redirect.github.com/bilelmoussaoui/ashpd/releases/tag/0.10.2)

[Compare
Source](https://redirect.github.com/bilelmoussaoui/ashpd/compare/0.10.1...0.10.2)

-   Add `backend` feature to docs.rs

###
[`v0.10.1`](https://redirect.github.com/bilelmoussaoui/ashpd/releases/tag/0.10.1)

[Compare
Source](https://redirect.github.com/bilelmoussaoui/ashpd/compare/0.10.0...0.10.1)

#### What's Changed

- desktop/activation-token: Add helper for retriving the token from a
`gtk::Widget` or a `WlSurface`
-   desktop/secret: Close the socket after done reading
-   desktop/input-capture: Fix barrier-id type
-   desktop: Use a Pid alias all over the codebase
-   desktop/notification: Support v2 of the interface
- Introduce backend implementation support, allowing to write a portal
implementation in pure Rust. Currently, we don't support Session based
portals. The backend feature is considered experimental as we might
possibly introduce API breaking changes in the future but it should be
good enough for getting started. Examples of how a portal can be
implemented can be found in
[backend-demo](https://redirect.github.com/bilelmoussaoui/ashpd/tree/master/backend-demo)

**Note**: The 0.10.0 release has been yanked from crates.io as it
contained a build error when the `glib` feature is enabled.

###
[`v0.10.0`](https://redirect.github.com/bilelmoussaoui/ashpd/compare/0.9.2...0.10.0)

[Compare
Source](https://redirect.github.com/bilelmoussaoui/ashpd/compare/0.9.2...0.10.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:56:21 +02:00
renovate[bot]
4342a93d22 Update Rust crate tree-sitter-c to v0.23.2 (#20938)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [tree-sitter-c](https://redirect.github.com/tree-sitter/tree-sitter-c)
| workspace.dependencies | patch | `0.23.1` -> `0.23.2` |

---

### Release Notes

<details>
<summary>tree-sitter/tree-sitter-c (tree-sitter-c)</summary>

###
[`v0.23.2`](https://redirect.github.com/tree-sitter/tree-sitter-c/releases/tag/v0.23.2)

[Compare
Source](https://redirect.github.com/tree-sitter/tree-sitter-c/compare/v0.23.1...v0.23.2)

**NOTE:** Download `tree-sitter-c.tar.xz` for the *complete* source
code.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:55:57 +02:00
renovate[bot]
28640ac076 Update astral-sh/setup-uv digest to caf0cab (#20927)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [astral-sh/setup-uv](https://redirect.github.com/astral-sh/setup-uv) |
action | digest | `2e657c1` -> `caf0cab` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-28 10:55:46 +02:00
feeiyu
c2c968f2de Enable clangd's dot-to-arrow feature (#21142)
Closes #20815


![dot2arrow1127](https://github.com/user-attachments/assets/d825f9bf-52ae-47ee-b3a3-5f952b6e8979)

Release Notes:
- Enabled clangd's dot-to-arrow feature
2024-11-28 10:43:25 +02:00
Stanislav Alekseev
a4584c9d13 Add an uninstall script (#21213)
Closes #14306

This looks at what #16660 did and install.sh script as a base for the
uninstall.sh script. The script is bundled with the cli by default
unless the cli/no-bundled-uninstall feature is selected which is done,
so package managers could build zed without bundling a useless feature
and increasing binary size.

I don't have capabilities to test this right now, so any help with that
is appreciated.

Release Notes:

- Added an uninstall script for Zed installations done via zed.dev. To
uninstall zed, run `zed --uninstall` via the CLI binary.
2024-11-28 10:31:12 +02:00
Jason Lee
e9e260776b gpui: Fix default colors blue, red, green to match in CSS default colors (#20851)
Release Notes:

- N/A

---

This change to let the default colors to 100% match with CSS default
colors.

And update the methods to as `const`.

Here is an example:

<img width="338" alt="image"
src="https://github.com/user-attachments/assets/dd17b46a-3ad4-4122-8dca-e800644c75b0">

https://codepen.io/huacnlee/pen/ZEgNXJZ

But the before version for example blue: `h: 0.6 * 360 = 216`, but we
expected `240`, `240 / 360 = 0.666666666`, so the before version are
lose the precision. (Here is a test tool: https://hslpicker.com/#0000FF)

## After Update

```bash
cargo run -p gpui --example hello_world
```

<img width="612" alt="image"
src="https://github.com/user-attachments/assets/97d479d8-9c71-4be3-95e0-09af45fe47e2">
2024-11-28 10:08:07 +02:00
Jared Ramirez
461ab24a06 Update nix cargo hash (#21257)
Closes https://github.com/zed-industries/zed/issues/21256

Release Notes:

- N/A
2024-11-28 08:04:11 +02:00
Remco Smits
04ff9f060c Improve runnable detection for JavaScript files (#21246)
Closes #21242

![Screenshot 2024-11-27 at 18 52
51](https://github.com/user-attachments/assets/d096197c-33d2-41b9-963d-3e1a9bbdc035)
![Screenshot 2024-11-27 at 18 53
08](https://github.com/user-attachments/assets/b3202b00-3f68-4d9d-acc2-1b86c081fc34)

Release Notes:

- Improved runnable detection for JavaScript/Typescript files.
2024-11-28 00:54:01 +01:00
Kirill Bulatov
66ba9d5b4b Use item context for pane tab context menu (#21254)
This allows to show proper override values for terminal tabs in Linux
and Windows.

Release Notes:

- Fixed incorrect "close tab" keybinding shown in context menu of the
terminal panel tabs on Linux and Windows
2024-11-28 00:30:33 +02:00
Kirill Bulatov
e803815b16 Use proper context to show terminal split menu bindings (#21253)
Follow-up of https://github.com/zed-industries/zed/pull/21251

Show proper keybindings on the terminal split button:

<img width="249" alt="image"
src="https://github.com/user-attachments/assets/b51b183f-788a-4e8f-9fec-3ec07f084bd4">

Release Notes:

- N/A
2024-11-28 00:06:23 +02:00
Kirill Bulatov
34ed48e14b Add a split button to terminal panes (#21251)
Follow-up of https://github.com/zed-industries/zed/pull/21238

<img width="873" alt="image"
src="https://github.com/user-attachments/assets/8cf2d8ea-a1df-4a6a-95d6-5867e0ee287d">

Release Notes:

- N/A
2024-11-27 23:17:44 +02:00
Mikayla Maki
0c8e5550e7 Make Markdown images layout vertically instead of horizontally (#21247)
Release Notes:

- Fixed a bug in the Markdown preview where images in the same paragraph
would be rendered next to each other
2024-11-27 10:47:23 -08:00
张小白
cff9ae0bbc Better absolute path handling (#19727)
Closes #19866

This PR supersedes #19228, as #19228 encountered too many merge
conflicts.

After some exploration, I found that for paths with the `\\?\` prefix,
we can safely remove it and consistently use the clean paths in all
cases. Previously, in #19228, I thought we would still need the `\\?\`
prefix for IO operations to handle long paths better. However, this
turns out to be unnecessary because Rust automatically manages this for
us when calling IO-related APIs. For details, refer to Rust's internal
function
[`get_long_path`](017ae1b21f/library/std/src/sys/path/windows.rs (L225-L233)).

Therefore, we can always store and use paths without the `\\?\` prefix.

This PR introduces a `SanitizedPath` structure, which represents a path
stripped of the `\\?\` prefix. To prevent untrimmed paths from being
mistakenly passed into `Worktree`, the type of `Worktree`’s `abs_path`
member variable has been changed to `SanitizedPath`.

Additionally, this PR reverts the changes of #15856 and #18726. After
testing, it appears that the issues those PRs addressed can be resolved
by this PR.

### Existing Issue
To keep the scope of modifications manageable, `Worktree::abs_path` has
retained its current signature as `fn abs_path(&self) -> Arc<Path>`,
rather than returning a `SanitizedPath`. Updating the method to return
`SanitizedPath`—which may better resolve path inconsistencies—would
likely introduce extensive changes similar to those in #19228.

Currently, the limitation is as follows:

```rust
let abs_path: &Arc<Path> = snapshot.abs_path();
let some_non_trimmed_path = Path::new("\\\\?\\C:\\Users\\user\\Desktop\\project"); 
// The caller performs some actions here:
some_non_trimmed_path.strip_prefix(abs_path);  // This fails
some_non_trimmed_path.starts_with(abs_path);   // This fails too
```

The final two lines will fail because `snapshot.abs_path()` returns a
clean path without the `\\?\` prefix. I have identified two relevant
instances that may face this issue:
-
[lsp_store.rs#L3578](0173479d18/crates/project/src/lsp_store.rs (L3578))
-
[worktree.rs#L4338](0173479d18/crates/worktree/src/worktree.rs (L4338))

Switching `Worktree::abs_path` to return `SanitizedPath` would resolve
these issues but would also lead to many code changes.

Any suggestions or feedback on this approach are very welcome.

cc @SomeoneToIgnore 

Release Notes:

- N/A
2024-11-27 20:22:58 +02:00
Kirill Bulatov
d0bafce86b Allow splitting the terminal panel (#21238)
Closes https://github.com/zed-industries/zed/issues/4351


![it_splits](https://github.com/user-attachments/assets/40de03c9-2173-4441-ba96-8e91537956e0)

Applies the same splitting mechanism, as Zed's central pane has, to the
terminal panel.
Similar navigation, splitting and (de)serialization capabilities are
supported.

Notable caveats:
* zooming keeps the terminal splits' ratio, rather expanding the
terminal pane
* on macOs, central panel is split with `cmd-k up/down/etc.` but `cmd-k`
is a "standard" terminal clearing keybinding on macOS, so terminal panel
splitting is done via `ctrl-k up/down/etc.`
* task terminals are "split" into regular terminals, and also not
persisted (same as currently in the terminal)

Seems ok for the initial version, we can revisit and polish things
later.

Release Notes:

- Added the ability to split the terminal panel
2024-11-27 20:22:39 +02:00
Stanislav Alekseev
4564da2875 Improve Nix package and shell (#21075)
With an addition of useFetchCargoVendor, crane becomes less necessary
for our use. This reuses the package from nixpkgs as well as creating a
better devshell that both work on macOS.

I use Xcode's SDKROOT and DEVELOPER_DIR to point the swift in the
livekit client crate to a correct sdk when using a devshell. Devshell
should work without that once apple releases sources for the 15.1 SDK
but for now this is an easy fix

This also replaces fenix with rust-overlay because of issues with the
out-of-sandbox access I've noticed fenix installed toolchains have

Release Notes:

- N/A
2024-11-27 20:22:17 +02:00
Peter Tripp
c021ee60d6 v0.165.x dev 2024-11-27 09:48:40 -05:00
Peter Tripp
6736806924 docs: Move install rustup callup to top of developing-extensions.md (#21239) 2024-11-27 09:25:43 -05:00
Kirill Bulatov
ce6782f4c8 Use eslint from the fork (#21233)
Part of https://github.com/zed-industries/zed/issues/21220

Microsoft had decided to switch over to a different releasing strategy,
autogenerating all releases and not publishing tarballs anymore.
But it was not enough, and they had also removed old tarballs, including
a relatively old `2.4.4` version release's tarballs, which broke Zed
downloads.
See https://github.com/microsoft/vscode-eslint/issues/1954

This PR uses
https://github.com/zed-industries/vscode-eslint/releases/tag/2.4.4 from
Zed's fork, manually released for the same tag.

This approach is merely a stub before more sustainable solution is
found, and I think we need to pivot into downloading *.vsix from
https://open-vsx.org/extension/dbaeumer/vscode-eslint but this is quite
a change so not done right now.

Release Notes:

- Fixed eslint 404 downloads
2024-11-27 12:02:39 +02:00
Peter Tripp
e865b6c524 Fix cmd-shift-e (reveal in project panel) to match vscode (#21228)
Release Notes:

- Fixed cmd-shift-e / ctrl-shift-e (`pane::RevealInProjectPanel` /
`project_panel::ToggleFocus`) to better my VSCode behavior
2024-11-26 19:56:51 -05:00
Conrad Irwin
4e720be41c Add ctrl-w _ and ctrl-w = (#21227)
Closes #ISSUE

Release Notes:

- vim: Add support for `ctrl-w _` and `ctrl-w =`
2024-11-26 16:45:38 -08:00
AidanV
f702575255 Add support for resizing panes using vim motions (#21038)
Closes #8628

Release Notes:

- Added support for resizing the current pane using vim keybinds with
the intention to follow the functionality of vim
  - "ctrl-w +" to make a pane taller 
  - "ctrl-w -" to make the pane shorter
  - "ctrl-w >" to make a pane wider
  - "ctrl-w <" to make the pane narrower
- Changed vim pre_count and post_count to globals to allow for other
crates to use the vim count. In this case, it allows for resizing by
more than one unit. For example, "10 ctrl-w -" will decrease the height
of the pane 10 times more than "ctrl-w -"
- This pr does **not** add keybinds for making all panes in an axis
equal size and does **not** add support for resizing docks. This is
mentioned because these could be implied by the original issue

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-11-26 16:24:29 -08:00
tims
d75d34576a Fix file missing or duplicated when copying multiple items in project panel + Fix marked files not being deselected after selecting a directory (#20859)
Closes #20858

This fix depends on the sanitization logic implemented in PR #20577.
Since that branch may undergo further changes, this branch will be
periodically rebased on it. Once #20577 is merged, the dependency will
no longer apply.

Release Notes:

- Fix missing or duplicated files when copying multiple items in the
project panel.
- Fix marked files not being deselected after selecting a directory on
primary click.
- Fix "copy path" and "copy path relative" with multiple items selected
in project panel.

**Problem**:

In this case, `dir1` is selected while `dir2`, `dir3`, and `dir1/file`
are marked. Using the `marked_entries` function results in only `dir1`,
which is incorrect.

<img height="120"
src="https://github.com/user-attachments/assets/d4d92cc5-c998-4948-9a58-25c4f54167f2"
/>

Currently, the `marked_entries` function is used in five actions, which
all produce incorrect results:

1. Delete (via the disjoint function)
2. Copy 
3. Cut
4. Copy Path
5. Copy Path Relative

**Solution**:

1. `marked_entries` function should not use "When currently selected
entry is not marked, it's treated as the only marked entry." logic.
There is no grand scheme behind this logic as confirmed by piotr
[here](https://github.com/zed-industries/zed/issues/17746#issuecomment-2464765963).
2. `copy` and `cut` actions should use the disjoint function to prevent
obivous failures.
3. `copy path` and `copy path relative` should keep using *fixed*
`marked_entries` as that is expected behavior for these actions.

---

1. Before/After: Partial Copy

Select `dir1` and `c.txt` (in that order, reverse order works!), and
copy it and paste in `dir2`. `c.txt` is not copied in `dir2`.

<img height="170"
src="https://github.com/user-attachments/assets/a09fcb40-f38f-46ef-b0b4-e44ec01dda18"
/>
<img height="170"
src="https://github.com/user-attachments/assets/bb87dbe5-8e2e-4ca4-a565-42be5755ec8a"
/>

---
2. Before/After: Duplicate Copy

Select `a.txt`, `dir1` and `c.txt` (in that order), and copy it and
paste in `dir2`. `a.txt` is duplicated in `dir2`.

<img height="170"
src="https://github.com/user-attachments/assets/6f999d22-3607-48d7-9ff6-2e27494002f8"
/>
<img height="170"
src="https://github.com/user-attachments/assets/b4b6ff7d-0df7-45ea-83e4-50a0acb18457"
/>

---
3. Before/After: Directory Selection

Simply primary click on any file, now primary click on any dir. That
previous file is still marked.

<img height="170"
src="https://github.com/user-attachments/assets/9f1948ce-7445-4377-9733-06490ed6a324"
/>
<img height="170"
src="https://github.com/user-attachments/assets/e78203bc-96ba-424b-b588-c038992a9f0e"
/>

---
4. Before/After: Copy Path and Copy Path Relative

Upon `copy path` (ctrl + alt + c):

Before: Only `/home/tims/test/dir2/a.txt` was copied.
After: All three paths `/home/tims/test/dir2`, `/home/tims/test/c.txt`
and `/home/tims/test/dir2/a.txt` are copied.

This is also how VSCode also copies path when multiple are selected.

<img height="170"
src="https://github.com/user-attachments/assets/e20423ea-1682-4efd-b208-631e2edd3771"
/>
2024-11-27 01:23:01 +02:00
Helge Mahrt
57e4540759 vim: Add "unmatched" motions ]}, ]), [{ and [( (#21098)
Closes #20791

Release Notes:

- Added vim ["unmatched"
motions](1d87e11a1e/runtime/doc/motion.txt (L1238-L1255))
`]}`, `])`, `[{` and `[(`

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-11-26 14:08:54 -08:00
vultix
597e5f8304 vim: Add indent text object (#21121)
Added support for the popular vim
[indent-text-object](https://github.com/michaeljsmith/vim-indent-object).
This is especially useful in indentation-sensitive languages like
python.

Release Notes:

- vim: Added `vii`, `vai` and `vaI` for selecting
[indent-text-object](https://github.com/michaeljsmith/vim-indent-object)s.
2024-11-26 12:54:36 -08:00
Max Brunsfeld
64708527e7 Revert "Styling for Apply/Discard buttons (#21017)"
This reverts commit 884748038e.
2024-11-26 10:19:13 -08:00
yoleuh
6dbe2ef10c docs: Fix default value for relative_line_numbers in vim (#21196)
![image](https://github.com/user-attachments/assets/91c00938-f056-4778-8999-6a805bc12247)

Changes:
`true` to `false`

Reasoning:
matches zed default settings as well as the settings changes portion of
the vim docs


![image](https://github.com/user-attachments/assets/cb3240bc-8c55-4802-88c0-dd069992ca30)


![image](https://github.com/user-attachments/assets/747fbe8a-b24c-45f2-b3ab-f09bccdb4ec3)

Release Notes:
- N/A
2024-11-26 18:10:28 +02:00
Richard Feldman
884748038e Styling for Apply/Discard buttons (#21017)
Change the "Apply" and "Discard" buttons to match @danilo-leal's design!
Here are some different states:

### Cursor in the first hunk

Now that the cursor is in a particular hunk, we show the "Apply" and
"Discard" names, and the keyboard shortcut. If I press the keyboard
shortcut, it will only apply to this hunk.

<img width="759" alt="Screenshot 2024-11-23 at 10 54 45 PM"
src="https://github.com/user-attachments/assets/68e0f109-9493-4ca2-a99c-dfcbb4d1ce0c">

### Cursor in the second hunk

Moving the cursor to a different hunk changes which buttons get the
keyboard shortcut treatment. Now the keyboard shortcut is shown next to
the hunk that will actually be affected if you press that shortcut.

<img width="749" alt="Screenshot 2024-11-23 at 10 56 27 PM"
src="https://github.com/user-attachments/assets/59c2ace3-6972-4a60-b806-f45e8c25eaae">


Release Notes:

- Restyled Apply/Discard buttons

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
2024-11-26 11:09:43 -05:00
Marshall Bowers
8f1ec3d11b assistant2: Add a checkbox to control tool use (#21215)
This PR adds a checkbox to the `assistant2` message editor to control
whether tools should be used for a given message.

Release Notes:

- N/A
2024-11-26 10:48:48 -05:00
Peter Tripp
fdc17c57d7 macos: Keybind improvements for binds involving shift (#21207)
Fix cmd-pipe
Remove redudnant jetbrains/sublime keybinds (these exist as `cmd-{` and `cmd-}` under default vscode keymap) and were broken as part of the recent keybind changes.
Remove excess JSON whitespace from tests to make them more readable.
2024-11-26 07:58:45 -05:00
Kirill Bulatov
9999c31859 Avoid endless loop of the diagnostic updates (#21209)
Follow-up of https://github.com/zed-industries/zed/pull/21173

Rust-analyzer with `checkOnSave` enabled will push diagnostics for a
file after each diagnostics refresh (e.g. save, file open, file close).

If there's a file that is not open in any pane and has only warnings,
and the diagnostics editor has warnings toggled off, then

0. rust-analyzer will push the corresponding warnings after initial load
1. the diagnostics editor code registers
`project::Event::DiagnosticsUpdated` for the corresponding file path and
opens the corresponding buffer to read its associated diagnostics from
the snapshot
2. opening the buffer would send `textDocument/didOpen` which would
trigger rust-analyzer to push the same diagnostics
3. meanwhile, the diagnostics editor would filter out all diagnostics
for that buffer, dropping the open buffer and effectively closing it
4. closing the buffer will send `textDocument/didClose` which would
trigger rust-analyzer to push the same diagnostics again, as those are
`cargo check` ones, still present in the file
5. GOTO 1

Release Notes:

- Fixed diagnostics editor not scrolling properly under certain
conditions
2024-11-26 14:29:54 +02:00
Kirill Bulatov
7d67bb4cf6 Properly use lsp::CompletionList defaults (#21202)
- Closes https://github.com/zed-industries/zed/issues/21185

Release Notes:

- Fixed incorrect handling of the completion list defaults
2024-11-26 12:23:38 +02:00
Marshall Bowers
968ffaa3fd assistant2: Restructure storage of tool uses and results (#21194)
This PR restructures the storage of the tool uses and results in
`assistant2` so that they don't live on the individual messages.

It also introduces a `LanguageModelToolUseId` newtype for better type
safety.

Release Notes:

- N/A
2024-11-25 21:53:27 -05:00
Marshall Bowers
7e418cc8af assistant2: Style messages (#21191)
This PR styles the messages in `assistant2` so they don't look quite as
rough:

<img width="1138" alt="Screenshot 2024-11-25 at 8 36 32 PM"
src="https://github.com/user-attachments/assets/9cc423fa-feff-4c69-9d2b-d28970559547">

Release Notes:

- N/A
2024-11-25 20:49:03 -05:00
Marshall Bowers
f059b6a24b assistant2: Add support for using tools (#21190)
This PR adds rudimentary support for using tools to `assistant2`. There
are currently no visual affordances for tool use.

This is gated behind the `assistant-tool-use` feature flag.

<img width="1079" alt="Screenshot 2024-11-25 at 7 21 31 PM"
src="https://github.com/user-attachments/assets/64d6ca29-c592-4474-8e9d-c344f855bc63">

Release Notes:

- N/A
2024-11-25 19:44:34 -05:00
Marshall Bowers
3901d46101 Factor tool definitions out of assistant (#21189)
This PR factors the tool definitions out of the `assistant` crate so
that they can be shared between `assistant` and `assistant2`.

`ToolWorkingSet` now lives in `assistant_tool`. The tool definitions
themselves live in `assistant_tools`, with the exception of the
`ContextServerTool`, which has been moved to the `context_server` crate.

As part of this refactoring I needed to extract the
`ContextServerSettings` to a separate `context_server_settings` crate so
that the `extension_host`—which is referenced by the `remote_server`—can
name the `ContextServerSettings` type without pulling in some undesired
dependencies.

Release Notes:

- N/A
2024-11-25 18:26:34 -05:00
Marshall Bowers
321fd19763 assistant2: Wire up assistant2::NewThread action (#21187)
This PR wires up the `assistant2::NewThread` action so that you can
create new threads.

Release Notes:

- N/A
2024-11-25 17:24:25 -05:00
Marshall Bowers
cc5daa22bd assistant2: Improve tracking of pending completions (#21186)
This PR improves the tracking of pending completions in `assistant2`
such that we actually remove ones that have been completed.

Release Notes:

- N/A
2024-11-25 17:07:55 -05:00
Marshall Bowers
2b9250843c assistant2: Include previous messages in the thread in the completion request (#21184)
This PR makes it so previous messages in the thread are included when
constructing the completion request, instead of only sending up the most
recent user message.

Release Notes:

- N/A
2024-11-25 16:51:32 -05:00
Marshall Bowers
e7b0047562 assistant2: Remove unnecessary Pane (#21183)
This PR removes an unnecessary `Pane` that was copied over from
`assistant::AssistantPanel` to `assistant2::AssistantPanel`.

Release Notes:

- N/A
2024-11-25 16:28:38 -05:00
Marshall Bowers
9ee1aba80a assistant2: Stream in completion text (#21182)
This PR makes it so that the completion text streams into the message
list rather than being buffered until the end.

Release Notes:

- N/A
2024-11-25 16:13:27 -05:00
Max Brunsfeld
91a565f5fa Simplify BufferStore's local vs remote state (#21180)
This is a pure refactor, motivated by wanting to introduce to the
BufferStore new logic for opening staged and committed changes.

I found the `BufferStoreImpl` trait a little bit confusing, particularly
how the different implementors of the trait held a handle back to the
owning buffer store. I was able to reduce the amount of code
considerably (-78 lines) by using a two-variant enum instead, similar to
what we do for `LspStore`, `WorktreeStore` and `Worktree`.

Release Notes:

- N/A
2024-11-25 12:53:23 -08:00
Marshall Bowers
a02684b2f7 assistant2: Add rudimentary chat functionality (#21178)
This PR adds in rudimentary functionality for sending messages to the
LLM in `assistant2`.

<img width="1079" alt="Screenshot 2024-11-25 at 1 49 11 PM"
src="https://github.com/user-attachments/assets/5accb749-c034-4fb2-bf55-3ae5bc9529ad">

Release Notes:

- N/A
2024-11-25 14:08:40 -05:00
Kirill Bulatov
bd02b35ba9 Avoid excessive diagnostics refreshes (#21173)
Attempts to reduce the diagnostics flicker, when editing very
fundamental parts of the large code base in Rust.


https://github.com/user-attachments/assets/dc3f9c21-8c6e-48db-967b-040649fd00da

Release Notes:

- N/A
2024-11-25 19:21:30 +02:00
teapo
28142be5e9 Update Luau docs (#21174)
Formatter arguments & Tree-sitter grammar changed.

Release Notes:

- N/A
2024-11-25 12:11:23 -05:00
Marshall Bowers
389422cbf3 docs: Fix broken link to context servers docs (#21172)
This PR fixes a broken link to the context server docs.

Release Notes:

- N/A
2024-11-25 11:25:37 -05:00
Bennet Bo Fenner
93533ed235 Remove assistant hints (#21171)
This reverts #20824 and #20899. After adding them last week we came to
the conclusion that the hints are too distracting in everyday use, see
#21128 for more details.

Release Notes:

- N/A
2024-11-25 17:19:33 +01:00
Marshall Bowers
385c447bbe docs: Document context servers (#21170)
This PR adds documentation for context servers.

Release Notes:

- N/A
2024-11-25 11:05:14 -05:00
Kirill Bulatov
b83f104f6e Do not reuse render cache for nested items whose parents are re-rendered (#21165)
Fixes a bug with terminal splits panicking during writing a command in
the command input

Release Notes:

- N/A

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-11-25 15:58:45 +02:00
Nathan Sobo
08b214dfb9 Rename 'chat' to 'thread' in assistant2 (#21141)
Release Notes:

- N/A
2024-11-25 07:27:35 -05:00
Piotr Osiewicz
aa58cab766 Fix offline workspace deserialization with assistant2 (#21159)
Closes #21156 
/cc @maxdeviant 

Release Notes:

- N/A
2024-11-25 12:21:32 +01:00
Nathan Sobo
5b0fa6e585 Hide AI hints on line ends so we can discuss more (#21128)
@bennetbo @as-cii @mrnugget I'm really not liking the hints about AI on
every line. It feels too distracting to me and damaging to the user
experience. I'm wondering if we can hide them and work with design for
other ideas. Or at least talk it through.

Release Notes:

- N/A
2024-11-25 09:48:43 +01:00
Piotr Osiewicz
e85848a695 pylsp: Prefer version from user venv (#21069)
Closes #ISSUE

Release Notes:

- pylsp will now use version installed in user venv, if one is
available.
2024-11-25 00:54:47 +01:00
Carroll Wainwright
20bffaf93f python: Highlight docstrings for classes and modules (#20486)
Release Notes:

- Add `string.doc` python syntax highlighting to class and module-level
docstrings.

Previously, only docstrings inside python functions were labeled as
`string.doc`, but docstrings can exist at the class or module level too.
This adds the more specific string type for each of those.

*Before*:
<img width="288" alt="image"
src="https://github.com/user-attachments/assets/5a6c4c9d-709c-40e2-8316-31c95084a1a9">

*After*:
<img width="294" alt="image"
src="https://github.com/user-attachments/assets/8212bfa2-2288-4623-aa63-f748a2295ada">
2024-11-25 00:52:11 +01:00
Joseph T. Lyons
3dcb94c204 Correct more app event inconsistencies (#21129)
- Unify welcome page event type string structure
- Differentiate between metric telemetry event and diagnostic telemetry
event

Release Notes:

- N/A
2024-11-24 00:34:02 -05:00
Joseph T. Lyons
0395d1b037 Clean up app event transformations (#21115)
This needs scrutinized. Detailed breakdown of what events I kept and
threw out here:

https://zed.dev/channel/app-events-17178/notes

I also removed a few fake events and tossed out json properties that
were being inserted for things we don't have logic to track. See PR
review comments below.

I think the only bad data we have are that we were identifying all node,
pnpm, and yarn projects as 'node' in the `project_type` property, so a
few days of lost data there.

Release Notes:

- N/A
2024-11-23 23:11:45 -05:00
Marshall Bowers
628b96f297 assistant2: Sketch in chat editor (#21116)
This PR sketches in the chat editor for `assistant2`.

<img width="1136" alt="Screenshot 2024-11-23 at 1 56 23 PM"
src="https://github.com/user-attachments/assets/6e979995-c0cf-4a46-8694-fc4a8646336f">

Release Notes:

- N/A
2024-11-23 14:09:15 -05:00
Marshall Bowers
2a23db6e05 assistant2: Sketch in toolbar (#21114)
This PR sketches in the toolbar for `assistant2`.

<img width="1136" alt="Screenshot 2024-11-23 at 12 39 49 PM"
src="https://github.com/user-attachments/assets/ed56fc36-54c8-48d4-8446-6c1f182fcef2">

Release Notes:

- N/A
2024-11-23 12:46:11 -05:00
Marshall Bowers
3a0408953d Factor out language model selector into its own crate (#21113)
This PR factors the language model selector out into its own
`language_model_selector` crate so that it can be reused in
`assistant2`.

Also renamed it from `ModelSelector` to `LanguageModelSelector` to be a
bit more specific.

Release Notes:

- N/A
2024-11-23 12:11:31 -05:00
Marshall Bowers
9adc3b4e82 Break ground on assistant2 (#21109)
This PR breaks ground on a new `assistant2` crate.

In order to see this new version of the assistant, both of the following
must be true:
1. The `assistant2` feature flag is enabled for your user
   - It is **not** currently enabled for all staff.
2. You are running a development build of Zed

The intent here is to enable the folks working on `assistant2` to
incrementally land work onto `main` without breaking use of the current
Assistant for anyone.

<img width="1136" alt="Screenshot 2024-11-23 at 10 46 08 AM"
src="https://github.com/user-attachments/assets/5723a13f-5be1-4486-9460-ead7329ba78e">

Release Notes:

- N/A
2024-11-23 11:24:52 -05:00
Peter Tripp
f30de4852a docs: Proto Language is by extension not native (#21096)
Fixes docs to reflect that Protobuf support is via extension.
Comment out references ProtoLS formatter.
Need to test both protols and protobuf-language-server to ensure both work.
2024-11-23 01:17:39 -05:00
Kyle Kelley
2177e833d8 Upgrade jupyter websocket client (#21095)
Upgrade to changes from https://github.com/runtimed/runtimed/pull/158 

Release Notes:

- N/A
2024-11-22 22:11:20 -08:00
Peter Tripp
8a9c53524a docs: Add JSON Schema settings for json-language-server (#21084)
Add json-language server docs
Recognize `.vscode/*` files as JSONC by default
2024-11-23 00:38:00 -05:00
Joseph T. Lyons
43f0ea759b Remove non-existent call event types (#21093)
These are not real (from Clickhouse):

```
    ┌─operation────────────┬──────c─┐
 1. │ join channel         │ 136221 │
 2. │ open channel notes   │  95529 │
 3. │ hang up              │  66264 │
 4. │ disable microphone   │  34116 │
 5. │ enable microphone    │  25090 │
 6. │ enable screen share  │  20751 │
 7. │ invite               │  15827 │
 8. │ share project        │  14580 │
 9. │ accept incoming      │  13708 │
10. │ disable screen share │  10440 │
11. │ unshare project      │   9556 │
12. │ decline incoming     │    455 │
13. │ enable camera        │      6 │
14. │ disable camera       │      4 │
    └──────────────────────┴────────┘
```

Release Notes:

- N/A
2024-11-22 23:49:53 -05:00
Conrad Irwin
984bb192ba Send llm events to snowflake too (#21091)
Closes #ISSUE

Release Notes:

- N/A
2024-11-22 20:40:39 -07:00
Kyle Kelley
5766afe710 Pass through remote kernel's language on legacy selection (#21088)
When selecting an active kernel based on legacy usage, have remote
kernels defer to language within kernelspec.

Release Notes:

- N/A
2024-11-22 16:31:11 -08:00
Kirill Bulatov
9833756224 Fix file finder menu actions (#21087)
Closes https://github.com/zed-industries/zed/issues/21077

* BREAKING: rename `file_finder::OpenMenu` into
`file_finder::ToggleMenu`
* Display the keybinding for menu toggling when the menu is open
* Fix `enter` not working in the menu

Release Notes:

- Fixed enter not working and menu toggle binding not shown in the file
finder menu
2024-11-23 02:21:19 +02:00
Marshall Bowers
1cfcdfa7ac Overhaul extension registration (#21083)
This PR overhauls extension registration in order to make it more
modular.

The `extension` crate now contains an `ExtensionHostProxy` that can be
used to register various proxies that the extension host can use to
interact with the rest of the system.

There are now a number of different proxy traits representing the
various pieces of functionality that can be provided by an extension.
The respective crates that provide this functionality can implement
their corresponding proxy trait in order to register a proxy that the
extension host will use to register the bits of functionality provided
by the extension.

Release Notes:

- N/A
2024-11-22 19:02:32 -05:00
Michael Sloan
c9f2c2792c Improve error handling and resource cleanup in linux/x11/window.rs (#21079)
* Fixes registration of event handler for xinput-2 device changes,
revealed by this improvement.

* Pushes `.unwrap()` panic-ing outwards to callers.

* Includes a description of what the X11 call was doing when a failure
was encountered.

* Fixes a variety of places where the X11 reply wasn't being inspected
for failures.

* Destroys windows on failure during setup. New structure makes it
possible for the caller of `open_window` to carry on despite failures,
and so partially initialized window should be removed (though all calls
I looked at also panic currently).

Considered pushing this through `linux/x11/client.rs` too but figured
it'd be nice to minimize merge conflicts with #20853.

Release Notes:

- N/A
2024-11-22 16:03:46 -07:00
Mikayla Maki
8240a52a39 Prevent panels from being resized past the edge of the workspace (#20637)
Closes #20593

Release Notes:

- Fixed a bug where it is possible to get in near-unrecoverable panel
state by resizing the panel past the edge of the workspace.

Co-authored-by: Trace <violet.white.batt@gmail.com>
2024-11-22 14:59:40 -08:00
teapo
c28f5b11f8 Allow overrides for json-language-server settings (#20748)
Closes #20739

The JSON LSP adapter now merges user settings with cached settings, and
util::merge_json_value_into pushes array contents from source to target.
2024-11-22 17:50:25 -05:00
Mikayla Maki
96854c68ea Markdown preview image rendering (#21082)
Closes https://github.com/zed-industries/zed/issues/13246

Supersedes: https://github.com/zed-industries/zed/pull/16192

I couldn't push to the git fork this user was using, so here's the exact
same PR but with some style nits implemented.


Release Notes:

- Added image rendering to the Markdown preview

---------

Co-authored-by: dovakin0007 <dovakin0007@gmail.com>
Co-authored-by: dovakin0007 <73059450+dovakin0007@users.noreply.github.com>
2024-11-22 14:49:26 -08:00
Peter Tripp
becc36380f Cleanup file_scan_inclusions in default.json (#21073) 2024-11-22 17:46:14 -05:00
Peter Tripp
1a0a8a9559 Fix picker new_path_prompt throwing "file exists" when saving (#21080)
Fix for getting File exists "os error 17" with `"use_system_path_prompts": false,`

This was reproducible when the first worktree is a non-folder worktree
(e.g. setting.json) so we were trying to create the new file with a path
under ~/.config/zed/settings.json/newfile.ext

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-11-22 17:45:03 -05:00
Peter Tripp
2fd210bc9a Fix stale Discord invite links (#21074) 2024-11-22 21:10:51 +00:00
Peter Tripp
23321be2ce docs: Improve Dart language docs (#21071) 2024-11-22 13:58:24 -05:00
Hugo Cardante
659b1c9dcf Add the option to hide both the task and command lines in the task output (#20920)
The goal is to be able to hide these lines from a task output:

```sh
⏵ Task `...` finished successfully
⏵ Command: ...
```

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-11-22 13:45:42 -05:00
Marshall Bowers
cb8028c092 Use Extension trait when registering extension context servers (#21070)
This PR updates the extension context server registration to go through
the `Extension` trait for interacting with extensions rather than going
through the `WasmHost` directly.

Release Notes:

- N/A
2024-11-22 13:21:30 -05:00
william341
ca76948044 gpui: Add drop_image (#19772)
This PR adds a function, WindowContext::drop_image, to manually remove a
RenderImage from the sprite atlas. In addition, PlatformAtlas::remove
was added to support this behavior. Previously, there was no way to
request a RenderImage to be removed from the sprite atlas, and since
they are not removed automatically the sprite would remain in video
memory once added until the window was closed. This PR allows a
developer to request the image be dropped from memory manually, however
it does not add automatic removal.

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-11-22 09:51:26 -08:00
Conrad Irwin
852fb51528 Canonicalize paths when opening workspaces (#21039)
Closes #17161

Release Notes:

- Added symlink resolution when opening projects from within Zed.
Previously this only happened within zed's cli, but that broke file
watching on Linux when opening a symlinked directory.
2024-11-22 09:20:49 -07:00
Marshall Bowers
d489f96aef Don't name ExtensionLspAdapter in ExtensionRegistrationHooks (#21064)
This PR updates the `ExtensionRegistrationHooks` trait to not name the
`ExtensionLspAdapter` type.

This helps decouple the two.

Release Notes:

- N/A
2024-11-22 10:58:11 -05:00
Peter Tripp
b4659bb44e Fix inaccurate Ollama context length for qwen2.5 models (#20933)
Since Ollama/llama.cpp do not currently YARN for context length
extension, the context length is limited to `32768`. This can be
confirmed by the Ollama model card.
See corresponding issue on Ollama repo : 
https://github.com/ollama/ollama/issues/6865

Co-authored-by: Patrick Samson <1416027+patricksamson@users.noreply.github.com>
2024-11-22 10:10:01 -05:00
Techatrix
d5f2bca382 Filter LSP code actions based on the requested kinds (#20847)
I've observed that Zed's implementation of [Code Actions On
Format](https://zed.dev/docs/configuring-zed#code-actions-on-format)
uses the
[CodeActionContext.only](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionContext)
parameter to request specific code action kinds from the server. The
issue is that it does not filter out code actions from the response,
believing that the server will do it.

The [LSP
specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionContext)
says that the client is responsible for filtering out unwanted code
actions:

```js
/**
* Requested kind of actions to return.
*
* Actions not of this kind are filtered out by the client before being
* shown. So servers can omit computing them.
*/
only?: CodeActionKind[];
```

This PR will filter out unwanted code action on the client side.

I have initially encountered this issue because the [ZLS language
server](https://github.com/zigtools/zls) (until
https://github.com/zigtools/zls/pull/2087) does not filter code action
based on `CodeActionContext.only` so Zed runs all received code actions
even if they are explicitly disabled in the `code_actions_on_format`
setting.

Release Notes:

- Fix the `code_actions_on_format` setting when used with a language
server like ZLS

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-11-22 13:01:00 +01:00
tims
114c462143 Maintain selection on file/dir deletion in project panel (#20577)
Closes #20444

- Focus on next file/dir on deletion.
- Focus on prev file/dir in case where it's last item in worktree.
- Tested when multiple files/dirs are being deleted.

Release Notes:

- Maintain selection on file/dir deletion in project panel.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-11-22 12:59:04 +02:00
Joseph T. Lyons
933c11a9b2 Remove dead snowflake code (#21041)
Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com>

Release Notes:

- N/A
2024-11-21 23:06:03 -05:00
Michael Sloan
14ea4621ab Add fs::MTime newtype to encourage != instead of > (#20830)
See ["mtime comparison considered
harmful"](https://apenwarr.ca/log/20181113) for details of why
comparators other than equality/inequality should not be used with
mtime.

Release Notes:

- N/A
2024-11-21 19:21:18 -07:00
Piotr Osiewicz
477c6e6833 pylsp: Update mypy plugin name (#21031)
Follow-up to #21025

Release Notes:

- N/A
2024-11-22 01:13:48 +01:00
Marshall Bowers
6c470748ac zed: Remove unnecessary #[allow(non_snake_case)] attribute (#21030)
This PR removes the `#[allow(non_snake_case)]` attribute from the `zed`
crate, as it wasn't actually doing anything.

Release Notes:

- N/A
2024-11-21 18:47:44 -05:00
Marshall Bowers
e0245b3f30 Merge quick_action_bar into zed (#21026)
This PR merges the `quick_action_bar` crate into the `zed` crate.

We weren't really gaining anything by having it be a separate crate, and
it was introducing an additional step in the dependency graph that was
getting in the way.

It's only ~850 LOC, so the impact on the compilation speed of the `zed`
crate itself is negligible.

Release Notes:

- N/A
2024-11-21 18:33:11 -05:00
张小白
9211e699ee Follow-up on #18447: Unintentional deletion during merge-conflicts resolution (#20991)
After #18447 was merged, I reviewed the PR code as usual. During this
review, I realized that some code was unintentionally removed when I was
resolving merge conflicts in #18447.

Sorry!

Release Notes:

- N/A
2024-11-21 15:32:49 -08:00
Piotr Osiewicz
0663bf2a53 pylsp: Tweak default user settings (#21025)
I've also looked into not creating temp dirs in project directories and
succeeded at that for Mypy; no dice for rope though, I'll have to send a
patch to pylsp to fix that.
Closes #20646

Release Notes:

- Python: tweaked default pylsp settings to be less noisy (mypy and
pycodestyle are no longer enabled by default).
2024-11-22 00:25:30 +01:00
Marshall Bowers
9d95da56c3 welcome: Remove dependency on theme_selector (#21024)
This PR removes the dependency on `theme_selector` from `welcome`, as we
can just dispatch the action instead.

Release Notes:

- N/A
2024-11-21 17:50:22 -05:00
Piotr Osiewicz
5ee5a1a51e chore: Do not produce universal binaries for our releases (#21014)
Closes #ISSUE

Release Notes:

- We no longer provide universal binaries for our releases on macOS.
2024-11-21 23:16:49 +01:00
Kyle Kelley
72613b7668 Implement RunningKernel trait for native and remote kernels (#20934)
This PR introduces a unified interface for both native and remote
kernels through the `RunningKernel` trait. When either the native kernel
or the remote kernels are started, they return a `Box<dyn
RunningKernel>` to make it easier to work with the session. As a bonus
of this refactor, I've dropped some of the mpsc channels to instead opt
for passing messages directly to `session.route(message)`. There was a
lot of simplification of `Session` by moving responsibilities to
`NativeRunningKernel`.

No release notes yet until this is finalized.

* [x] Detect remote kernelspecs from configured remote servers
* [x] Launch kernel on demand

For now, this allows you to set env vars `JUPYTER_SERVER` and
`JUPYTER_TOKEN` to access a remote server. `JUPYTER_SERVER` should be a
base path like `http://localhost:8888` or
`https://notebooks.gesis.org/binder/jupyter/user/rubydata-binder-w6igpy4l/`

Release Notes:

- N/A
2024-11-21 14:00:19 -08:00
Michael Sloan
f74f670865 Fix panics from spawn_local tasks dropped on other threads in remote server (#21022)
Closes #21020

Release Notes:

- Fixed remote server panic of "local task dropped by a thread that
didn't spawn it"
2024-11-21 14:50:38 -07:00
Marshall Bowers
af34953bc3 extensions_ui: Remove dependency on theme_selector (#21023)
This PR removes the dependency on `theme_selector` from `extensions_ui`,
as we can just dispatch the action instead.

Release Notes:

- N/A
2024-11-21 16:48:25 -05:00
Marshall Bowers
b102a40e04 Extract VimModeSetting to its own crate (#21019)
This PR extracts the `VimModeSetting` out of the `vim` crate and into
its own `vim_mode_setting` crate.

A number of crates were depending on the entirety of the `vim` crate
just to reference `VimModeSetting`, which was not ideal.

Release Notes:

- N/A
2024-11-21 16:24:38 -05:00
Marshall Bowers
790fdcf737 collab_ui: Remove dependency on vcs_menu (#21016)
This PR removes the `vcs_menu` dependency from `collab_ui`.

We were only depending on this to call `vcs_menu::init`, which isn't
necessary to do here.

Release Notes:

- N/A
2024-11-21 15:48:35 -05:00
Marshall Bowers
2868b67286 title_bar: Remove dependency on feedback (#21013)
This PR removes the `title_bar` crate's dependency on the `feedback`
crate.

The `feedback::GiveFeedback` action now resides at
`zed_actions::feedback::GiveFeedback`.

`title_bar` now no longer depends on `editor` 🥳 

Release Notes:

- N/A
2024-11-21 15:24:04 -05:00
Peter Tripp
614b3b979b macos: Add default keybind for ctrl-home / ctrl-end (#21007)
This matches the default behavior on native macos apps.
ctrl-fn-left == ctrl-home == MoveToBeginning
ctrl-fn-right == ctrl-end == MoveToEnd
2024-11-21 15:03:50 -05:00
Marshall Bowers
4c7b48b35d title_bar: Remove dependency on vcs_menu (#21011)
This PR removes the `title_bar` crate's dependency on the `vcs_menu`.

The `vcs_menu::OpenRecent` action now resides at
`zed_actions::branches::OpenRecent`.

Release Notes:

- N/A
2024-11-21 14:56:02 -05:00
Marshall Bowers
6b2f1cc543 title_bar: Remove dependency on theme_selector (#21009)
This PR removes the `title_bar` crate's dependency on the
`theme_selector`.

The `theme_selector::Toggle` action now resides at
`zed_actions::theme_selector::Toggle`.

Release Notes:

- N/A
2024-11-21 14:33:58 -05:00
Marshall Bowers
f62ccf9c8a Extract auto_update_ui crate (#21008)
This PR extracts an `auto_update_ui` crate out of the `auto_update`
crate.

This allows `auto_update` to not depend on heavier crates like `editor`,
which in turn allows other downstream crates to start building sooner.

Release Notes:

- N/A
2024-11-21 14:11:57 -05:00
Conrad Irwin
841d3221b3 Auto release preview patch releases (#20886)
This should make the process of releasing patch releases to preview less
toilful

Release Notes:

- N/A
2024-11-21 11:59:02 -07:00
Conrad Irwin
02447a8552 Use our own git clone in draft release notes (#20956)
It turns out that messing with the git repo created by the github action
is
tricky, so we'll just clone our own.

On my machine, a shallow tree-less clone takes <500ms

Release Notes:

- N/A
2024-11-21 11:55:22 -07:00
Marshall Bowers
c16dfc1a39 title_bar: Remove dependency on command_palette (#21006)
This PR removes the `title_bar` crate's dependency on the
`command_palette`.

The `command_palette::Toggle` action now resides at
`zed_actions::command_palette::Toggle`.

Release Notes:

- N/A
2024-11-21 13:37:34 -05:00
Peter Tripp
268ac4c047 Implement readline/emacs/macos style ctrl-k cut and ctrl-y yank (#21003)
- Added support for ctrl-k / ctrl-y alternate cut/yank buffer on macos.

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-11-21 13:10:25 -05:00
Nils Koch
571c7d4f66 Improve project_panel diagnostic icon knockout colors (#20760)
Closes #20572

Release Notes:

- N/A

cc @danilo-leal @WeetHet
2024-11-21 15:03:40 -03:00
Kirill Bulatov
5ff49db92f Only show breadcrumbs for terminals when there's a title (#20997)
Closes https://github.com/zed-industries/zed/issues/20475

Release Notes:

- Fixed terminal title and breadcrumbs behavior

---------

Co-authored-by: Thorsten Ball <thorsten@zed.dev>
2024-11-21 19:57:09 +02:00
Conrad Irwin
395e25be25 Fix keybindings on a Spanish ISO keyboard (#20995)
Co-Authored-By: Peter <peter@zed.dev>

Also reformatted the mappings to be easier to read/edit by hand.

Release Notes:

- Fixed keyboard shortcuts on Spanish ISO keyboards

---------

Co-authored-by: Peter <peter@zed.dev>
2024-11-21 10:18:54 -07:00
Conrad Irwin
74223c1b00 vim: Fix shortcuts that require shift+punct (#20990)
Fixes a bug I introduced in #20953

Release Notes:

- N/A
2024-11-21 09:05:00 -07:00
Piotr Osiewicz
0b373d43dc toolchains: Use language-specific terms in UI (#20985)
Closes #ISSUE

Release Notes:

- N/A
2024-11-21 15:57:22 +01:00
Piotr Osiewicz
75c545aa1e toolchains: Expose raw JSON representation of a toolchain (#20721)
Closes #ISSUE

Release Notes:

- N/A
2024-11-21 13:27:25 +01:00
Adam Richardson
6ab4b46984 rope: Minor optimization for tab indices (#20911)
This is a follow up on https://github.com/zed-industries/zed/pull/20289
and optimises the tabs by replacing branches with an XOR.

I saw this after watching the latest zed decoded episode so thank you
for those videos!

Release Notes:

- N/A
2024-11-21 08:48:13 +01:00
Conrad Irwin
ebaa270baf Clip UTF-16 offsets in text for range (#20968)
When launching the Pinyin keyboard, macOS will sometimes try to peek one
character back in the string.

This caused a panic if the preceding character was an emoji. The docs
say
"don't assume the range is valid", so now we don't.

Release Notes:

- (macOS) Fixed a panic when using the Pinyin keyboard with emojis
2024-11-20 22:04:26 -07:00
Conrad Irwin
7285cdb955 Drop platform lock when setting menu (#20962)
Turns out setting the menu (sometimes) calls `selected_range` on the
input
handler.

https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1732160078058279

Release Notes:

- Fixed a panic when reloading keymaps
2024-11-20 21:24:31 -07:00
Conrad Irwin
e062f30d9e Rename ime_key -> key_char and update behavior (#20953)
As part of the recent changes to keyboard support, ime_key is no longer
populated by the IME; but instead by the keyboard.

As part of #20877 I changed some code to assume that falling back to key
was
ok, but this was not ok; instead we need to populate this more similarly
to how
it was done before #20336.

The alternative fix could be to instead of simulating these events in
our own
code to push a fake native event back to the platform input handler.

Closes #ISSUE

Release Notes:

- Fixed a bug where tapping `shift` coudl type "shift" if you had a
binding on "shift shift"
2024-11-20 20:29:47 -07:00
Conrad Irwin
37a59d6b2e vim: Fix : on welcome screen (#20937)
Release Notes:

- vim: Fixed `:` on the welcome screen
2024-11-20 19:21:22 -07:00
Mikayla Maki
a03770837e Add extensions to the remote server (#20049)
TODO:

- [x] Double check strange PHP env detection
- [x] Clippy & etc.

Release Notes:

- Added support for extension languages on the remote server

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-11-20 19:21:09 -07:00
Ryan Hawkins
0e62b6dddd Add file_scan_inclusions setting to customize Zed file indexing (#16852)
Closes #4745

Release Notes:

- Added a new `file_scan_inclusions` setting to force Zed to index files
that match the provided globs, even if they're gitignored.

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-11-20 17:00:21 -08:00
张小白
95ace03706 windows: Set CREATE_NO_WINDOW for commands (#18447)
- Closes: #18371

Release Notes:

- N/A
2024-11-20 16:52:38 -08:00
张小白
49ed932c1f Fix line truncate crash on Windows (#17271)
Closes #17267

We should update the `len` of `runs` when truncating. cc @huacnlee 

Release Notes:

- N/A
2024-11-20 16:47:55 -08:00
renovate[bot]
33e84da657 Update Rust crate cargo_metadata to 0.19 (#20948)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [cargo_metadata](https://redirect.github.com/oli-obk/cargo_metadata) |
workspace.dependencies | minor | `0.18` -> `0.19` |

---

### Release Notes

<details>
<summary>oli-obk/cargo_metadata (cargo_metadata)</summary>

###
[`v0.19.0`](https://redirect.github.com/oli-obk/cargo_metadata/blob/HEAD/CHANGELOG.md#0190---2024-11-20)

[Compare
Source](https://redirect.github.com/oli-obk/cargo_metadata/compare/0.18.1...0.19.0)

##### Added

-   Re-exported `semver` crate directly.
-   Added implementation of `std::ops::Index<&PackageId>` for `Resolve`.
-   Added `pub fn is_kind(&self, name: TargetKind) -> bool` to `Target`.
- Added derived implementations of `PartialEq`, `Eq` and `Hash` for
`Metadata` and its members' types.
-   Added default fields to `PackageBuilder`.
- Added `pub fn new(name:version:id:path:) -> Self` to `PackageBuilder`
for providing all required fields upfront.

##### Changed

-   Bumped MSRV from `1.42.0` to `1.56.0`.
- Made `parse_stream` more versatile by accepting anything that
implements `Read`.
-   Converted `TargetKind` and `CrateType` to an enum representation.

##### Removed

- Removed re-exports for `BuildMetadata` and `Prerelease` from `semver`
crate.
- Removed `.is_lib(…)`, `.is_bin(…)`, `.is_example(…)`, `.is_test(…)`,
`.is_bench(…)`, `.is_custom_build(…)`, and `.is_proc_macro(…)` from
`Target` (in favor of adding `.is_kind(…)`).

##### Fixed

- Added missing `manifest_path` field to `Artifact`. Fixes
[#&#8203;187](https://redirect.github.com/oli-obk/cargo_metadata/issues/187).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 19:39:49 -05:00
Piotr Osiewicz
536d7e5355 chore: Sever terminal_view <-> tasks_ui dependency (#20946)
Closes #ISSUE

Release Notes:

- N/A
2024-11-21 01:07:14 +01:00
Marshall Bowers
cbba44900d Add language_models crate to house language model providers (#20945)
This PR adds a new `language_models` crate to house the various language
model providers.

By extracting the provider definitions out of `language_model`, we're
able to remove `language_model`'s dependency on `editor`, which improves
incremental compilation when changing `editor`.

Release Notes:

- N/A
2024-11-20 18:49:34 -05:00
Piotr Osiewicz
335b112abd title_bar: Remove dependency on recent_projects (#20942)
Use actions defined in zed_actions to interface with that crate instead.
One drawback of this is that we now hide call controls when any modal is
visible (we used to hide them just when ssh modal was deployed).

Release Notes:

- N/A
2024-11-21 00:43:03 +01:00
renovate[bot]
33bed8d680 Update Rust crate ctor to v0.2.9 (#20928)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ctor](https://redirect.github.com/mmastrac/rust-ctor) |
workspace.dependencies | patch | `0.2.8` -> `0.2.9` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 15:36:27 -07:00
renovate[bot]
6d4a5f9ad2 Update Rust crate libc to v0.2.164 (#20931)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [libc](https://redirect.github.com/rust-lang/libc) |
workspace.dependencies | patch | `0.2.162` -> `0.2.164` |

---

### Release Notes

<details>
<summary>rust-lang/libc (libc)</summary>

###
[`v0.2.164`](https://redirect.github.com/rust-lang/libc/blob/HEAD/CHANGELOG.md#02164---2024-11-16)

[Compare
Source](https://redirect.github.com/rust-lang/libc/compare/0.2.163...0.2.164)

##### MSRV

This release increases the MSRV of `libc` to 1.63.

##### Other

- CI: remove tests with rust < 1.63
[#&#8203;4051](https://redirect.github.com/rust-lang/libc/pull/4051)
- MSRV: document the MSRV of the stable channel to be 1.63
[#&#8203;4040](https://redirect.github.com/rust-lang/libc/pull/4040)
- MacOS: move ifconf to s_no_extra_traits
[#&#8203;4051](https://redirect.github.com/rust-lang/libc/pull/4051)

###
[`v0.2.163`](https://redirect.github.com/rust-lang/libc/blob/HEAD/CHANGELOG.md#02163---2024-11-16)

[Compare
Source](https://redirect.github.com/rust-lang/libc/compare/0.2.162...0.2.163)

##### Added

- Aix: add more `dlopen` flags
[#&#8203;4044](https://redirect.github.com/rust-lang/libc/pull/4044)
- Android: add group calls
[#&#8203;3499](https://redirect.github.com/rust-lang/libc/pull/3499)
- FreeBSD: add `TCP_FUNCTION_BLK` and `TCP_FUNCTION_ALIAS`
[#&#8203;4047](https://redirect.github.com/rust-lang/libc/pull/4047)
- Linux: add `confstr`
[#&#8203;3612](https://redirect.github.com/rust-lang/libc/pull/3612)
- Solarish: add `aio`
[#&#8203;4033](https://redirect.github.com/rust-lang/libc/pull/4033)
- Solarish: add `arc4random*`
[#&#8203;3944](https://redirect.github.com/rust-lang/libc/pull/3944)

##### Changed

- Emscripten: upgrade emsdk to 3.1.68
[#&#8203;3962](https://redirect.github.com/rust-lang/libc/pull/3962)
- Hurd: use more standard types
[#&#8203;3733](https://redirect.github.com/rust-lang/libc/pull/3733)
- Hurd: use the standard `ssize_t = isize`
[#&#8203;4029](https://redirect.github.com/rust-lang/libc/pull/4029)
- Solaris: fix `confstr` and `ucontext_t`
[#&#8203;4035](https://redirect.github.com/rust-lang/libc/pull/4035)

##### Other

- CI: add Solaris
[#&#8203;4035](https://redirect.github.com/rust-lang/libc/pull/4035)
- CI: add `i686-unknown-freebsd`
[#&#8203;3997](https://redirect.github.com/rust-lang/libc/pull/3997)
- CI: ensure that calls to `sort` do not depend on locale
[#&#8203;4026](https://redirect.github.com/rust-lang/libc/pull/4026)
- Specify `rust-version` in `Cargo.toml`
[#&#8203;4041](https://redirect.github.com/rust-lang/libc/pull/4041)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 15:35:08 -07:00
renovate[bot]
427c2017c3 Update Rust crate serde_json to v1.0.133 (#20932)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [serde_json](https://redirect.github.com/serde-rs/json) | dependencies
| patch | `1.0.132` -> `1.0.133` |
| [serde_json](https://redirect.github.com/serde-rs/json) |
workspace.dependencies | patch | `1.0.132` -> `1.0.133` |

---

### Release Notes

<details>
<summary>serde-rs/json (serde_json)</summary>

###
[`v1.0.133`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.133)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/v1.0.132...v1.0.133)

- Implement From<\[T; N]> for serde_json::Value
([#&#8203;1215](https://redirect.github.com/serde-rs/json/issues/1215))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 15:34:59 -07:00
Conrad Irwin
ebca6a8f3d Send os_version and country to amplitude (#20936)
Release Notes:

- N/A
2024-11-20 15:34:24 -07:00
Marshall Bowers
29c9f0f6a1 Extract InlineCompletionProvider to its own crate (#20935)
This PR extracts the `InlineCompletionProvider` trait and its related
types out of `editor` and into a new `inline_completion` crate.

By doing so we're able to remove a dependency on `editor` from the
`copilot` and `supermaven` crates.

We did have to move `editor::Direction` into the `inline_completion`
crate, as it is referenced by the `InlineCompletionProvider`. This
should find a better home, at some point.

Release Notes:

- N/A
2024-11-20 16:51:13 -05:00
Marshall Bowers
e076f55d78 language_model: Remove dependency on inline_completion_button (#20930)
This PR removes a dependency on the `inline_completion_button` crate
from the `language_model` crate.

We were taking on this dependency solely to call `initiate_sign_in`,
which can easily be moved to the `copilot` crate.

This allows `language_model` to move up in the crate dependency graph.

Release Notes:

- N/A
2024-11-20 16:19:20 -05:00
Marshall Bowers
e31f44450e title_bar: Remove dependency on extensions_ui (#20929)
This PR removes a dependency on the `extensions_ui` from the `title_bar`
crate.

This dependency only existed to reference the `Extensions` action, which
has now been moved to the `zed_actions` crate.

This allows `title_bar` to move up in the crate dependency graph.

Release Notes:

- N/A
2024-11-20 16:05:43 -05:00
Conrad Irwin
e0761db62d Revert: "a" for "vim::AngleBrackets" (#20918)
The replacement "g" didn't seem to work for everyone.

Closes #20912
Updates #20104

Release Notes:

- vim: Restores `dia` to mean "delete in argument" instead of "delete
within angle brackets". To keep this in your own keymap use:
    ```
    {
"context": "vim_operator == a || vim_operator == i || vim_operator ==
cs",
        "use_layout_keys": true,
        "bindings": {
            "a": "vim::AngleBrackets"
        }
    }
    ```
2024-11-20 13:46:44 -07:00
Peter Tripp
8c342ef706 Bump JSON schemas: package.json, tsconfig.json (#20910)
Add script/update-json-schemas
Updated JSON schemas to
[SchemaStore/schemastore@569a343](569a343137)
(2024-11-19)
2024-11-20 13:35:00 -05:00
Peter Tripp
7e67753d51 ci: Fix for checkout action with fetch-tags (#20917) 2024-11-20 13:32:05 -05:00
Conrad Irwin
1475a7000f Don't re-render the menu so often (#20914)
Closes #20710

Release Notes:

- Fixes opening the menu when Chinese Pinyin keyboard is in use
2024-11-20 10:27:50 -07:00
Marshall Bowers
41fd9189e3 context_servers: Document settings (#20907)
This PR documents the settings type for context servers so that the
documentation shows up when editing the `settings.json` file.

Release Notes:

- N/A
2024-11-20 11:30:14 -05:00
Marshall Bowers
973498e075 context_servers: Make settings field show up in settings completions (#20905)
This PR fixes an issue where the `settings` field for a context server
would not show up in the completions when editing the Zed settings.

It seems that `schemars` doesn't like the `serde_json::Value` as a
setting type when generating the JSON Schema. To address this, we are
using a custom schema of an empty object (as we don't yet have any other
information as to the structure of a given context server's settings).

Release Notes:

- context_servers: Fixed `settings` field not being suggested in
completions when editing `settings.json`.
2024-11-20 10:53:51 -05:00
Joseph T. Lyons
b63394f4bd v0.164.x dev 2024-11-20 10:45:44 -05:00
Thorsten Ball
743165fa6c Fix assistant hints showing up when selecting \n in Vim mode (#20899)
We also need to check whether the selection is empty, not just whether
its head is on an empty line.

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2024-11-20 14:38:56 +01:00
Piotr Osiewicz
e03968f538 pane: Fix panic when dragging non-pinned item onto it's pinned copy in another pane (#20900)
Closes #20889

Release Notes:

- N/A
2024-11-20 14:22:07 +01:00
Conrad Irwin
3c57a4071c vim: Fix jj to exit insert mode (#20890)
Release Notes:

- (Preview only) fixed binding `jj` to exit insert mode
2024-11-19 20:00:11 -07:00
Conrad Irwin
ad6a07e574 Remove comments from discord release announcements (#20888)
Release Notes:

- N/A
2024-11-19 20:00:03 -07:00
Conrad Irwin
c2668bc953 Fix draft-releaase-notes (#20885)
Turns out this was broken because (a) we didn't have tags fetched,
and (b) because the gh-release action we use is buggy.

Release Notes:

- N/A
2024-11-19 19:08:33 -07:00
Conrad Irwin
705a06c3dd Send Country/OS/Version amplitude style (#20884)
Release Notes:

- N/A
2024-11-19 16:38:14 -07:00
Conrad Irwin
f77b6ab79c Fix space repeating in terminal (#20877)
This is broken because of the way we try to emulate macOS's
ApplePressAndHoldEnabled.

Release Notes:

- Fixed holding down space in the terminal (preview only)
2024-11-19 13:43:24 -07:00
Conrad Irwin
ea5131ce0a Country Code To Snowflake (#20875)
Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-11-19 12:52:00 -07:00
Peter Tripp
1c2b3ad782 Add editor::SelectAllMatches to SublimeText base keymap (#20866)
`alt-f3` on Linux
`ctrl-cmd-g` on MacOS

Co-authored-by: Roman Seidelsohn <rseidelsohn@gmail.com>
2024-11-19 14:33:35 -05:00
Conrad Irwin
496dae968b Remove old CPU/Memory events (#20865)
Release Notes:

- Telemetry: stop reporting CPU/RAM on a timer
2024-11-19 12:25:16 -07:00
Piotr Osiewicz
5c6565a9e0 editor: Use completion filter_range for fuzzy matching (#20869)
Fixes regression from #13958

Closes #20868

Release Notes:

- N/A
2024-11-19 19:49:36 +01:00
Jaagup Averin
7853e32f80 python: Highlight attribute docstrings (#20763)
Adds more docstring highlights missing from #20486.
[PEP257](https://peps.python.org/pep-0257/) defines attribute docstrings
as
> String literals occurring immediately after a simple assignment at the
top level of a module, class, or __init__ method are called “attribute
docstrings”.

This PR adds `@string.doc` for such cases.
Before:

![Screenshot_20241116_162257](https://github.com/user-attachments/assets/6b471cff-717e-4755-9291-d596da927dc6)
After:

![Screenshot_20241116_162457](https://github.com/user-attachments/assets/96674157-9c86-45b6-8ce9-e433ca0ae8ea)

Release Notes:

- Added Python syntax highlighting for attribute docstrings.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-11-19 18:53:36 +01:00
Marshall Bowers
f5cbfa718e assistant: Fix evaluating slash commands in slash command output (like /default) (#20864)
This PR fixes an issue where slash commands in the output of other slash
commands were not being evaluated when configured to do so.

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

Release Notes:

- Fixed slash commands from other slash commands (like `/default`) not
being evaluated (Preview only).
2024-11-19 11:20:30 -05:00
Conrad Irwin
6a2c712990 Use Instant not chrono for telemetry (#20756)
We occasionally see dates in the future appearing in our telemetry. One
hypothesis is that this is caused by a clock change while Zed is running
causing date math based on chrono to be incorrect.

Instant *should* be a more stable source of relative timestamps.

Release Notes:

- N/A
2024-11-19 08:23:12 -07:00
Egor Krugletsov
9454f0f1c7 clangd: Use Url::to_file_path() to get actual file path for header/source (#20856)
Using `Url::path()` seems fine on POSIX systems as it will leave forward
slash (given hostname is empty). On Windows it will result in error.

Release Notes:

- N/A
2024-11-19 15:49:21 +02:00
Julian de Ruiter
5b0c15d8c4 Add pytest-based test discovery and runnables for Python (#18824)
Closes  #12080, #18649.

Screenshot:

<img width="1499" alt="image"
src="https://github.com/user-attachments/assets/2644c2fc-19cf-4d2c-a992-5c56cb22deed">

Still in progress:

1. I'd like to add configuration options for selecting a Python test
runner (either pytest or unittest) so that users can explicitly choose
which runner they'd like to use for running their tests. This preference
has to be configured as unittest-style tests can also be run by pytest,
meaning we can't rely on auto-discovery to choose the desired test
runner.
2. I'd like to add venv auto-discovery similar to the feature currently
provided by the terminal using detect_venv.
3. Unit tests.

Unfortunately I'm struggling a bit with how to add settings in the
appropriate location (e.g. Python language settings). Can anyone provide
me with some pointers and/or examples on how to either add extra
settings or to re-use the existing ones?

My rust programming level is OK-ish but I'm not very familiar with the
Zed project structure and could use some help.

I'm also open for pair programming as mentioned on the website if that
helps!

Release Notes:

- Added pytest-based test discovery and runnables for Python.
- Adds a configurable option for switching between unittest and pytest
as a test runner under Python language settings. Set "TASK_RUNNER" to
"unittest" under task settings for Python if you wish to use unittest to
run Python tasks; the default is pytest.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-11-19 14:34:56 +01:00
Bennet Bo Fenner
aae39071ef editor: Show hints for using AI features on empty lines (#20824)
Co-Authored-by: Thorsten <thorsten@zed.dev>
Co-Authored-by: Antonio <antonio@zed.dev>

Screenshot:

![screenshot-2024-11-18-17 11
08@2x](https://github.com/user-attachments/assets/610fd7db-7476-4b9b-9465-a3d55df12340)

TODO:
- [x] docs

Release Notes:

- Added inline hints that guide users on how to invoke the inline
assistant and open the assistant panel. (These hints can be disabled by
setting `{"assistant": {"show_hints": false}}`.)

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-11-19 09:41:44 +01:00
Nate Butler
a35b73e63e Revert "remove usages of theme::color_alpha"
This reverts commit c0d11be75f.
2024-11-19 00:24:48 -05:00
Nate Butler
c0d11be75f remove usages of theme::color_alpha 2024-11-19 00:24:37 -05:00
uncenter
0e26d22fea Add HTML injections for markdown (#20527)
Closes https://github.com/zed-industries/extensions/issues/1588.

| Before | After |
| --- | --- |
| ![CleanShot 2024-11-11 at 22 48
43](https://github.com/user-attachments/assets/9470e6a8-6a37-4b8f-8daa-5c8c5ed2bb17)
| ![CleanShot 2024-11-11 at 22 49
43](https://github.com/user-attachments/assets/f2b858d0-9274-4332-b30e-61c13ac347c6)
|

Release Notes:

- Added HTML injections for markdown syntax highlighting
2024-11-18 20:19:24 -07:00
Kyle Kelley
bd0f197415 Create RunningKernel trait to allow for native and remote jupyter kernels (#20842)
Starts setting up a `RunningKernel` trait to make the remote kernel
implementation easy to get started with. No release notes until this is
all hooked up.

Release Notes:

- N/A
2024-11-18 18:12:23 -08:00
Peter Tripp
343c88574a Improve file_types in default.json (#20429)
Detect .env.* as Shell Script
Move non glob json/jsonc/toml file_types into langauges/*/config.toml
2024-11-18 19:56:45 -05:00
Conrad Irwin
e7a0890086 Don't call setAllowsAutomaticKeyEquivalentLocalization on Big Sur (#20844)
Closes #20821

Release Notes:

- Fixed a crash on Big Sur (preview only)
2024-11-18 16:47:36 -07:00
Conrad Irwin
d4c5c0f05e Don't render invisibles with elements (#20841)
Turns out that in the case you have a somehow valid utf-8 file that
contains almost all ascii control characters, we run out of element
arena space.

Fixes: #20652

Release Notes:

- Fixed a crash when opening a file containing a very large number of
ascii control characters on one line.
2024-11-18 16:47:25 -07:00
lord
f0c7e62adc Leave goal_x unchanged when moving by rows past the start or end of the document (#20705)
Perhaps this was intentional behavior, but if not, I've attempted to
write this hacky fix — I noticed using the vertical arrow keys to move
past the document start/end would reset the goal_x to either zero (for
moving upwards) or the line width (for moving downwards). This change
makes Zed match most native text fields (at least on macOS) which leave
goal_x unchanged, even when hitting the end of the document.

I tested this change manually. Would be happy to add automatic tests for
it too, but couldn't find any existing cursor movement tests.

Release Notes:

- Behavior when moving vertically past the start or end of a document
now matches native text fields; it no longer resets the selection goal
2024-11-18 16:32:43 -07:00
Marshall Bowers
80d50f56f3 collab: Add feature flag to bypass account age check (#20843)
This PR adds a `bypass-account-age-check` feature flag that can be used
to bypass the minimum account age check.

Release Notes:

- N/A
2024-11-18 18:20:32 -05:00
Carroll Wainwright
fb6c987e3e python: Improve function syntax highlighting (#20487)
Release Notes:

- Differentiate between function and method calls and definitions.
`function.definition` matches the highlight for e.g. rust,
`function.call` is new.
- Likewise differentiate between class calls and class definitions.
- Better highlighting of function decorators (the `@` symbol is
punctuation, and now the decorator itself has a `function.decorator`
tag)
- Make `cls` a special variable (like `self`)
- Add `ellipsis` as a built-in constant

Note that most themes do not currently make use of the
`function.definition` tags, and none make use of the
`type.class.definition` tag. Hopefully more themes will pick this up.

*Before:*
<img width="248" alt="image"
src="https://github.com/user-attachments/assets/550ccd3d-594c-413a-b543-ef9caf39eee1">


*After:*
<img width="245" alt="image"
src="https://github.com/user-attachments/assets/47aa43b1-006b-4f9f-9029-510880f390ea">
2024-11-19 00:05:39 +01:00
Michael Sloan
b4c2f29c8b Remove use of current File for new buffers that never have File (#20832)
`create_buffer` calls `Buffer::local` which sets `file` to `None`
[here](f12981db32/crates/language/src/buffer.rs (L629)).
So there's no point in then immediately attempting to update maps that
rely on `file` being present.

Release Notes:

- N/A
2024-11-18 14:30:38 -08:00
Peter Tripp
8666ec95ba ssh: Fix SSH to mac remotes (#20838)
Restore ability to SSH to macOS arm remotes (`uname -m` on mac == `arm64`).
Fix regression introduced in https://github.com/zed-industries/zed/pull/20618
2024-11-18 17:17:24 -05:00
Anthony Eid
889aac9c03 Snippet choices (#13958)
Closes: #12739

Release Notes:

Solves #12739 by
- Enable snippet parsing to successfully parse snippets with choices
- Show completion menu when tabbing to a snippet variable with multiple
choices

Todo:
 - [x] Parse snippet choices
- [x] Open completion menu when tabbing to a snippet variable with
several choices (Thank you Piotr)
- [x] Get snippet choices to reappear when tabbing back to a previous
tabstop in a snippet
 - [x] add snippet unit tests
- [x] Add fuzzy search to snippet choice completion menu & update
completion menu based on choices
 - [x] add completion menu unit tests

Current State:

Using these custom snippets

```json
  "my snippet": {
      "prefix": "log",
      "body": ["type ${1|i32, u32|} = $2"],
      "description": "Expand `log` to `console.log()`"
  },
  "my snippet2": {
      "prefix": "snip",
      "body": [
        "type ${1|i,i8,i16,i64,i32|} ${2|test,test_again,test_final|} = $3"
      ],
      "description": "snippet choice tester"
    }
```

Using snippet choices:



https://github.com/user-attachments/assets/d29fb1a2-7632-4071-944f-daeaa243e3ac

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-11-18 22:56:34 +01:00
Peter Tripp
5b9916e34b ci: Add shellcheck for scripts (#20631)
Fixes shellcheck errors in script/*
Adds a couple trailing newlines.
Adds `script/shellcheck-scripts` and associated CI machinery.
Current set ultra-conservative, does not output warnings, only errors.
2024-11-18 16:41:22 -05:00
Peter Tripp
5b317f60df Improve install-cmake script (#20836)
- Don't output junk to stderr when cmake unavailable
- Kitware PPA does not include up to date bins for all distros (e.g.
Ubuntu 24 only has 3.30.2 although 3.30.4 has been out for a while) so
don't try to force install a specific version. Take the best we can get.
2024-11-18 16:39:57 -05:00
Marshall Bowers
e2552b9add collab: Bypass account age check for users with active LLM subscriptions (#20837)
This PR makes it so users with an active LLM subscription can bypass the
account age check.

Release Notes:

- N/A
2024-11-18 16:37:28 -05:00
Danilo Leal
37899187c6 Adjust file finder width configuration (#20819)
Follow up to: https://github.com/zed-industries/zed/pull/18682

This PR tweaks the setting value, so it's clear we're referring to
`max-width`, meaning the width will change up to a specific value
depending on the available window size. Then, it also makes `Small` the
default value, which, in practice, makes the modal size the same as it
was before the original PR linked above.

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-11-18 16:32:16 -03:00
Michael Sloan
d265e44209 Don't treat absence of a file on fs as conflict for new files from CLI (#20828)
Closes #20827

Release Notes:

- Fixes bug where save for new files created via CLI would report a
conflict and ask about overwriting.
2024-11-18 10:55:44 -08:00
Peter Tripp
f12981db32 docs: Add Language extension config TBDs (To Be Documented) (#20829)
Release Notes:

- N/A
2024-11-18 13:31:24 -05:00
Michael Sloan
d99f5fe83e Add File.disk_state enum to clarify filesystem states (#20776)
Motivation for this is to make things more understandable while figuring
out #20775.

This is intended to be a refactoring that does not affect behavior, but
there are a few tricky spots:

* Previously `File.mtime()` (now `File.disk_state().mtime()`) would
return last known modification time for deleted files. Looking at uses,
I believe this will not affect anything. If there are behavior changes
here I believe they would be improvements.

* `BufferEvent::DirtyChanged` is now only emitted if dirtiness actually
changed, rather than if it may have changed. This should only be an
efficiency improvement.

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-11-18 10:30:08 -08:00
Marshall Bowers
df1d0dec0a ocaml: Extract to zed-extensions/ocaml repository (#20825)
This PR extracts the OCaml extensions to the
[zed-extensions/ocaml](https://github.com/zed-extensions/ocaml)
repository.

Release Notes:

- N/A
2024-11-18 11:30:45 -05:00
Marshall Bowers
ad94ad511a ocaml: Bump to v0.1.1 (#20823)
This PR bumps the OCaml extension to v0.1.1.

Changes:

- https://github.com/zed-industries/zed/pull/20700

Release Notes:

- N/A
2024-11-18 11:02:32 -05:00
Danilo Leal
0e7770a9a2 theme: Add color darken function (#20746)
This PR adds a `darken` function that allows to reduce the lightness of
a color by a certain factor. This popped up as I wanted to add hover
styles to tinted-colors buttons.

Release Notes:

- N/A
2024-11-18 12:44:49 -03:00
Danilo Leal
3f905d57e5 assistant: Adjust title summarization prompt (#20822)
Meant to avoid the excessive use of "Here's a concise 3-7 word title..."
and "Title:" instances we've been seeing lately.
Follow up to: https://github.com/zed-industries/zed/pull/19530

Release Notes:

- Improve prompt for generating title summaries, avoiding preambles
2024-11-18 12:44:06 -03:00
Peter Tripp
f01a86c644 Support for Back/Forward multimedia keys (#20695)
- Added Support for Back/Forward multimedia keys (Linux)
2024-11-18 09:36:08 -05:00
Peter Tripp
5fd7afb9da docs: More language extension config.toml key documentation (#20818)
Release Notes:

- N/A
2024-11-18 09:23:29 -05:00
Michael Sloan
9260abafba Use HashMap<ProjectEntryId, Entry> instead of HashSet<Entry> in outline_panel (#20780)
Came across this because I noticed that `Entry` implements `Hash`, which
was surprising to me. I believe that `ProjectEntryId` should be unique
and so it seems better to dedupe based on this.

Release Notes:

- N/A
2024-11-18 14:38:31 +02:00
Kirill Bulatov
d92166f9f6 Revert "Use livekit's Rust SDK instead of their swift SDK (#13343)" (#20809)
Issues found:

* audio does not work well with various set-ups using USB
* switching audio during initial join may leave the client with no audio
at all
* audio streaming is done on the main thread, beachballing certain
set-ups
* worse screenshare quality (seems that there's no dynamic scaling
anymore, compared to the Swift SDK)

This reverts commit 1235d0808e.

Release Notes:

- N/A
2024-11-18 11:43:53 +02:00
moshyfawn
59a355da74 docs: Update Svelte extension link (#20804)
Closes #20768

Release Notes:

- N/A
2024-11-18 09:51:47 +02:00
Nathan Sobo
ee207ab77e Map "feature upsell" events to the new "Noun Verbed" format (#20787)
Release Notes:

- N/A
2024-11-17 07:38:30 -07:00
Isaac Donaldson
31566cb5a0 Add width setting for the file finder (#18682)
This PR adds the ability to adjust the width of the file finder popup. I
found when searching my projects the default width was not always wide
enough and there was no option to change it.

It allows values `small`, `medium` (default), `large`, `xlarge`, and
`full`

Release Notes:

- Added a setting to adjust the width of the file finder modal


Example Setting:
```json
  "file_finder": {
    "modal_width": "medium"
  },
```

Screenshots can be found in the comments below.
2024-11-16 20:52:43 +02:00
Lu Wan
2d3476530e lsp: Retrieve links to documentation for the given symbol (#19233)
Closes #18924 

Release Notes:

- Added an `editor:OpenDocs` action to open links to documentation via
rust-analyzer
2024-11-16 20:23:49 +02:00
Nathan Sobo
f9990b42fa Send events to Snowflake in the format they're expected by Amplitude (#20765)
This will allow us to use the events table directly in Amplitude, which
lets us use the newer event ingestion flow that detects changes to the
table. Otherwise we'll need a transformation.

I think Amplitude's API is probably a pretty good example to follow for
the raw event schema, even if we don't end up using their product. They
also recommend a "Noun Verbed" format for naming events, so I think we
should go with this. This will help us be consistent and encourage the
author of events to think more clearly about what event they're
reporting.

cc @ConradIrwin 

Release Notes:

- N/A
2024-11-16 09:58:19 -07:00
Siddharth M. Bhatia
97e9137cb7 Update references of Ollama Llama 3.1 to model Llama 3.2 (#20757)
Release Notes:

- N/A
2024-11-16 11:18:53 -05:00
Jason Lee
932c7e23c8 gpui: Fix SVG color render, when color have alpha (#20537)
Release Notes:

- N/A


## Demo

- [Source
SVG](https://github.com/user-attachments/assets/1c681e01-baba-4613-a3e7-ea5cb3015406)
click here open in browser.

| Before | After |
| --- | --- |
| <img width="1212" alt="image"
src="https://github.com/user-attachments/assets/ba323b13-538b-4a34-bb64-9dcf490aface">
| <img width="1212" alt="image"
src="https://github.com/user-attachments/assets/4635926a-843e-426d-89a1-4e9b4f4cc37e">
|

---------

Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2024-11-16 16:53:57 +02:00
Aaron Ruan
65a9c8d994 Dynamic tab bar height (#19076)
Tracking issue: https://github.com/zed-industries/zed/issues/18078

Release Notes:

- Change tab bar height according to `ui-density`

---------

Signed-off-by: Aaron Ruan <aaron212cn@outlook.com>
2024-11-16 13:48:25 +02:00
狐狸
33f09bad60 Highlight ? and : in ternary expressions as operator in JavaScript, TypeScript, and TSX (#20573)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2024-11-16 13:42:10 +02:00
Jason Lee
792c1e4710 gpui: Add paint_path example (#20499)
Release Notes:

- N/A

---

```
cargo run -p gpui --example painting
```

I added this demo to verify the detailed support of Path drawing in
GPUI.

Because of, when we actually used GPUI to draw a 2D line chart, we found
that the straight line Path#line_to did not support `anti-aliasing`, and
the drawn line looked very bad.

As shown in the demo image, if we zoom in on the image, we can clearly
see that all the lines are jagged.

I read and tried to make some appropriate adjustments to the functions
in Path, but since I have no experience in the graphics field, I still
cannot achieve anti-aliasing support so far.

I don't know if I used it wrong somewhere. I checked `curve_to` and
found that the curves drawn have anti-aliasing effects, as shown in the
arc part of the figure below.

<img width="1136" alt="image"
src="https://github.com/user-attachments/assets/4dfb7603-e746-43e9-b737-cff56b56329f">
2024-11-16 13:36:13 +02:00
Gowtham K
b421ffafb5 Windows: Add transparency effect (#20400)
Release Notes:

- Added Transparency effect for Windows #19405 


![image](https://github.com/user-attachments/assets/b0750020-5a89-48c9-b26e-13b30874cf8d)


![image](https://github.com/user-attachments/assets/80609a14-b8c3-4159-b909-1e61f4c3eac3)

---------

Co-authored-by: thedeveloper-sharath <35845141+thedeveloper-sharath@users.noreply.github.com>
2024-11-16 13:24:30 +02:00
SweetPPro
21c785ede4 Add more common Prettier plugin base paths (#20758)
Closes #19024

Release Notes:
- Added some more common Prettier plugin base paths
2024-11-16 13:20:52 +02:00
Mikayla Maki
516f7b3642 Add Loading and Fallback States to Image Elements (via StyledImage) (#20371)
@iamnbutler edit:

This pull request enhances the image element by introducing the ability
to display loading and fallback states.

Changes:

- Implemented the loading and fallback states for image elements using
`.with_loading` and `.with_fallback` respectively.
- Introduced the `StyledImage` trait and `ImageStyle` to enable a fluent
API for changing image styles across image types (`Img`,
`Stateful<Img>`, etc).

Example Usage:

```rust
fn loading_element() -> impl IntoElement {
    div().size_full().flex_none().p_0p5().rounded_sm().child(
        div().size_full().with_animation(
            "loading-bg",
            Animation::new(Duration::from_secs(3))
                .repeat()
                .with_easing(pulsating_between(0.04, 0.24)),
            move |this, delta| this.bg(black().opacity(delta)),
        ),
    )
}

fn fallback_element() -> impl IntoElement {
    let fallback_color: Hsla = black().opacity(0.5);

    div().size_full().flex_none().p_0p5().child(
        div()
            .size_full()
            .flex()
            .items_center()
            .justify_center()
            .rounded_sm()
            .text_sm()
            .text_color(fallback_color)
            .border_1()
            .border_color(fallback_color)
            .child("?"),
    )
}

impl Render for ImageLoadingExample {
    fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
        img("some/image/path")
            .id("image-1")
            .with_fallback(|| Self::fallback_element().into_any_element())
            .with_loading(|| Self::loading_element().into_any_element())
    }
}
```

Note:

An `Img` must have an `id` to be able to add a loading state.

Release Notes:

- N/A

---------

Co-authored-by: nate <nate@zed.dev>
Co-authored-by: michael <michael@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-11-15 19:12:01 -08:00
Michael Sloan
f34877334e Fix tab strikethrough logic (#20755)
This fix was in downstream commits before splitting out #20711, should
have tested locally before merging.

Release Notes:

- N/A
2024-11-15 17:14:49 -07:00
Peter Tripp
6e296eb4b6 ssh: Use openbsd nc on macOS (#20751)
Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-11-15 17:27:45 -05:00
Wes Higbee
4c8c6c08fe docs: Fix assistant prompt_overrides template directory (#20434)
Update docs to reflect the correct path for prompt handlebars templates.
Link to git repo for prompts rather than including an out of date version inline.

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-11-15 17:26:50 -05:00
Michael Sloan
050ce919ba Rename "Overwrite" to "Save" for prompt about recreating a deleted file (#20750)
Release Notes:

- N/A
2024-11-15 15:12:40 -07:00
Michael Sloan
369828f51c Require save confirmation and prevent autosave for deleted files (#20742)
* `has_conflict` will now return true if the file has been deleted on
disk.  This is for treating multi-buffers as conflicted, and also
blocks auto-save.

* `has_deleted_file` is added so that the single-file buffer save can
specifically mention the delete conflict. This does not yet handle
discard (#20745).

Closes #9101
Closes #9568
Closes #20462

Release Notes:

- Improved handling of externally deleted files: auto-save will be
disabled, multibuffers will treat this as a save conflict, and single
buffers will ask for restore confirmation.

Co-authored-by: Conrad <conrad@zed.dev>
2024-11-15 15:01:16 -07:00
Conrad Irwin
ac5ecf5487 Don't log every value (#20744)
Release Notes:

- N/A
2024-11-15 14:36:58 -07:00
Max Brunsfeld
1235d0808e Use livekit's Rust SDK instead of their swift SDK (#13343)
See https://github.com/livekit/rust-sdks/pull/355

Todo:

* [x] make `call` / `live_kit_client` crates use the livekit rust sdk
* [x] create a fake version of livekit rust API for integration tests
* [x] capture local audio
* [x] play remote audio
* [x] capture local video tracks
* [x] play remote video tracks
* [x] tests passing
* bugs
* [x] deafening does not work
(https://github.com/livekit/rust-sdks/issues/359)
* [x] mute and speaking status are not replicated properly:
(https://github.com/livekit/rust-sdks/issues/358)
* [x] **linux** - crash due to symbol conflict between WebRTC's
BoringSSL and libcurl's openssl
(https://github.com/livekit/rust-sdks/issues/89)
* [x] **linux** - libwebrtc-sys adds undesired dependencies on `libGL`
and `libXext`
* [x] **windows** - linker error, maybe related to the C++ stdlib
(https://github.com/livekit/rust-sdks/issues/364)
        ```
libwebrtc_sys-54978c6ad5066a35.rlib(video_frame.obj) : error LNK2038:
mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't
match value 'MD_DynamicRelease' in
libtree_sitter_yaml-df6b0adf8f009e8f.rlib(2e40c9e35e9506f4-scanner.o)
        ```
    * [x] audio problems

Release Notes:

- Switch from Swift to Rust LiveKit SDK 🦀

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Conrad Irwin <conrad@zed.dev>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Michael Sloan <michael@zed.dev>
2024-11-15 23:18:50 +02:00
Conrad Irwin
6ff69faf37 Start to send data to Snowflake too (#20698)
This PR adds support for sending telemetry events to AWS Kinesis.

In our AWS account we now have three new things:
* The [Kinesis data
stream](https://us-east-1.console.aws.amazon.com/kinesis/home?region=us-east-1#/streams/details/zed-telemetry/monitoring)
that we will actually write to.
* A [Firehose for
Axiom](https://us-east-1.console.aws.amazon.com/firehose/home?region=us-east-1#/details/telemetry-to-axiom/monitoring)
that sends events from that stream to Axiom for ad-hoc queries over
recent data.
* A [Firehose for
Snowflake](https://us-east-1.console.aws.amazon.com/firehose/home?region=us-east-1#/details/telemetry-to-snowflake/monitoring)
that sends events from that stream to Snowflake for long-term retention.
This Firehose also backs up data into an S3 bucket in case we want to
change how the system works in the future.

In a follow-up PR, we'll add support for ad-hoc telemetry events; and
slowly move away from the current Clickhouse defined schemas; though we
won't move off click house until we have what we need in Snowflake.

Co-Authored-By: Nathan <nathan@zed.dev>

Release Notes:

- N/A
2024-11-15 12:58:00 -07:00
renovate[bot]
f449e8d3d3 Migrate Renovate config (#20741)
The Renovate config in this repository needs migrating. Typically this
is because one or more configuration options you are using have been
renamed.

You don't need to merge this PR right away, because Renovate will
continue to migrate these fields internally each time it runs. But later
some of these fields may be fully deprecated and the migrations removed.
So it's a good idea to merge this migration PR soon.





🔕 **Ignore**: Close this PR and you won't be reminded about config
migration again, but one day your current config may no longer be valid.

 Got questions? Does something look wrong to you? Please don't hesitate
to [request help
here](https://redirect.github.com/renovatebot/renovate/discussions).


---

Release Notes:

- N/A

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-11-15 14:37:39 -05:00
Marshall Bowers
da09cbd055 assistant: Show more details for assist errors (#20740)
This PR updates the Assistant to show more detailed error messages when
the user encounters an assist error.

Here are some examples:

<img width="415" alt="Screenshot 2024-11-15 at 1 47 03 PM"
src="https://github.com/user-attachments/assets/5e7c5d5f-bd78-4af3-86ed-af4c6712770f">

<img width="417" alt="Screenshot 2024-11-15 at 2 11 14 PM"
src="https://github.com/user-attachments/assets/02cb659b-1239-4e24-865f-3a512703a94f">

The notification will scroll if the error lines overflow the set maximum
height.

Release Notes:

- Updated the Assistant to show more details in error cases.
2024-11-15 14:23:46 -05:00
Caleb Heydon
4327459d2a Fix Rust LSP adapter on FreeBSD (#20736)
This PR fixes the Rust LSP adapter on FreeBSD. This issue was creating
build errors.

Release Notes:

- Fixed Rust LSP adapter on FreeBSD
2024-11-15 11:03:55 -07:00
Michael Sloan
cc601bd770 Use strikethrough style in label implementation (#20735)
Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: Marshall Bowers <marshall@zed.dev>
2024-11-15 10:57:23 -07:00
Marshall Bowers
c491b75e07 assistant: Fix panic when using /project (#20733)
This PR fixes a panic when using `/project` (which is staff-flagged).

We weren't initializing the `SemanticDb` global if the
`project-slash-command` feature flag was enabled.

Closes #20563.

Release Notes:

- N/A
2024-11-15 12:25:29 -05:00
Marshall Bowers
3420ebb428 util: Remove unused code (#20734)
This PR removes the `with_clone` macro from `util`, as it wasn't used
(and isn't needed).

Release Notes:

- N/A
2024-11-15 12:25:18 -05:00
Marshall Bowers
b23d72ec4f gpui: Clean up Styled doc comments (#20731)
This PR cleans up the doc comments on the `Styled` trait to make them
more consistent.

Release Notes:

- N/A
2024-11-15 11:27:49 -05:00
Peter Tripp
e25a03cd3c docs: Variable escaping in tasks (#20730) 2024-11-15 11:14:30 -05:00
Marshall Bowers
9e8ff3f198 Update .mailmap (#20729)
This PR updates the `.mailmap` file to merge some more commit authors.

Release Notes:

- N/A
2024-11-15 11:05:41 -05:00
Marshall Bowers
6d80d5b74b gpui: Add line_through method to Styled (#20728)
This PR adds a `.line_through` method to the `Styled` trait that mirrors
the corresponding Tailwind class.

Release Notes:

- N/A
2024-11-15 10:51:09 -05:00
TOULAR
7137bdee02 Fix scrollbar not always being on top (#20665)
Set the elevation of the scrollbar to 1 borderless, so that the blue
outline is no longer above the scrollbar.

Closes #19875

Release Notes:

- N/A

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-11-15 16:47:17 +01:00
Kirill Bulatov
98403aa994 Disable signature help shown by default (#20726)
Closes https://github.com/zed-industries/zed/issues/20725

Stop showing the pop-up that gets an issue open every now and then.

Release Notes:

- Stopped showing signature help after completions by default
2024-11-15 17:19:11 +02:00
lord
794ad1af75 ocaml: Improve highlighting and bracketing (#20700)
Some small improvements to OCaml. Would happily split these into smaller
changes, discard anything, etc.

Before:
<img width="441" alt="before"
src="https://github.com/user-attachments/assets/2fb82b03-0d45-4c59-a94d-6f48d634fe19">

After:
<img width="448" alt="after"
src="https://github.com/user-attachments/assets/aa232d8f-4b1b-48f8-93e2-2147de37a20d">

OCaml highlighting and bracketing improvements
    - Fixed bug where `<` was automatically closed with `>`.
    - Typing `{|` now automatically closes with `|}`
- Type variables are now colored with `variable.special` instead of
`variable`.
- Argument names in function declarations and application are now
colored with `label` instead of `property`, even if they are punned.
- `[@@` and `[%` in macros are now colored as bracket punctuation to
match the closing `]`, rather than colored as `attribute`

Release Notes:

- N/A
2024-11-15 10:17:46 -05:00
Conrad Irwin
4b1f0c033b html: Bump to v0.1.4 (#20692)
Changes:

- https://github.com/zed-industries/zed/pull/20536

Release Notes:

- N/A
2024-11-15 10:10:25 -05:00
Danilo Leal
3796b4a55c project panel: Update decoration icon active color (#20723)
Just so that the icon decoration knockout color matches the background
of a selected/market item.

<img width="600" alt="Screenshot 2024-11-15 at 10 50 24"
src="https://github.com/user-attachments/assets/0037fe5a-f42d-47e8-8559-97ca11ff2d97">

Release Notes:

- N/A
2024-11-15 11:48:26 -03:00
Piotr Osiewicz
8c02929710 pane: Fix rough edges around pinning of dropped project entries (#20722)
Closes #20485

Release Notes:

- Fixed quirks around dropping project entries into tab bar which
might've led to tabs being pinned sometimes.
2024-11-15 13:51:40 +01:00
Kirill Bulatov
1e14697bb6 Fix Linux rust-analyzer downloads in Preview (#20718)
Follow-up of https://github.com/zed-industries/zed/pull/20408

Release Notes:

- (Preview) Fixed broken rust-analyzer downloads
2024-11-15 11:57:54 +02:00
Adam Wolff
f619a872b5 python: Prefer conda environments that match CONDA_PREFIX (#20702)
Release Notes:

- Improved Python toolchain selection for conda environments
2024-11-15 09:12:35 +01:00
Michael Sloan
c03f5b351b Use strikethrough on tab label to indicate file deletion (#20711)
Closes #5364

Release Notes:

- Added indication of deleted files. Files deleted outside of Zed will
have a strikethrough in the title of the tab.
2024-11-15 00:39:09 -07:00
Conrad Irwin
a8df0642a8 vim: Allow :cpplink for CopyPermalinkToLine (#20707)
Release Notes:

- vim: Added `:<range>cpplink` to copy a permanent git link to the
highlighted range to the clipboard
2024-11-14 23:44:40 -07:00
Thorsten Ball
aee01f2c50 assistant: Remove low_speed_timeout (#20681)
This removes the `low_speed_timeout` setting from all providers as a
response to issue #19509.

Reason being that the original `low_speed_timeout` was only as part of
#9913 because users wanted to _get rid of timeouts_. They wanted to bump
the default timeout from 5sec to a lot more.

Then, in the meantime, the meaning of `low_speed_timeout` changed in
#19055 and was changed to a normal `timeout`, which is a different thing
and breaks slower LLMs that don't reply with a complete response in the
configured timeout.

So we figured: let's remove the whole thing and replace it with a
default _connect_ timeout to make sure that we can connect to a server
in 10s, but then give the server as long as it wants to complete its
response.

Closes #19509

Release Notes:

- Removed the `low_speed_timeout` setting from LLM provider settings,
since it was only used to _increase_ the timeout to give LLMs more time,
but since we don't have any other use for it, we simply remove the
setting to give LLMs as long as they need.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Peter Tripp <peter@zed.dev>
2024-11-15 07:37:31 +01:00
chottolabs
c9546070ac docs: Update Zig Tree-sitter grammar link (#20708)
lines up with
https://github.com/zed-industries/zed/blob/main/extensions/zig/extension.toml

Release Notes:

- N/A
2024-11-15 07:45:36 +02:00
Marshall Bowers
1855a312d0 Use Extension trait in ExtensionLspAdapter (#20704)
This PR updates the `ExtensionLspAdapter` to go through the `Extension`
trait for interacting with extensions rather than going through the
`WasmHost` directly.

Release Notes:

- N/A
2024-11-14 20:44:57 -05:00
Dairon M.
332b33716a erlang: Update tree-sitter grammar (#20699)
erlang: Update tree-sitter grammar for new OTP 27 features:
- -moduledoc and -doc attributes
- Sigils
- Triple quoted strings

<img width="717" alt="Screenshot 2024-11-14 at 5 18 08 PM"
src="https://github.com/user-attachments/assets/24812b17-4e64-47f3-a6ab-6bc7260cd53f">

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-11-14 18:10:00 -05:00
Conrad Irwin
acf25324be Delete a.html (#20691)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2024-11-14 13:00:03 -07:00
hrou0003
f0882f44a7 vim: Enable % to jump between tags (#20536)
Closes #12986

Release Notes:

- Enable `%` to jump between pairs of tags

---------

Co-authored-by: Harrison <hrouillard@sfi.com.au>
2024-11-14 12:41:53 -07:00
Harsh Narayan Jha
189a034e71 docs: Document exec flags for GDScript (#20688)
While looking up the GDScript extension docs, I noticed that the
original extension repo mentions of `{line}:{col}` placeholders too in
addition to `{project} {file}` that the Zed docs suggest adding.

This PR Improves the docs to add those missing options to the suggested
flags.
2024-11-14 14:28:25 -05:00
Conrad Irwin
7f52071513 Use the project env when running LSPs (#20641)
This change ensures we always run LSPs with the project environment (in
addition to any overrides they provide). This helps ensure the
environment is
set correctly on remotes where we don't load the login shell environment
and
assign it to the current process.

Also fixed the go language to use the project env to find the go
command.

Release Notes:

- Improved environment variable handling for SSH remotes
2024-11-14 12:26:55 -07:00
Piotr Osiewicz
56c93be4de project panel: Fix rendering of groups of dragged project panel entries (#20686)
This PR introduces a new parameter for `on_drag` in gpui, which is an
offset from the element origin to the mouse event origin.

Release Notes:

- Fixed rendering of dragged project panel entries
2024-11-14 19:29:18 +01:00
Marshall Bowers
43999c47e1 client: Remove unneeded return (#20685)
This PR removes an unneeded `return` that was introduced in #19928.

Release Notes:

- N/A
2024-11-14 13:16:55 -05:00
David Soria Parra
690a725667 context_servers: Upgrade protocol to version 2024-11-05 (#20615)
This updates context servers to the most recent version

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-11-14 13:03:30 -05:00
Marshall Bowers
b5ce8e7aa5 zed_extension_api: Release v0.2.0 (#20683)
This PR releases v0.2.0 of the Zed extension API.

Support for this version of the extension API will land in Zed v0.162.x.

Release Notes:

- N/A
2024-11-14 12:44:10 -05:00
Marshall Bowers
d177a1d4e5 Move ExtensionStore tests back to extension_host (#20682)
This PR moves the tests for the `ExtensionStore` back into the
`extension_host` crate.

We now have a separate `TestExtensionRegistrationHooks` to use in the
test that implements the minimal required functionality needed for the
tests. This means that we can depend on the `theme` crate only in the
tests.

Release Notes:

- N/A
2024-11-14 12:09:41 -05:00
renovate[bot]
5d17cfab31 Update Rust crate wasmtime to v24.0.2 [SECURITY] (#20614)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [wasmtime](https://redirect.github.com/bytecodealliance/wasmtime) |
workspace.dependencies | patch | `24.0.1` -> `24.0.2` |

### GitHub Vulnerability Alerts

####
[CVE-2024-51745](https://redirect.github.com/bytecodealliance/wasmtime/security/advisories/GHSA-c2f5-jxjv-2hh8)

### Impact

Wasmtime's filesystem sandbox implementation on Windows blocks access to
special device filenames such as "COM1", "COM2", "LPT0", "LPT1", and so
on, however it did not block access to the special device filenames
which use superscript digits, such as "COM¹", "COM²", "LPT⁰", "LPT¹",
and so on. Untrusted Wasm programs that are given access to any
filesystem directory could bypass the sandbox and access devices through
those special device filenames with superscript digits, and through them
gain access peripheral devices connected to the computer, or network
resources mapped to those devices. This can include modems, printers,
network printers, and any other device connected to a serial or parallel
port, including emulated USB serial ports.

### Patches

Patch releases for Wasmtime have been issued as 24.0.2, 25.0.3, and
26.0.1. Users of Wasmtime 23.0.x and prior are recommended to upgrade to
one of these patched versions.

### Workarounds

There are no known workarounds for this issue. Affected Windows users
are recommended to upgrade.

### References

- [Microsoft's
documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions)
of the special device filenames
 - [ISO-8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
- [The original PR reporting the
issue](https://redirect.github.com/bytecodealliance/cap-std/pull/371)

---

### Release Notes

<details>
<summary>bytecodealliance/wasmtime (wasmtime)</summary>

###
[`v24.0.2`](https://redirect.github.com/bytecodealliance/wasmtime/releases/tag/v24.0.2)

[Compare
Source](https://redirect.github.com/bytecodealliance/wasmtime/compare/v24.0.1...v24.0.2)

#### 24.0.2

Released 2024-11-05.

##### Fixed

- Update to cap-std 3.4.1, for
[#&#8203;9559](https://redirect.github.com/bytecodealliance/wasmtime/issues/9559),
which fixes a wasi-filesystem sandbox
    escape on Windows.

[CVE-2024-51745](https://redirect.github.com/bytecodealliance/wasmtime/security/advisories/GHSA-c2f5-jxjv-2hh8).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "" in timezone America/New_York,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 18:35:31 +02:00
renovate[bot]
404ddeebc5 Update Rust crate serde_json to v1.0.132 (#20638)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [serde_json](https://redirect.github.com/serde-rs/json) | dependencies
| patch | `1.0.128` -> `1.0.132` |
| [serde_json](https://redirect.github.com/serde-rs/json) |
workspace.dependencies | patch | `1.0.128` -> `1.0.132` |

---

### Release Notes

<details>
<summary>serde-rs/json (serde_json)</summary>

###
[`v1.0.132`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.132)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.131...1.0.132)

- Improve binary size and compile time for JSON array and JSON object
deserialization by about 50%
([#&#8203;1205](https://redirect.github.com/serde-rs/json/issues/1205))
- Improve performance of JSON array and JSON object deserialization by
about 8%
([#&#8203;1206](https://redirect.github.com/serde-rs/json/issues/1206))

###
[`v1.0.131`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.131)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.130...1.0.131)

- Implement Deserializer and IntoDeserializer for `Map<String, Value>`
and `&Map<String, Value>`
([#&#8203;1135](https://redirect.github.com/serde-rs/json/issues/1135),
thanks [@&#8203;swlynch99](https://redirect.github.com/swlynch99))

###
[`v1.0.130`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.130)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.129...1.0.130)

- Support converting and deserializing `Number` from i128 and u128
([#&#8203;1141](https://redirect.github.com/serde-rs/json/issues/1141),
thanks [@&#8203;druide](https://redirect.github.com/druide))

###
[`v1.0.129`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.129)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.128...1.0.129)

- Add
[`serde_json::Map::sort_keys`](https://docs.rs/serde_json/1/serde_json/struct.Map.html#method.sort_keys)
and
[`serde_json::Value::sort_all_objects`](https://docs.rs/serde_json/1/serde_json/enum.Value.html#method.sort_all_objects)
([#&#8203;1199](https://redirect.github.com/serde-rs/json/issues/1199))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 18:35:13 +02:00
renovate[bot]
ad370ed986 Update Rust crate sys-locale to v0.3.2 (#20639)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [sys-locale](https://redirect.github.com/1Password/sys-locale) |
workspace.dependencies | patch | `0.3.1` -> `0.3.2` |

---

### Release Notes

<details>
<summary>1Password/sys-locale (sys-locale)</summary>

###
[`v0.3.2`](https://redirect.github.com/1Password/sys-locale/releases/tag/v0.3.2)

[Compare
Source](https://redirect.github.com/1Password/sys-locale/compare/v0.3.1...v0.3.2)

#### What's Changed

##### Added

- Support for all other Apple targets, such as watchOS and tvOS by
[@&#8203;complexspaces](https://redirect.github.com/complexspaces) in
[https://github.com/1Password/sys-locale/pull/38](https://redirect.github.com/1Password/sys-locale/pull/38).
- Support for ignoring POSIX modifiers in UNIX locales with them present
by [@&#8203;pasabanov](https://redirect.github.com/pasabanov) in
[https://github.com/1Password/sys-locale/pull/33](https://redirect.github.com/1Password/sys-locale/pull/33).
    -   Parsing support/recognition may come at a later date.
- Support for returning a list of user locales on Linux/BSD UNIX
platforms by [@&#8203;pasabanov](https://redirect.github.com/pasabanov)
in
[https://github.com/1Password/sys-locale/pull/35](https://redirect.github.com/1Password/sys-locale/pull/35).

##### Fixed

- No longer use `LC_CTYPE` when determining the locale; the crate now
uses `LC_MESSAGES` in its place by
[@&#8203;pasabanov](https://redirect.github.com/pasabanov) in
[https://github.com/1Password/sys-locale/pull/35](https://redirect.github.com/1Password/sys-locale/pull/35).
- Skip empty locale environment variables on UNIX platforms by
[@&#8203;complexspaces](https://redirect.github.com/complexspaces) in
[https://github.com/1Password/sys-locale/pull/29](https://redirect.github.com/1Password/sys-locale/pull/29).
- Corrected types mentioned and improved the public API documentation by
[@&#8203;pasabanov](https://redirect.github.com/pasabanov) in
[https://github.com/1Password/sys-locale/pull/37](https://redirect.github.com/1Password/sys-locale/pull/37).

##### Changed

- Improved crate download size by excluding unused directories and files
by [@&#8203;pasabanov](https://redirect.github.com/pasabanov).
- Very slight improvement to locale fetching performance on Windows by
[@&#8203;complexspaces](https://redirect.github.com/complexspaces) in
[https://github.com/1Password/sys-locale/pull/29](https://redirect.github.com/1Password/sys-locale/pull/29).
- Increased MSRV to Rust 1.56, which is 3 years old as of this release
by [@&#8203;complexspaces](https://redirect.github.com/complexspaces).

#### New Contributors

- [@&#8203;pasabanov](https://redirect.github.com/pasabanov) made their
first contribution in
[https://github.com/1Password/sys-locale/pull/30](https://redirect.github.com/1Password/sys-locale/pull/30)

**Full Changelog**:
https://github.com/1Password/sys-locale/compare/v0.3.1...v0.3.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 18:35:05 +02:00
renovate[bot]
ced9045591 Update Rust crate thiserror to v1.0.69 (#20643)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [thiserror](https://redirect.github.com/dtolnay/thiserror) |
workspace.dependencies | patch | `1.0.64` -> `1.0.69` |

---

### Release Notes

<details>
<summary>dtolnay/thiserror (thiserror)</summary>

###
[`v1.0.69`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.69)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.68...1.0.69)

-   Backport 2.0.2 fixes

###
[`v1.0.68`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.68)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.67...1.0.68)

- Handle incomplete expressions more robustly in format arguments, such
as while code is being typed
([#&#8203;341](https://redirect.github.com/dtolnay/thiserror/issues/341),
[#&#8203;344](https://redirect.github.com/dtolnay/thiserror/issues/344))

###
[`v1.0.67`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.67)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.66...1.0.67)

- Improve expression syntax support inside format arguments
([#&#8203;335](https://redirect.github.com/dtolnay/thiserror/issues/335),
[#&#8203;337](https://redirect.github.com/dtolnay/thiserror/issues/337),
[#&#8203;339](https://redirect.github.com/dtolnay/thiserror/issues/339),
[#&#8203;340](https://redirect.github.com/dtolnay/thiserror/issues/340))

###
[`v1.0.66`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.66)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.65...1.0.66)

- Improve compile error on malformed format attribute
([#&#8203;327](https://redirect.github.com/dtolnay/thiserror/issues/327))

###
[`v1.0.65`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.65)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.64...1.0.65)

- Ensure OUT_DIR is left with deterministic contents after build script
execution
([#&#8203;325](https://redirect.github.com/dtolnay/thiserror/issues/325))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 18:34:58 +02:00
Kirill Bulatov
0d9bcbba25 Use vim-like keybindings for splitting out of the file finder (#20680)
Follow-up of https://github.com/zed-industries/zed/pull/20507

Release Notes:

- (breaking Preview) Adjusted file finder split keybindings to be less
conflicting

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-11-14 18:32:04 +02:00
Peter Tripp
c650ba4e72 docs: Proto formatter example (#20677) 2024-11-14 11:25:37 -05:00
Marshall Bowers
5fab3ca5ba Format workspace Cargo.toml (#20679)
This PR does some formatting of the workspace `Cargo.toml`.

Release Notes:

- N/A
2024-11-14 11:10:58 -05:00
zachcp
621a200d2f docs: Remove duplicate text in the Clojure page (#20635) 2024-11-14 10:36:43 -05:00
Shiny
2544fad8a4 Fix tab switch behavior for the Sublime Text keymap (#20547)
Don't override tab switching behavior, default has correct behavior.
2024-11-14 09:50:29 -05:00
Piotr Osiewicz
49eb865e8a python: Improve handling of triple-quoted strings (#20664)
Closes #13998

/cc @notpeter would you mind giving this branch a go to see if this is
pleasant to use? This impl is not quite what VSC has, but I think it
feels okay?

In this PR, the sequence goes as follows:
1st keypress: "|"
2nd keypress: ""|
3rd keypress: """|"""

Release Notes:

- Improved handling of triple-quote strings in Python.
2024-11-14 15:12:46 +01:00
Piotr Osiewicz
a650fe0d77 python: Fix detection of Poetry environments (#20669)
We were missing a .configure call, which let to discrepancies with PET
output.

Release Notes:

- Improved detection of Poetry-based environments
2024-11-14 14:54:53 +01:00
Danilo Leal
204a989758 assistant: Add tiny design tweaks to the patch block (#20636)
Adjusting really tiny things, most notably ensuring that the header text
doesn't overflow out of the block.

<img width="600" alt="Screenshot 2024-11-13 at 20 11 08"
src="https://github.com/user-attachments/assets/26656203-92c6-49e5-a732-bae010f96b2d">


Release Notes:

- N/A
2024-11-14 10:53:00 -03:00
Thorsten Ball
776cfe44d7 environment: Log stderr too if command fails to run (#20659)
Release Notes:

- N/A
2024-11-14 14:44:32 +01:00
Thorsten Ball
35798212c4 Update copilot to Copilot.vim 1.41.0 (#20520)
Release Notes:

- Update Copilot's underlying version to [Copilot.vim
1.41.0](8703812380)

Co-authored-by: Antonio <antonio@zed.dev>
2024-11-14 14:44:13 +01:00
Piotr Osiewicz
89f9a506f9 tasks: Add ability to query active toolchains for languages (#20667)
Closes #18649

Release Notes:

- Python tasks now use active toolchain to run.
2024-11-14 14:37:37 +01:00
Nate Butler
04ba75e2e5 Add ui::ContentGroup (#20666)
TL;DR our version of [HIG's
Box](https://developer.apple.com/design/human-interface-guidelines/boxes)

We can't use the name `Box` (because rust) or `ContentBox` (because
taffy/styles/css).

---

This PR introduces the `ContentGroup` component, a flexible container
inspired by HIG's `Box` component. It's designed to hold and organize
various UI elements with options to toggle borders and background fills.

**Example usage**:

```rust
ContentGroup::new()
    .flex_1()
    .items_center()
    .justify_center()
    .h_48()
    .child(Label::new("Flexible ContentBox"))
```

Here are some configurations:

- Default: Includes both border and fill.
- Borderless: No border for a clean look.
- Unfilled: No background fill for a transparent appearance.

**Preview**:

![CleanShot 2024-11-14 at 07 05
15@2x](https://github.com/user-attachments/assets/c838371e-e24f-46f0-94b4-43c078e8f14e)

---

_This PR was written by a large language model with input from the
author._

Release Notes:

- N/A
2024-11-14 08:25:48 -05:00
renovate[bot]
f7b4431659 Update Rust crate libc to v0.2.162 (#20625)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [libc](https://redirect.github.com/rust-lang/libc) |
workspace.dependencies | patch | `0.2.161` -> `0.2.162` |

---

### Release Notes

<details>
<summary>rust-lang/libc (libc)</summary>

###
[`v0.2.162`](https://redirect.github.com/rust-lang/libc/releases/tag/0.2.162)

[Compare
Source](https://redirect.github.com/rust-lang/libc/compare/0.2.161...0.2.162)

##### Added

- Android: fix the alignment of `uc_mcontext` on arm64
[#&#8203;3894](https://redirect.github.com/rust-lang/libc/pull/3894)
- Apple: add `host_cpu_load_info`
[#&#8203;3916](https://redirect.github.com/rust-lang/libc/pull/3916)
- ESP-IDF: add a time flag
[#&#8203;3993](https://redirect.github.com/rust-lang/libc/pull/3993)
- FreeBSD: add the `CLOSE_RANGE_CLOEXEC`
flag[#&#8203;3996](https://redirect.github.com/rust-lang/libc/pull/3996)
- FreeBSD: fix test errors regarding `__gregset_t`
[#&#8203;3995](https://redirect.github.com/rust-lang/libc/pull/3995)
- FreeBSD: fix tests on x86 FreeBSD 15
[#&#8203;3948](https://redirect.github.com/rust-lang/libc/pull/3948)
- FreeBSD: make `ucontext_t` and `mcontext_t` available on all
architectures
[#&#8203;3848](https://redirect.github.com/rust-lang/libc/pull/3848)
- Haiku: add `getentropy`
[#&#8203;3991](https://redirect.github.com/rust-lang/libc/pull/3991)
- Illumos: add `syncfs`
[#&#8203;3990](https://redirect.github.com/rust-lang/libc/pull/3990)
- Illumos: add some recently-added constants
[#&#8203;3999](https://redirect.github.com/rust-lang/libc/pull/3999)
- Linux: add `ioctl` flags
[#&#8203;3960](https://redirect.github.com/rust-lang/libc/pull/3960)
- Linux: add epoll busy polling parameters
[#&#8203;3922](https://redirect.github.com/rust-lang/libc/pull/3922)
- NuttX: add `pthread_[get/set]name_np`
[#&#8203;4003](https://redirect.github.com/rust-lang/libc/pull/4003)
- RTEMS: add `arc4random_buf`
[#&#8203;3989](https://redirect.github.com/rust-lang/libc/pull/3989)
- Trusty OS: add initial support
[#&#8203;3942](https://redirect.github.com/rust-lang/libc/pull/3942)
- WASIp2: expand socket support
[#&#8203;3981](https://redirect.github.com/rust-lang/libc/pull/3981)

##### Fixed

- Emscripten: don't pass `-lc`
[#&#8203;4002](https://redirect.github.com/rust-lang/libc/pull/4002)
- Hurd: change `st_fsid` field to `st_dev`
[#&#8203;3785](https://redirect.github.com/rust-lang/libc/pull/3785)
- Hurd: fix the definition of `utsname`
[#&#8203;3992](https://redirect.github.com/rust-lang/libc/pull/3992)
- Illumos/Solaris: fix `FNM_CASEFOLD` definition
[#&#8203;4004](https://redirect.github.com/rust-lang/libc/pull/4004)
- Solaris: fix all tests
[#&#8203;3864](https://redirect.github.com/rust-lang/libc/pull/3864)

##### Other

- CI: Add loongarch64
[#&#8203;4000](https://redirect.github.com/rust-lang/libc/pull/4000)
- CI: Check that semver files are sorted
[#&#8203;4018](https://redirect.github.com/rust-lang/libc/pull/4018)
- CI: Re-enable the FreeBSD 15 job
[#&#8203;3988](https://redirect.github.com/rust-lang/libc/pull/3988)
- Clean up imports and `extern crate` usage
[#&#8203;3897](https://redirect.github.com/rust-lang/libc/pull/3897)
- Convert `mode_t` constants to octal
[#&#8203;3634](https://redirect.github.com/rust-lang/libc/pull/3634)
- Remove the `wasm32-wasi` target that has been deleted upstream
[#&#8203;4013](https://redirect.github.com/rust-lang/libc/pull/4013)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 12:07:38 +02:00
renovate[bot]
6b9eba2109 Update Rust crate linkme to v0.3.31 (#20626)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [linkme](https://redirect.github.com/dtolnay/linkme) | dependencies |
patch | `0.3.29` -> `0.3.31` |

---

### Release Notes

<details>
<summary>dtolnay/linkme (linkme)</summary>

###
[`v0.3.31`](https://redirect.github.com/dtolnay/linkme/releases/tag/0.3.31)

[Compare
Source](https://redirect.github.com/dtolnay/linkme/compare/0.3.30...0.3.31)

- Prevent `ref_option_ref` pedantic clippy lint from triggering inside
generated code
([#&#8203;103](https://redirect.github.com/dtolnay/linkme/issues/103))
- Implement Debug for DistributedSlice
([#&#8203;105](https://redirect.github.com/dtolnay/linkme/issues/105))

###
[`v0.3.30`](https://redirect.github.com/dtolnay/linkme/releases/tag/0.3.30)

[Compare
Source](https://redirect.github.com/dtolnay/linkme/compare/0.3.29...0.3.30)

- Support Rust 2024 edition
([#&#8203;102](https://redirect.github.com/dtolnay/linkme/issues/102))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 12:07:27 +02:00
renovate[bot]
58e3b788dc Update Rust crate mdbook to v0.4.42 (#20629)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mdbook](https://redirect.github.com/rust-lang/mdBook) | dependencies
| patch | `0.4.40` -> `0.4.42` |

---

### Release Notes

<details>
<summary>rust-lang/mdBook (mdbook)</summary>

###
[`v0.4.42`](https://redirect.github.com/rust-lang/mdBook/blob/HEAD/CHANGELOG.md#mdBook-0442)

[Compare
Source](https://redirect.github.com/rust-lang/mdBook/compare/v0.4.41...v0.4.42)


[v0.4.41...v0.4.42](https://redirect.github.com/rust-lang/mdBook/compare/v0.4.41...v0.4.42)

##### Fixed

-   Fixed chapter list folding.
[#&#8203;2473](https://redirect.github.com/rust-lang/mdBook/pull/2473)

###
[`v0.4.41`](https://redirect.github.com/rust-lang/mdBook/blob/HEAD/CHANGELOG.md#mdBook-0441)

[Compare
Source](https://redirect.github.com/rust-lang/mdBook/compare/v0.4.40...v0.4.41)


[v0.4.40...v0.4.41](https://redirect.github.com/rust-lang/mdBook/compare/v0.4.40...v0.4.41)

**Note:** If you have a custom `index.hbs` theme file, you will need to
update it to the latest version.

##### Added

-   Added preliminary support for Rust 2024 edition.
[#&#8203;2398](https://redirect.github.com/rust-lang/mdBook/pull/2398)
-   Added a full example of the remove-emphasis preprocessor.
[#&#8203;2464](https://redirect.github.com/rust-lang/mdBook/pull/2464)

##### Changed

-   Adjusted styling of clipboard/play icons.
[#&#8203;2421](https://redirect.github.com/rust-lang/mdBook/pull/2421)
-   Updated to handlebars v6.
[#&#8203;2416](https://redirect.github.com/rust-lang/mdBook/pull/2416)
-   Attr and section rules now have specific code highlighting.
[#&#8203;2448](https://redirect.github.com/rust-lang/mdBook/pull/2448)
- The sidebar is now loaded from a common file, significantly reducing
the book size when there are many chapters.
[#&#8203;2414](https://redirect.github.com/rust-lang/mdBook/pull/2414)
-   Updated dependencies.
[#&#8203;2470](https://redirect.github.com/rust-lang/mdBook/pull/2470)

##### Fixed

-   Improved theme support when JavaScript is disabled.
[#&#8203;2454](https://redirect.github.com/rust-lang/mdBook/pull/2454)
-   Fixed broken themes when localStorage has an invalid theme id.
[#&#8203;2463](https://redirect.github.com/rust-lang/mdBook/pull/2463)
- Adjusted the line-height of superscripts (and footnotes) to avoid
adding extra space between lines.
[#&#8203;2465](https://redirect.github.com/rust-lang/mdBook/pull/2465)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 12:07:17 +02:00
renovate[bot]
9fd971d8c9 Update Rust crate pulldown-cmark to v0.12.2 (#20630)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pulldown-cmark](https://redirect.github.com/raphlinus/pulldown-cmark)
| workspace.dependencies | patch | `0.12.1` -> `0.12.2` |

---

### Release Notes

<details>
<summary>raphlinus/pulldown-cmark (pulldown-cmark)</summary>

###
[`v0.12.2`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.12.2):
0.12.2

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.12.1...v0.12.2)

#### What's Changed

- Fix compiilation error in fuzzers by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/947](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/947)
- Make `fuzz` dir part of the workspace by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/948](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/948)
- Fix and improve `bench` by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/950](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/950)
- Reuse a couple hash maps across blocks by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/951](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/951)
- Reuse outer indent between item list, def list, and blockquote by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/952](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/952)
- Add instructions on fixing fuzz build by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/953](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/953)
- Account for definition list fixups while popping containers by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/954](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/954)
- Use byte range instead of char count for delim run bounds by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/956](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/956)
- CI improvements by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/955](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/955)
- Fix a problem that causes multiple dt's to be parsed by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/958](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/958)
- fix: emit `InlineHtml` for inline HTML inside blockquote instead of
`Html` by [@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/961](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/961)
- Complete the list of block item bodies by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/962](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/962)
- Implement into_static for CowStr and Event in pulldown-cmark by
[@&#8203;Atreyagaurav](https://redirect.github.com/Atreyagaurav) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/967](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/967)
- Enforce cargo fmt by
[@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/971](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/971)
- Respect line starts when trimming header endings by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/969](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/969)

#### New Contributors

- [@&#8203;Atreyagaurav](https://redirect.github.com/Atreyagaurav) made
their first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/967](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/967)

**Full Changelog**:
https://github.com/pulldown-cmark/pulldown-cmark/compare/v0.12.1...v0.12.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 12:07:03 +02:00
renovate[bot]
cf7679e6a0 Update Rust crate clap to v4.5.21 (#20620)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [clap](https://redirect.github.com/clap-rs/clap) |
workspace.dependencies | patch | `4.5.20` -> `4.5.21` |

---

### Release Notes

<details>
<summary>clap-rs/clap (clap)</summary>

###
[`v4.5.21`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4521---2024-11-13)

[Compare
Source](https://redirect.github.com/clap-rs/clap/compare/v4.5.20...v4.5.21)

##### Fixes

- *(parser)* Ensure defaults are filled in on error with
`ignore_errors(true)`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 11:12:14 +02:00
renovate[bot]
07c0c54c28 Update Rust crate anyhow to v1.0.93 (#20619)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anyhow](https://redirect.github.com/dtolnay/anyhow) |
workspace.dependencies | patch | `1.0.91` -> `1.0.93` |

---

### Release Notes

<details>
<summary>dtolnay/anyhow (anyhow)</summary>

###
[`v1.0.93`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.93)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.92...1.0.93)

-   Update dev-dependencies to `thiserror` v2

###
[`v1.0.92`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.92)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.91...1.0.92)

- Support Rust 1.82's `&raw const` and `&raw mut` syntax inside
`ensure!`
([#&#8203;390](https://redirect.github.com/dtolnay/anyhow/issues/390))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-14 11:11:52 +02:00
Max Brunsfeld
093c9cc87b Avoid creating occlusions for editor blocks, since these block mouse wheel events (#20649)
Just block mouse down events, and in the case of the inline assist
prompt, set the default cursor.

Release Notes:

- N/A

Co-authored-by: Richard <richard@zed.dev>
2024-11-13 21:02:54 -08:00
Bret Comnes
6b3c909155 Clarify rustup is requried (#20642)
Clarify that rustup is required to build developer extensions. Developer
extensions fail silently to the logs because rustup isn't found, even
when rust is installed.

Release Notes:

- N/A
2024-11-13 17:20:20 -08:00
Conrad Irwin
7e349e52b1 Don't try and run on armv5/6/7 (#20618)
Updates: #20523

Release Notes:

- SSH Remoting: correctly show an error when SSH'ing into a 32-bit arm
system
2024-11-13 16:18:53 -07:00
Max Brunsfeld
84d17fb191 Fix completions for non-built-in slash commands (#20632)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-11-13 15:11:50 -08:00
Max Brunsfeld
d3d408d47d Improve context server lifecycle management (#20622)
This optimizes and fixes bugs in our logic for maintaining a set of
running context servers, based on the combination of the user's
`context_servers` settings and their installed extensions.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-11-13 13:55:06 -08:00
Conrad Irwin
6e477bbf56 Don't double-localize menu shortcuts (#20623)
Release Notes:

- Don't have macOS localize our menu shortcuts that we already
localized.
2024-11-13 13:56:56 -07:00
Conrad Irwin
3c2dcf50fa Don't send key equivalents to the input hanlder (#20621)
Release Notes:

- Fix `cmd-backtick` to change windows
2024-11-13 13:42:31 -07:00
David Soria Parra
a15f408f0c anthropic: Remove stable headers (#20595)
The tool and context length headers are now stable and no longer needed.

Release Notes:

- N/A
2024-11-13 15:04:37 -05:00
Axel Carlsson
b1cd9e4d24 vim: Add support for temporary normal mode (ctrl-o) within insert mode (#19454)
Support has been added for the ctrl-o command within insert mode. Ctrl-o
is used to partially enter normal mode for 1 motion to then return back
into insert mode.

Release Notes:

- vim: Added support for `ctrl-o` in insert mode to enter temporary
normal mode

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-11-13 12:44:41 -07:00
Marshall Bowers
254ce74036 Extract ExtensionSlashCommand to assistant_slash_command crate (#20617)
This PR extracts the `ExtensionSlashCommand` implementation to the
`assistant_slash_command` crate.

The slash command related methods have been added to the `Extension`
trait. We also create separate data types for the slash command data
within the `extension` crate so that we can talk about them without
depending on the `extension_host` or `assistant_slash_command`.

Release Notes:

- N/A
2024-11-13 14:34:58 -05:00
Kyle Kelley
b913cf2e02 Allow base64 encoded images to be decoded with or without padding (#20616)
The R kernel doesn't use base64 padding whereas the Python kernel (via
matplotlib) sometimes uses padding. We have to use the `base64` crate's
`Indifferent` mode.

/cherry-pick v0.161.x

Release Notes:

- N/A
2024-11-13 11:26:42 -08:00
Antonio Scandurra
92613a8904 Use replace blocks for patches (#20605)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
2024-11-13 18:55:23 +01:00
Conrad Irwin
96deabfb78 Deadkeys 2 (#20612)
Re-land of #20515 with less brokenness

In particular it turns out that for control, the .characters() method
returns the control code. This mostly didn't make a difference, except
when the control code matched tab/enter/escape (for
ctrl-y,ctrl-[/ctrl-c) as we interpreted the key incorrectly.

Secondly, we were setting IME key too aggressively. This led to (in vim
mode) cmd-shift-{ being interpreted as [, so vim would wait for a second
[ before letting you change tab.

Release Notes:

- N/A
2024-11-13 10:42:08 -07:00
Peter Tripp
ad31aacb7a Fix bad quote in script/determine-release-channel (#20613) 2024-11-13 12:41:50 -05:00
Marshall Bowers
a04c2ecff7 Decouple extension Worktree resource from LspAdapterDelegate (#20611)
This PR decouples the extension `Worktree` resource from the
`LspAdapterDelegate`.

We now have a `WorktreeDelegate` trait that corresponds to the methods
on the resource.

We then create a `WorktreeDelegateAdapter` that can wrap an
`LspAdapterDelegate` and implement the `WorktreeDelegate` trait.

Release Notes:

- N/A
2024-11-13 12:24:27 -05:00
Joseph T. Lyons
f96b29ca54 v0.163.x dev 2024-11-13 11:47:52 -05:00
Danilo Leal
9d2fc691de project panel: Don't change label color even when file has errors (#20600)
With this PR, Git status is now the only thing that can change an item's
label color. So, the summary of how status colors operate in the project
panel is:

- Item icon color is, by default, never changed, _not_ affected by
either diagnostics or Git status
  - This should become configurable in the near future, though
- However, a little x or triangle icon shows up on top of the file type
icon to display diagnostics status
- Label color is _not_ affected by diagnostics but it _is_ affected by
Git status

This aims to reduce color noise and clarify/simplify how each element is
affected.

Release Notes:

- N/A
2024-11-13 13:35:20 -03:00
Marshall Bowers
b084d53f8e Extract ExtensionIndexedDocsProvider to indexed_docs crate (#20607)
This PR extracts the `ExtensionIndexedDocsProvider` implementation to
the `indexed_docs` crate.

To achieve this, we introduce a new `Extension` trait that provides an
abstracted interface for calling an extension. This trait resides in the
`extension` crate, which has minimal dependencies and can be depended on
by other crates, like `indexed_docs`.

We're then able to implement the `ExtensionIndexedDocsProvider` without
having any knowledge of the Wasm-specific internals of the extension
system.

Release Notes:

- N/A
2024-11-13 11:19:55 -05:00
Askar
7832883c74 terminal: Fix detection of ignored python venv (#20227)
Closes #19227

Since items listed in `.gitignore` file are not included in a worktree,
python virtual environment cannot be detected until venv directory is
unfolded from project panel and forcefully added into worktree. I didn't
come up with anything better than scanning fs directly. I'm not sure how
it will affect remote development. if at all.

Release Notes:

- Fixed detection of `detect_venv.directories` ignored by a worktree
2024-11-13 17:19:25 +01:00
Peter Tripp
eb4e7472e6 Improve terminal.working_directory for non-project files (#18251) 2024-11-13 10:40:36 -05:00
Thorsten Ball
27dfb48a7b project panel: Fix entries being marked when switching between tabs (#20596)
This is a follow-up (or related to) #20412.

It fixes entries being marked when navigating between tabs with `cmd-[`
and `cmd-]`.

Turns out that deep in the bowels of the project panel, we check whether
a `shift` modifier was pressed - which is the case with `cmd-[` on a US
ANSI layout - and if so mark an entry.

I think that's a left-over, because all the other code paths that
select/reveal an entry mark it explicitly too.

Release Notes:

- Fixed entries in project panel being marked when navigating between
tabs with keybinding that uses `shift` modifier.
2024-11-13 15:32:19 +01:00
Peter Tripp
3a319e6cbe docs: Improve formatter docs. Examples for C/C++ (#20553) 2024-11-13 09:24:50 -05:00
Kirill Bulatov
84e47fb80b Fix context menus not cycling over its edge when selecting items (#20592) 2024-11-13 15:14:23 +01:00
Kirill Bulatov
7e82ca8082 Always allow rerunning the tasks using the tab button (#20591)
Release Notes:

- Improved task tabs to always rerun tasks on click
2024-11-13 14:57:30 +01:00
Danilo Leal
b44078781d Standardize button design in modal footers (#20585)
- Making sure this design and properties are the same across different
places
- No need for the `ButtonLike` here, we can use `Button` as it supports
`key_binding` and makes it for a cleaner code!
- Also, that ensures the binding is always to the right of the label,
which makes more sense
- Title-case the labels for consistency with other buttons across the
app

| File finder | Project finder |
|--------|--------|
| <img width="1136" alt="Screenshot 2024-11-13 at 09 21 06"
src="https://github.com/user-attachments/assets/dd051514-d873-4b65-a08f-af0920f2c010">
| <img width="1136" alt="Screenshot 2024-11-13 at 09 21 12"
src="https://github.com/user-attachments/assets/f958e3e7-4bfb-4752-839e-2bbc01334643">
|

Release Notes:

- N/A
2024-11-13 09:36:08 -03:00
Piotr Osiewicz
3b1f12af75 chore: Cleanup dev_server_projects leftover files (#20581)
Closes #ISSUE

Release Notes:

- N/A
2024-11-13 13:04:12 +01:00
Piotr Osiewicz
b8cf0a1ed1 chore: use codegen-units=1 for small crates (#20558)
These 500ms we'll save with this change will surely pay off.

Release Notes:

- N/A
2024-11-13 12:51:30 +01:00
Kirill Bulatov
3f224274da Restore the ability to navigate into project search input with the keyboard (#20579) 2024-11-13 12:45:30 +01:00
Kirill Bulatov
56cf32cb91 Add a way to use splits when opening in file finder (#20507) 2024-11-13 11:58:42 +01:00
Markus Wüstenberg
90ffd65a10 Document use of allow_concurrent_runs with long-running tasks (#20539) 2024-11-13 09:43:17 +01:00
Max Brunsfeld
55cd99cdc4 Revert "macOS: Improve deadkeys (#20515)" (#20570)
This reverts commit https://github.com/zed-industries/zed/pull/20515

I'm reverting for now to fix issues with key bindings on Nightly:
* `ctrl-c` and `ctrl-m` are being treated as `ctrl-enter`
* `ctrl-[` isn't working in vim mode
* there's a delay before `cmd-shift-[` switches tabs w/ vim mode enabled

Release Notes:

- N/A
2024-11-12 22:32:14 -08:00
Kyle Kelley
0547748c48 Compare explicitly to YES/NO instead relying on booliness for objc (#20567)
Just x86_64-apple-darwin things. Fixes the build for nightly.

Release Notes:

- N/A
2024-11-12 18:35:58 -08:00
Kyle Kelley
54735199a4 Be more explicit about BOOL (#20564)
On x86 Macs BOOL is not the same within the `objc` crate we're using.
This only comes up on nightly builds (not on CI), so I don't think I
have a way to trigger this issue locally.

Release Notes:

- N/A
2024-11-12 18:01:32 -08:00
Kyle Kelley
466d3316a0 Fix issue with image output from Jupyter kernels that didn't use base64 padding (#20561)
This upgrades `nbformat` and `runtimelib` to handle jupyter types with
even more validation and flexiblity. This also processes any multiline
string data coming from the kernel, including with image data (like
`image/png`). While I was at it I also fixed a longstanding issue around
images by eliminating all whitespace (something `atob` does) and using
the no pad decoder.

Fixes: #17956

Before:

<img width="741" alt="image"
src="https://github.com/user-attachments/assets/37ec2cae-ce78-4475-aaa3-4d785e4015d0">

After:

<img width="727" alt="image"
src="https://github.com/user-attachments/assets/e2431ba2-048b-4205-9898-54f357795a9c">


Release Notes:

- Fixed issue with image output from REPL kernels that didn't use base64
padding
2024-11-12 16:25:49 -08:00
Marshall Bowers
3ebb64ea1d Expose context server settings to extensions (#20555)
This PR exposes context server settings to extensions.

Extensions can use `ContextServerSettings::for_project` to get the
context server settings for the current project.

The `experimental.context_servers` setting has been removed and replaced
with the `context_servers` setting (which is now an object instead of an
array).

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-11-12 17:21:58 -05:00
Nils Koch
0a9c78a58d Show error and warning indicators in project panel items (#18182)
Closes #5016

Release Notes:

- Add setting to display error and warning indicators in project panel
items.


https://github.com/user-attachments/assets/8f8031e6-ca47-42bf-a7eb-718eb1067f36

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2024-11-12 18:58:59 -03:00
Danilo Leal
a7eb3a9b9f Add "Book Onboarding" action across the app (#20503)
This PR adds a small UI touch-up to the welcome page so we can introduce
the "Book Onboarding" over there, as well as adding it to the user menu
(both in the signed in and signed out states). The actual URL these
buttons take to will still be updated to the correct destination.

<img width="700" alt="Screenshot 2024-11-12 at 12 45 27"
src="https://github.com/user-attachments/assets/9933bf94-f57a-43e2-8da3-bfbfd9fd24d0">

Release Notes:

- N/A
2024-11-12 18:41:20 -03:00
Conrad Irwin
47ca3401ce Disable ligatures in SSH connection dialogue (#20549)
Closes #20381

Release Notes:

- Fixed password dialog for remote server showing ligatures
2024-11-12 11:33:22 -07:00
Piotr Osiewicz
d1e2c6e657 python: Add pylsp as the secondary language server (#20358)
Closes #ISSUE

Release Notes:

- Added python-lsp-server as a secondary built-in language server.
2024-11-12 17:23:40 +01:00
Arthur Brussee
181c3724aa windows: Fix rust-analyzer download (#20408)
After https://github.com/rust-lang/rust-analyzer/pull/18412, there is no
longer a .gz file for windows rust-analyzer targets, and the rust
analyzer LSP fails to download. This fixes it by using the .zip version
on windows.

The .zip also extracts to a _folder_ containing rust-analyzer.exe rather
than just a file. I've handled it in this code, but am not 100% sure if
other parts of the code need too be aware of it.

Release Notes:

- N/A
2024-11-12 12:52:52 +01:00
Michael Sloan
aad3ed7f91 Fix window drawing when switching X11 workspaces by presenting when expose events occur (#20535)
Closes #18184

Release Notes:

- Fix window drawing when switching X11 workspaces, particularly for tiling window managers such as i3wm and XMonad.
2024-11-12 01:20:25 -07:00
Conrad Irwin
ad3171d16d Expose active key equivalents in the keymap context view (#20530)
Release Notes:

- Added macOS key equivalents to cmd-shift-p `debug: Open Key Context
View`
2024-11-11 23:04:15 -07:00
Conrad Irwin
e4bf586cff SSH Remoting: Improve unsupported error messages (#20529)
Updates #19697

Release Notes:

- SSH Remoting: Improved error message on unsupported OS/Arch.
2024-11-11 22:26:05 -07:00
Michael Sloan
ab20681818 Use char level diff for Rewrap action for cursor preservation + not reinserting all text (#20368)
Closes #18896

Release Notes:

- Fixed #18896 - `editor::Rewrap` now preserves cursors and only inserts
whitespace by using character-level diff instead of line-level diff.
2024-11-11 22:24:04 -07:00
ifsheldon
6819108bcb Bump rustls and async-tungstenite to remove child dep ring 0.16.20 (#20489)
Closes #18891 

Tests:
- I have cargo checked and built `remote-server` on my riscv64 dev
board.
- I have cargo checked and tested on my M1 Mac
- Almost all test passed. Some (LLM tests, Postgres tests)failed due to,
IMO, irrelevant reasons

Release Notes:

- Improved support of Zed remote server compilation for riscv64

cc @ConradIrwin 

PS: I didn't include the changes of `Cargo.lock`, which may look messy.
Probably I should include these? Or, should a reviewer do this? The
expected Cargo.lock should have only one version of `ring` with version
> 0.17.0
2024-11-11 21:29:55 -07:00
Michael Sloan
2521ef7bc4 Document why join_lines has a special case for single-line selections (#20528)
Release Notes:

- N/A
2024-11-11 21:28:26 -07:00
Michael Sloan
b08ac2ae3e Heaptrack documentation (#20266)
Release Notes:

- N/A
2024-11-11 21:03:46 -07:00
Conrad Irwin
2ea4ede08e macOS: Improve deadkeys (#20515)
Closes #19738

This change refactors how we handle input on macOS to avoid simulating
our own IME. This fixes a number of small edge-cases, and also lets us
remove a bunch of code that had been added to work around bugs in the
previous version.

Release Notes:

- On macOS: Keyboard shortcuts are now handled before activating the IME
system, this enables using vim's default mode on keyboards that use IME
menus (like Japanese).
- On macOS: Improvements to handling of dead-keys. For example when
typing `""` on a Brazillian keyboard, you now get a committed " and a
new marked ", as happens in other apps. Also, you can now type cmd-^ on
an AZERTY keyboard for indent; and ^ on a QWERTZ keyboard now goes to
the beginning of line in vim normal mode, or `d i "` no requires no
space to delete within quotes on Brazilian keyboards (though `d f "
space` is still required as `f` relies on the input handler, not a
binding).
- On macOS: In the terminal pane, holding down a key will now repeat
that key (as happens in iTerm2) instead of opening the character
selector.
2024-11-11 16:34:36 -07:00
Kirill Bulatov
38f2a919f8 Fix default project panel autofold docs (#20517)
Closes https://github.com/zed-industries/zed/issues/20511

Release Notes:

- N/A
2024-11-11 23:47:48 +01:00
Danilo Leal
82427e1ffb Add new DecoratedIcon component (#20516)
This PR creates a new, revamped `DecoratedIcon` component that enables
using different SVGs, one for the knockout background and another for
the actual icon. That's different than what we were doing before—copying
the SVG and using slightly different positioning—because we wanted to
unlock an aligned knockout effect, which was particularly hard to do
with non-simple shapes such as an X.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <1714999+iamnbutler@users.noreply.github.com>
2024-11-11 19:09:02 -03:00
Max Brunsfeld
149e5fde36 Don't try to make project search and outline order match project panel (#20513)
A straight alphabetical order is arguably clearer, and avoids a large
initial delay when searching large repos.

Release Notes:

- Fixed a long initial delay when performing a project search in a large
repository.
2024-11-11 12:20:04 -08:00
Kyle Kelley
97b542b22a Discover available python environments with Jupyter kernel support (#20467)
![image](https://github.com/user-attachments/assets/7c042bc9-88be-4d7b-b63d-e5b555d54b18)

Closes #18291
Closes #16757
Closes #15563

Release Notes:

- Added support for kernelspecs based on python environments
2024-11-11 10:19:05 -08:00
Nate Butler
6152230152 Fix DynamicSpacing docs (#20509)
In #20504 the CustomSpacing enum variants ended up not having docs. This
PR fixes that, now docs correctly show for variants.


https://github.com/user-attachments/assets/8cc409c9-7b71-4c21-a538-3fd5dded3e00

Release Notes:

- N/A
2024-11-11 12:58:39 -05:00
Caleb Heydon
a47759fd03 Add initial FreeBSD support (#20480)
This PR adds initial support for FreeBSD
(https://github.com/zed-industries/zed/issues/15309). While there is
still work left to be done, it seems to be usable. As discussed by
@syobocat (https://github.com/zed-industries/zed/discussions/10247), the
changes were just adding ```target_os = "freebsd"``` to wherever it
checks if the OS is Linux.


![image](https://github.com/user-attachments/assets/80ea5b29-047f-4cbd-8263-42e5fa6c94b7)

Needs to be build with ```RUSTFLAGS="-C link-dead-code"```

Known Issues:
- There's an issue in ```crates/project/src/environment.rs``` where a
command fails because ```/bin/sh``` on FreeBSD doesn't support the
```-l``` option.

![image](https://github.com/user-attachments/assets/c3c38633-160f-4f47-8840-e3da67f6ebc8)
- The file/folder choosers provided by the ```ashpd``` crate don't work
on FreeBSD (at least with KDE). This isn't that bad since a fallback
dialog is used.

![image](https://github.com/user-attachments/assets/29373006-1eb9-4ed0-bd52-2d0047fab418)
 - Moving to trash won't work.
- Numerous tests fail (when running on FreeBSD). While I haven't looked
into this much, it appears that the corresponding features seem to work
fine.

Release Notes:

- Added initial support for FreeBSD
2024-11-11 18:39:05 +01:00
Michael Sloan
b5da1198f5 Refactor rewrap test to use a test utility (#20424)
Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-11-11 10:15:58 -07:00
Thorsten Ball
ba743a1bd9 Add setting to disable inline completions in language scopes (#20508)
This adds a setting to disable inline completions in language scopes to,
for example, disable them in comments or strings.

This setting can be made per language.

Examples:

```json
{
  "languages": {
    "Go": {
      "inline_completions_disabled_in": ["comment", "string"]
    }
  }
}
```

```json
{
  "inline_completions_disabled_in": ["comment"]
}
```

Closes #9133

Release Notes:

- Added language setting to disable inline comments in certain scopes.
Example: `{"languages": {"Go": {"inline_completions_disabled_in":
["comment", "string"]}}}`

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 18:09:05 +01:00
Thorsten Ball
9e7afe870a tailwind: Allow configuring the rootFontSize (#20500)
This addresses this comment:
https://github.com/zed-industries/zed/pull/13923#issuecomment-2467213210

With the change in here it's now possible to use the following settings:

```json
{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "rootFontSize": 50
      }
    }
  }
}
```

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

Release Notes:

- Added ability to configure `rootFontSize` for the
`tailwindcss-language-server`. Example settings: `{"lsp":
{"tailwindcss-language-server": {"settings": { "rootFontSize": 50}}}}`

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 17:13:00 +01:00
Nate Butler
94d8ead270 Refactor Spacing into DynamicSpacing using proc macro (#20504)
Density tracking issue: #18078 

This PR refactors our spacing system to use a more flexible and
maintainable approach. We've replaced the static `Spacing` enum with a
dynamically generated `DynamicSpacing` enum using a proc macro.

Enum variants now use a `BaseXX` format, where XX = the pixel value @
default rem size and the default UI density.

For example:

`CustomSpacing::Base16` would return 16px at the default UI scale &
density.

I'd love to find another name other than `Base` that is clear (to avoid
base_10, etc confusion), let me know if you have any ideas!

Changes:

- Introduced a new `derive_dynamic_spacing` proc macro to generate the
`DynamicSpacing` enum
- Updated all usages of `Spacing` to use the new `DynamicSpacing`
- Removed the `custom_spacing` function, mapping previous usages to
appropriate `DynamicSpacing` variants
- Improved documentation and type safety for spacing values

New usage example:

```rust
.child(
    div()
        .flex()
        .flex_none()
        .m(DynamicSpacing::Base04.px(cx))
        .size(DynamicSpacing::Base16.rems(cx))
        .children(icon),
)
```

vs old usage example:

```
.child(
    div()
        .flex()
        .flex_none()
        .m(Spacing::Small.px(cx))
        .size(custom_spacing(px(16.)))
        .children(icon),
)
```

Release Notes:

- N/A
2024-11-11 11:08:55 -05:00
Thorsten Ball
93ab6ad922 logs: Reduce log noise by using more debug logs (#20498)
Release Notes:

- N/A
2024-11-11 15:11:20 +01:00
Piotr Osiewicz
45bbfe077a python: Fix toolchains not getting picked up after workspace deserialization (#20488)
Closes #20476

Release Notes:

- Fixed a bug in toolchain selector that caused it to not pick up venvs
for tabs before user interacted with them.
- Fixed a bug in language selector that caused it to pick up Markdown as
the language for a buffer up until the tab was interacted with.
2024-11-11 14:35:01 +01:00
Thorsten Ball
be8cc1146a language server logs: Fix missing menu entries when using remoting (#20495)
This fixes the language server log menu only showing a single entry when
using SSH remoting.

Culprit was the `return menu;` statement that should've been a
`continue;`

Rest of the change is just refactoring.

Release Notes:

- Fixed `language server logs` menu only showing a single entry when
using SSH remoting.

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 11:26:00 +01:00
Thorsten Ball
a97ab5eb3d language servers: Fix wrong language server name (#20428)
This fixes the issue of multiple language servers showing up as `node`
in the language server logs dropdown.

It does this by changing `language_server.name()` to return the
adapter's name, not the binary name, and changing types to make sure
that we always use this.

Release Notes:

- Fixed language server names showing up only as `"node"`

---------

Co-authored-by: Sam Rose <hello@samwho.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 10:18:38 +01:00
Kirill Bulatov
f4024cc602 Fix excerpt jumps using selections, not the match data (#20491)
Fixes
https://github.com/zed-industries/zed/pull/20469#issuecomment-2466805325

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 10:17:32 +01:00
Maksim Bondarenkov
1460249a70 docs: Update msys2 section (#20478)
now Zed is available in MINGW64 repository as well

Release Notes:

- N/A
2024-11-10 18:24:28 +01:00
Adam Wolff
da7670cd6f assistant: Track completions for each CodegenAlternative (#19999)
Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-11-10 17:22:24 +01:00
Joseph T. Lyons
ebdc255b73 Add additional instructions to issue templates (#20473)
Release Notes:

- N/A
2024-11-10 08:34:23 -05:00
Bennet Bo Fenner
4d49a851ef image viewer: Ensure images can never be loaded twice (#20472)
Follow up to #20374, this prevents a race condition where we could load
images twice.

Release Notes:

- N/A
2024-11-10 13:17:19 +01:00
Will Bradley
0dbda71423 Enable reload of images in image viewer (#20374)
Closes #11529

Release Notes:

- Fixed an issue where the image preview would not update when the
underlying file changed

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-10 11:37:02 +01:00
Piotr Osiewicz
f3320998a8 lsp: Track completion triggers for each language separately (#20471)
This PR improves how we handle completions in buffers with multiple
LSPs.

Context: while working on
https://github.com/zed-industries/zed/issues/19777 with @mgsloan we
noticed that completion triggers coming from language servers are not
tracked properly. Namely, each buffer has `completion_triggers` field
which is read from the configuration of a language server. The problem
is, there can be multiple language servers for a single buffer, in which
case we'd just stick to the one that was registered last.

This PR makes the tracking a bit more fine-grained. We now track not
only what the completion triggers are, but also their origin server id.
Whenever completion triggers are updated, we recreate the completion
triggers set.
Release Notes:

- Fixed completions not triggering when multiple language servers are
used for a single file.
2024-11-10 10:29:10 +01:00
Kirill Bulatov
2b7ee1e872 Debounce runnable refreshes in the editor (#20470) 2024-11-10 11:06:22 +02:00
Kirill Bulatov
767a82527a Open all kinds of files from multi buffers' headers (#20469)
Closes https://github.com/zed-industries/zed/issues/11661

Release Notes:

- Fixed multi buffer headers not able to jump to untitled files
2024-11-10 09:03:11 +01:00
Antar
ba8f027c18 editor: Fix toggle_comment in readonly mode (#20464)
Closes #20459

Release Notes:

- Fixed comments toggle in readonly mode
2024-11-10 08:47:30 +01:00
Nate Butler
0a28800049 Add preview for Checkbox with Label (#20448)
Add previews for Checkbox with Label.

Merge checkbox components.

Release Notes:

- N/A
2024-11-08 22:53:15 -05:00
Nate Butler
31a6ee0229 Add ui::table (#20447)
This PR adds the `ui::Table` component.

It has a rather simple API, but cells can contain either strings or
elements, allowing for some complex uses.

Example usage:

```rust
Table::new(vec!["Product", "Price", "Stock"])
    .width(px(600.))
    .striped()
    .row(vec!["Laptop", "$999", "In Stock"])
    .row(vec!["Phone", "$599", "Low Stock"])
    .row(vec!["Tablet", "$399", "Out of Stock"])
```

For more complex use cases, the table supports mixed content:

```rust
Table::new(vec!["Status", "Name", "Priority", "Deadline", "Action"])
    .width(px(840.))
    .row(vec![
        element_cell(Indicator::dot().color(Color::Success).into_any_element()),
        string_cell("Project A"),
        string_cell("High"),
        string_cell("2023-12-31"),
        element_cell(Button::new("view_a", "View").style(ButtonStyle::Filled).full_width().into_any_element()),
    ])
    // ... more rows
```

Preview:

![CleanShot 2024-11-08 at 20 53
04@2x](https://github.com/user-attachments/assets/b39122f0-a29b-423b-8e24-86ab4c42bac2)

This component is pretty basic, improvements are welcome!

Release Notes:

- N/A
2024-11-08 21:10:15 -05:00
Kyle Kelley
1f974d074e Set up editor actions after workspace not on stack (#20445)
Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-11-08 17:11:43 -08:00
Elias Müller
72125949d9 Add shortcuts for 'open settings' and 'revert selected hunks' to Jetbrains keymap (#20414) 2024-11-08 19:34:52 -05:00
Kirill Bulatov
d605d192af Use a different keybinding for editor::AcceptPartialInlineCompletion action (Linux) (#20443)
Follow-up of https://github.com/zed-industries/zed/pull/20419

Release Notes:

- - (breaking change) Use `ctrl-right` instead of `cmd-right` as a macOS
default for `editor::AcceptPartialInlineCompletion` (Linux)
2024-11-09 01:38:18 +02:00
Marshall Bowers
f92e6e9a95 Add support for context server extensions (#20250)
This PR adds support for context servers provided by extensions.

To provide a context server from an extension, you need to list the
context servers in your `extension.toml`:

```toml
[context_servers.my-context-server]
```

And then implement the `context_server_command` method to return the
command that will be used to start the context server:

```rs
use zed_extension_api::{self as zed, Command, ContextServerId, Result};

struct ExampleContextServerExtension;

impl zed::Extension for ExampleContextServerExtension {
    fn new() -> Self {
        ExampleContextServerExtension
    }

    fn context_server_command(&mut self, _context_server_id: &ContextServerId) -> Result<Command> {
        Ok(Command {
            command: "node".to_string(),
            args: vec!["/path/to/example-context-server/index.js".to_string()],
            env: Vec::new(),
        })
    }
}

zed::register_extension!(ExampleContextServerExtension);
```

Release Notes:

- N/A
2024-11-08 16:39:21 -05:00
Conrad Irwin
ff4f67993b macOS: Add key equivalents for non-Latin layouts (#20401)
Closes  #16343
Closes #10972

Release Notes:

- (breaking change) On macOS when using a keyboard that supports an
extended Latin character set (e.g. French, German, ...) keyboard
shortcuts are automatically updated so that they can be typed without
`option`. This fixes several long-standing problems where some keyboards
could not type some shortcuts.
- This mapping works the same way as
[macOS](https://developer.apple.com/documentation/swiftui/view/keyboardshortcut(_:modifiers:localization:)).
For example on a German keyboard shortcuts like `cmd->` become `cmd-:`,
`cmd-[` and `cmd-]` become `cmd-ö` and `cmd-ä`. This mapping happens at
the time keyboard layout files are read so the keybindings are visible
in the command palette. To opt out of this behavior for your custom
keyboard shortcuts, set `"use_layout_keys": true` in your binding
section. For the mappings used for each layout [see
here](a890df1863/crates/settings/src/key_equivalents.rs (L7)).

---------

Co-authored-by: Will <will@zed.dev>
2024-11-08 13:05:10 -07:00
Conrad Irwin
07821083df macOS: Allow non-cmd keyboard shortcuts to work on non-Latin layouts (#20336)
Updates #10972

Release Notes:

- Fixed builtin keybindings that don't require cmd on macOS, non-Latin,
ANSI layouts. For example you can now use ctrl-ա (equivalent to ctrl-a)
on an Armenian keyboard to get to the beginning of the line.

---------

Co-authored-by: Will <will@zed.dev>
2024-11-08 11:49:13 -07:00
Marshall Bowers
09c599385a Put context servers behind a trait (#20432)
This PR puts context servers behind the `ContextServer` trait to allow
us to provide context servers from an extension.

Release Notes:

- N/A
2024-11-08 13:36:41 -05:00
Richard Feldman
01503511ad Fix line number whitespace (#20427)
Closes #14025


https://github.com/user-attachments/assets/24b3f321-8246-4203-9510-66a7cf3d22f0

Release Notes:

- Fixed bug where toggling line numbers would incorrectly hide
whitespace indicators.
2024-11-08 13:25:48 -05:00
Marshall Bowers
8bc5bcf0a6 assistant: Fix completions for slash commands provided by context servers (#20423)
This PR fixes an issue introduced in #20372 that was causing slash
commands provided by context servers to not show up in the completions
menu.

Release Notes:

- N/A
2024-11-08 11:35:39 -05:00
Kirill Bulatov
983bb5c5fc Use a different keybinding for editor::AcceptPartialInlineCompletion action (#20419)
Both `editor::AcceptPartialInlineCompletion` and the keybinding for
`editor::MoveToEndOfLine` had the same keybinding inside the editor, and
with Supermaven's fast proposals, it's been very frequently used
incorrectly.

Closes #ISSUE

Release Notes:

- (breaking change) Use `ctrl-right` instead of `cmd-right` as a macOS
default for `editor::AcceptPartialInlineCompletion`
2024-11-08 18:07:38 +02:00
Thorsten Ball
653b2dc676 project panel: Stop flickering border when preview tabs disabled (#20417)
PR #20154 changed the project panel to focus the editor on click in case
preview tabs are disabled.

That lead to a flickering behavior: on mouse-down the border of the
still-selected entry in the project panel would flash, only to disappear
as soon as the entry was opened and editor focused.

This change fixes it by manually keeping track of the mouse-down state,
because we couldn't find a better solution that allows us to simply not
show the border while a "click" is going on.

Release Notes:

- Fixed project panel entries flickering the border when user clicks on
another entry to open it (when preview tabs are disabled.)

Co-authored-by: Piotr <piotr@zed.dev>
2024-11-08 16:53:39 +01:00
Joseph T. Lyons
7142d3777f Add edit events for assistant panel and inline assist (#20418)
Release Notes:

- N/A
2024-11-08 10:37:10 -05:00
Thorsten Ball
01e12c0d3c project panel: Mark entries when opening in project panel (#20412)
This addresses #17746 by marking entries when they're opened in the
project panel.

I think that was the original intention behind the code too, because it
explicitly marks entries before opening them. An event that is emitted
by the workspace reset the mark though.

So what I did was try to emulate the logic I saw in VS Code: when
opening the file, mark it, when the active entry changes, unmark it,
except if you explicitly marked a group of files.

Closes #17746

Release Notes:

- Changed project panel to mark files when opening them, which should
make it more intuitive to mark multiple files after opening a single
one.
2024-11-08 16:29:10 +01:00
Kyle Kelley
706c385c24 Register repl actions with editor after session started (#20396)
Makes repl actions that are specific to running kernels only come up
after a session has been started at least once for the editor.

Release Notes:

- Only show session oriented `repl::` actions for editors after a
session has been created
2024-11-08 06:58:44 -08:00
Thorsten Ball
edb89d8d11 project panel: Fix preview tabs not working when enabled (#20416)
PR #20154 introduced a regression and essentially disabled preview tabs
in code.

This fixes it and restores the old preview tabs behavior.

Release Notes:

- Fixed preview tabs being disabled in code, even if they were enabled
in the settings.

Co-authored-by: Piotr <piotr@zed.dev>
2024-11-08 15:46:53 +01:00
Kyle Kelley
09675d43b3 Disable repl in non-local projects (#20397)
Release Notes:

- Disable REPL buttons and actions for remote projects and collaboration
(only the host should have access).
2024-11-08 06:29:07 -08:00
Danilo Leal
187356ab9b assistant: Show only configured models in the model picker (#20392)
Closes https://github.com/zed-industries/zed/issues/16568

This PR introduces some changes to how we display models in the model
selector within the assistant panel. Basically, it comes down to this:

- If you don't have any provider configured, you should see _all_
available models in the picker
- But, once you've configured some, you should _only_ see models from
them in the picker

Visually, nothing's changed much aside from the added "Configured
Models" label at the top to ensure the understanding that that's a list
of, well, configured models only. 😬

<img width="700" alt="Screenshot 2024-11-07 at 23 42 41"
src="https://github.com/user-attachments/assets/219ed386-2318-43a6-abea-1de0cda8dc53">

Release Notes:

- Change model selector in the assistant panel to only show configured
models
2024-11-08 10:08:59 -03:00
Danilo Leal
435708b615 assistant: Fine-tune crease feedback design (#20395)
Closes https://github.com/zed-industries/zed/issues/13414

Just polishing up how some of these look. Ever since the issue was
opened, we added the "Error" label to the button, as well as
automatically popping open the toast error whenever that happens.
Lastly, there's a tooltip in there as well indicating that you can click
on it to see the details of the error.

<img width="700" alt="Screenshot 2024-11-08 at 00 26 27"
src="https://github.com/user-attachments/assets/ad0962e6-4621-4e8b-be0d-103d71fcf2e6">

Release Notes:

- N/A
2024-11-08 10:08:49 -03:00
Antonio Scandurra
2fe9cd8faa Fix regression in producing sections when converting SlashCommandOutput to event stream (#20404)
Closes #20243 

Release Notes:

- N/A
2024-11-08 09:29:14 +01:00
Conrad Irwin
8cc3ce1f17 Fix extension tests on release branches (#20307)
Co-Authored-By: Max <max@zed.dev>
cc @maxdeviant

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-11-07 22:19:36 -07:00
Conrad Irwin
6ad8c4a0f4 Restore ctrl-b/f (#20399)
Follow up from #20378

Release Notes:

- N/A
2024-11-07 22:18:28 -07:00
David Soria Parra
30a94fa59b context_servers: Fix tool/list and prompt/list (#20387)
There are two issues with too/list and prompt/list at the moment. We
serialize params to `null`, which is not correct according to
context_server spec. While it IS allowed by JSON RPC spec to omit
params, it turns out some servers currently missbehave and don't respect
this. So we do two things

- We omit params if it would be a null value in json.
- We explicitly set params to {} for tool/list and prompt/list to avoid
it being omitted.

Release Notes:

- N/A
2024-11-07 19:09:55 -08:00
Kyle Kelley
36fe364c05 Show kernel options in a picker (#20274)
Closes #18341

* [x] Remove "Change Kernel" Doc link from REPL menu
* [x] Remove chevron
* [x] Set a higher min width
* [x] Include the language along with the kernel name

Future PRs will address

* Add support for Python envs (#18291, #16757, #15563)
* Add support for Remote kernels
* Project settings support (#16898)

Release Notes:

- Added kernel picker for repl

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2024-11-07 17:59:53 -08:00
Finn Evers
f6d4a73c34 terminal: Prevent [] from being sanitized into clickable file link (#20386)
This PR prevents `[]` from being sanitized into an empty string and thus
becoming a "valid", clickable file link in the integrated terminal.


Whenever you type `[]` into the terminal and hover over it while
pressing `cmd`, an empty popup appears and the cursor indicates that
this is a clickable element. Once you click on the brackets, the
worktree root is selected and focused within the file picker.

<img width="87" alt="grafik"
src="https://github.com/user-attachments/assets/01790323-88be-4373-a1ec-a345bcf2521e">


This is because in #2906 support was added for sanititzing file links
like `[/some/path/[slug].tsx]` to `/some/path/[slug].tsx`. In the case
`[]` where an empty string is returned from the sanitation, the string
is considered a valid file path and thus `[]` becomes a valid and
clickable navigation target.

Given that this an edge-case just for this specific one set of brackets
and otherwise no empty strings are matched from the regexes `URL_REGEX`
and `WORD_REGEX`, it seemed that this was the best place to fix this
bug.

Release Notes:

- `[]` is no longer considered a clickable link in the terminal
2024-11-08 02:41:30 +02:00
Marshall Bowers
7e7f25df6c Scope slash commands, context servers, and tools to individual Assistant Panel instances (#20372)
This PR reworks how the Assistant Panel references slash commands,
context servers, and tools.

Previously we were always reading them from the global registries, but
now we store individual collections on each Assistant Panel instance so
that there can be different ones registered for each project.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-11-07 18:23:25 -05:00
Kirill Bulatov
176314bfd2 Improve outline panel keyboard navigation (#20385)
Closes https://github.com/zed-industries/zed/issues/20187

Make outline panel more eager to open its entries:

* scroll editor to selected outline entries (before it required an extra
`"outline_panel::Open", { "change_selection": false }` action call)
* make any `Open` action call to behave like `"outline_panel::Open", {
"change_selection": true }` and remove the redundant parameter.
Now opening an entry is equal to double clicking the same entry: the
editor gets scrolled and its selection changes
* add a way to open entries the same way as excerpts are open in multi
buffers (will open the entire file, scroll and place the caret)

* additionally, fix another race issue that caused wrong entry to be
revealed after the selection change

Release Notes:

- Improved outline panel keyboard navigation
2024-11-08 01:19:54 +02:00
Peter Tripp
6606e6e37f ci: No GitHub Actions stale check on forks (#20382) 2024-11-07 16:11:18 -05:00
dhaus67
c350321318 Update Copilot Chat max_tokens soft limits (#20363)
Closes #20362 

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-11-07 16:03:12 -05:00
Conrad Irwin
9da040da3f Stop using alt- shortcuts (#20378)
Closes #7688

Release Notes:

- (breaking change) Stop binding keyboard shortcuts to alt-[a-z]. These
get in the way of typing characters. This is usually not an issue for
English speakers because we don't use many characters; but for other
Latin-based languages with diacritics our shortcuts prevent them typing
what they need to type.

This primarily affects Zed's extra features:
* `alt-q` => `cmd-k q` on maOS, `ctrl-k q` on Linux for `editor::Rewrap`
* `alt-z` => `cmd-k z` on macOS `ctrl-k z` on Linux for
`editor::ToggleSoftWrap`
  * `alt-m` => `ctrl-shift-m` for `assistant::ToggleModelSelector`
* `alt-v` => `ctrl-shift-v` for `["editor::MovePageUp", {
"center_cursor": true }]` (macOS only)
* `alt-t` => `cmd-shift-r` on maOS, `ctrl-shift-r` on Linux for
`task::Spawn` (The previous binding for `editor::RevealInFileManager`
now only applies in the project panel)
* `alt-shift-t` => `alt-cmd-r` on maOS, `ctrl-alt-r` on Linux for
`task::Rerun`
* `alt-shift-f` => `ctrl-shift-f` for
`project_panel::SearchInDirectory`.
 
But also overrides some bindings from Readline.
  * `alt-h` => `alt-backspace` for `editor::DeleteToPreviousWordStart`
  * `alt-d` => `alt-delete` for `editor::DeleteToNextWordEnd`
* `alt-f` => `ctrl-f` for `editor:: MoveToNextWordEnd` (`ctrl-f` was
previously `editor::MoveRight`)
* `alt-b` => `ctrl-b` for `editor::MoveToNextWordStart` (`ctrl-b` was
previously `editor::MoveLeft`)

Note that `alt-t` and `alt-shift-t` have been kept as aliases (because
no-one complained about `t` yet; but we may remove them completely in
the future).
2024-11-07 13:52:13 -07:00
Max Brunsfeld
f6385221c5 Add abstract classes to typescript outline query (#20377)
Closes #4553

Release Notes:

- Fixed a bug where abstract classes weren't shown correctly in the
outline view when editing Typescript code.
2024-11-07 12:44:34 -08:00
Douglas Ronne
999853fee0 Add emacs keymap (#19605)
Release Notes:

- Added Emacs (beta) base keymap
2024-11-07 15:22:53 -05:00
Mathias
f924c3ef00 Fix folder expand when dropped on itself in project_panel (#20365)
Closes #13093

Release Notes:

- Fixed folder expand when dropped on itself in project_panel
2024-11-07 20:03:55 +01:00
Michael Sloan
2c4984091c Revert "Use correct context path for focused element in WindowContext::bindings_for_action (#18843)" (#20367)
@JosephTLyons found that this broke display of keybindings in the recent
projects modal.

Release Notes:

- N/A
2024-11-07 09:45:23 -07:00
Richard Feldman
453c41205b Show warning when deleting files with unsaved changes (#20172)
Closes #9905

<img width="172" alt="Screenshot 2024-11-04 at 10 16 34 AM"
src="https://github.com/user-attachments/assets/5fa84e06-bcb9-471d-adab-e06881fbd3ca">
<img width="172" alt="Screenshot 2024-11-04 at 10 16 22 AM"
src="https://github.com/user-attachments/assets/d7def162-e910-4061-a160-6178c9d344e5">
<img width="172" alt="Screenshot 2024-11-04 at 10 17 17 AM"
src="https://github.com/user-attachments/assets/43c7e4fe-1b71-4786-bc05-44f34ed15dc5">
<img width="172" alt="Screenshot 2024-11-04 at 10 17 09 AM"
src="https://github.com/user-attachments/assets/17263782-c706-44b2-acbc-c3d2d14c20ac">


Release Notes:

- When deleting or trashing files, the confirmation prompt now warns if
files have unsaved changes.
2024-11-07 11:40:33 -05:00
Michael Sloan
e85ab077be Add missing field to impl Hash for RenderGlyphParams (#20316)
Unlikely to cause any behavior change but seems more correct to include
`is_emoji` in the hash.

Release Notes:

- N/A
2024-11-07 09:34:54 -07:00
Will Bradley
daa35e98f1 Enable look-around in Project Search using fancy-regex crate (#20308)
Closes #13486 

Release Notes:

- Added support for look-around in project search

Co-authored-by: Max <max@zed.dev>
2024-11-07 09:18:09 -07:00
Will Bradley
de70852497 Fix a test flake involving zeroed out group_intervals (#20328)
Release Notes:

- N/A
2024-11-07 09:17:43 -07:00
Thorsten Ball
454c9dc06d project panel: Add RemoveFromProject action (#20360)
This fixes #15995 by adding a `project panel: remove from project`
action that can be used in a keybinding.

Release Notes:

- Added a `project panel: remove from project` action so that users can
now add a keybinding to trigger it: `project_panel::RemoveFromProject`.
2024-11-07 16:15:09 +01:00
Thorsten Ball
71aeb6a636 editor: Do not show inline completion if snippet is active (#20300)
This avoids inline completions being shown (and overriding `<tab>`
behavior) when a snippet is active and the user wants to go through
snippet placeholders with `<tab>`.

Easy to reproduce:

Open a Rust file and use the `tfn` snippet to produce a test function.
Delete the placeholder. Without the change here, the inline provider
would suggest a function name. If you `<tab>`, you accept it, but then
you can't `<tab>` into the function body.

With this change the inline completions are deactivated as long as a
snippet is active.

Closes #19484 

Release Notes:

- Fixed inline completions (Copilot, Supermaven, ...) taking over when a
snippet completion was active. That resulted in `tab` not working to
jump to the next placeholder in the snippet.
2024-11-07 15:34:19 +01:00
Danilo Leal
cdd2128311 assistant: Add model names in alternative inline tooltips (#20350)
Closes https://github.com/zed-industries/zed/issues/18826

This PR adds the model name to the tooltips on the alternative inline
assistant icon buttons. The default model should be the first, so every
other one set as an alternative appears after.


https://github.com/user-attachments/assets/46faccaa-447c-45a4-b927-49ea3c4f3be1


Release Notes:

- Improve knowledge of which model is used when with alternative inline
models turned on
2024-11-07 10:56:19 -03:00
Danilo Leal
20b60e8dd2 Ensure project search actions are always aligned (#20353)
Follow up to https://github.com/zed-industries/zed/pull/20242

This PR ensures all the actions to the right of the project search
inputs have the same minimum width, ensuring that the inputs themselves
are always aligned. In the previous PR, I didn't considered the scenario
where the project search numbers where beyond 4 or 5 digits, which then
increased their width. This should be treated now!

<img width="700" alt="Screenshot 2024-11-07 at 09 55 11"
src="https://github.com/user-attachments/assets/7a9d8ebd-b575-4141-9242-3044f00150c5">

Release Notes:

- N/A
2024-11-07 10:56:10 -03:00
Danilo Leal
37366ac907 assistant: Improve UI feedback when inserting /delta without new changes (#20356)
Closes https://github.com/zed-industries/zed/issues/18488

### Before

No feedback when inserting `/delta` without new changes.


https://github.com/user-attachments/assets/4cc76ff4-419d-4a3f-a6a2-8712856b1aa8

### After

You now see an error within the `delta` crease.


https://github.com/user-attachments/assets/c56654bb-776f-4dac-a499-db4625a4f1bd

Release Notes:

- Improve UI feedback when inserting `/delta` without new changes
2024-11-07 10:56:01 -03:00
Kirill Bulatov
083f06322d Prefer revealing items in the middle of the list for outline and project panels (#20349)
Closes https://github.com/zed-industries/zed/issues/18255

Zed does not scroll always, but only if the item is out of sight, this
is preserved for now.
Otherwise, if the item is out of sight, project and outline panels + the
syntax tree view now attempt to scroll it into the middle, if there's
enough elements above and below.

Release Notes:

- Improved revealing items for outline and project panels (now center of the list is preferred)
2024-11-07 14:36:29 +02:00
Antonio Scandurra
16cbff9118 Polish streaming slash commands (#20345)
This improves the experience in a few ways:

- It avoids merging slash command output sections that are adjacent.
- When hitting cmd-z, all the output from a command is undone at once.
- When deleting a pending command, it stops the command and prevents new
output from flowing in.

Release Notes:

- N/A
2024-11-07 13:25:26 +01:00
Kirill Bulatov
e62d60c84c Cleanup Framework directory when re-bundling for macOS (#20342)
Release Notes:

- N/A
2024-11-07 11:34:27 +02:00
Axel Carlsson
4f62ebe4be Exclude pinned tabs when closing items (#19593)
Closing multiple items will no longer closed pinned tabs.

Closes #19560

Release Notes:

- Fixed close actions closing pinned tabs.
2024-11-07 11:20:19 +02:00
Kirill Bulatov
b33ae888c0 Use the updated syn in Cargo.lock (#20341)
Renovate did not update that, so helping it out.

Release Notes:

- N/A
2024-11-07 10:54:03 +02:00
xdBronch
029d08350e zig: Switch to official Zig grammar (#20004)
Closes #20001

the old outline was *weird* for many reasons so ill just show it with a
hodgepodge of zig declarations
before:

![image](https://github.com/user-attachments/assets/87395623-3e28-491c-9693-c1714da6b29f)
after:

![image](https://github.com/user-attachments/assets/1aa3f3b7-18b0-4d39-b1c6-99740e7bcd6a)

why were values shown? why werent `var`s or modifiers like pub, const,
export? it was very odd to me and inconsistent with other languages. i
chose to leave out unnamed tests, it just seemed like noise to me since
they werent distinct but i can easily revert that
unfortunately there seems to be a bug upstream which causes those
`t`/`f` decls to show 2 things
https://github.com/tree-sitter-grammars/tree-sitter-zig/issues/3

im very new to treesitter and queries so i really havent looked over the
rest of the stuff here, other than outline theyre unmodified please lmk
if theres anything wrong

Release Notes:

- Changed upstream treesitter grammar for zig
2024-11-07 09:47:15 +01:00
renovate[bot]
6d0aa72226 Update Rust crate url to v2.5.3 (#20334)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [url](https://redirect.github.com/servo/rust-url) |
workspace.dependencies | patch | `2.5.2` -> `2.5.3` |

---

### Release Notes

<details>
<summary>servo/rust-url (url)</summary>

###
[`v2.5.3`](https://redirect.github.com/servo/rust-url/releases/tag/v2.5.3)

[Compare
Source](https://redirect.github.com/servo/rust-url/compare/v2.5.2...v2.5.3)

#### What's Changed

- fix: enable wasip2 feature for wasm32-wasip2 target by
[@&#8203;brooksmtownsend](https://redirect.github.com/brooksmtownsend)
in
[https://github.com/servo/rust-url/pull/960](https://redirect.github.com/servo/rust-url/pull/960)
- Fix idna tests with no_std by
[@&#8203;cjwatson](https://redirect.github.com/cjwatson) in
[https://github.com/servo/rust-url/pull/963](https://redirect.github.com/servo/rust-url/pull/963)
- Fix debugger_visualizer test failures. by
[@&#8203;valenting](https://redirect.github.com/valenting) in
[https://github.com/servo/rust-url/pull/967](https://redirect.github.com/servo/rust-url/pull/967)
- Add AsciiSet::EMPTY and boolean operators by
[@&#8203;joshka](https://redirect.github.com/joshka) in
[https://github.com/servo/rust-url/pull/969](https://redirect.github.com/servo/rust-url/pull/969)
- mention why we pin unicode-width by
[@&#8203;Manishearth](https://redirect.github.com/Manishearth) in
[https://github.com/servo/rust-url/pull/972](https://redirect.github.com/servo/rust-url/pull/972)
- refactor and add tests for percent encoding by
[@&#8203;joshka](https://redirect.github.com/joshka) in
[https://github.com/servo/rust-url/pull/977](https://redirect.github.com/servo/rust-url/pull/977)
- Add a test for and fix issue
[#&#8203;974](https://redirect.github.com/servo/rust-url/issues/974) by
[@&#8203;hansl](https://redirect.github.com/hansl) in
[https://github.com/servo/rust-url/pull/975](https://redirect.github.com/servo/rust-url/pull/975)
- `no_std` support for the `url` crate by
[@&#8203;domenukk](https://redirect.github.com/domenukk) in
[https://github.com/servo/rust-url/pull/831](https://redirect.github.com/servo/rust-url/pull/831)
- Normalize URL paths: convert /.//p, /..//p, and //p to p by
[@&#8203;theskim](https://redirect.github.com/theskim) in
[https://github.com/servo/rust-url/pull/943](https://redirect.github.com/servo/rust-url/pull/943)
- support Hermit by
[@&#8203;m-mueller678](https://redirect.github.com/m-mueller678) in
[https://github.com/servo/rust-url/pull/985](https://redirect.github.com/servo/rust-url/pull/985)
- fix: support `wasm32-wasip2` on the stable channel by
[@&#8203;brooksmtownsend](https://redirect.github.com/brooksmtownsend)
in
[https://github.com/servo/rust-url/pull/983](https://redirect.github.com/servo/rust-url/pull/983)
- Improve serde error output by
[@&#8203;konstin](https://redirect.github.com/konstin) in
[https://github.com/servo/rust-url/pull/982](https://redirect.github.com/servo/rust-url/pull/982)
- OSS-Fuzz: Add more fuzzer by
[@&#8203;arthurscchan](https://redirect.github.com/arthurscchan) in
[https://github.com/servo/rust-url/pull/988](https://redirect.github.com/servo/rust-url/pull/988)
- Merge idna-v1x to main by
[@&#8203;hsivonen](https://redirect.github.com/hsivonen) in
[https://github.com/servo/rust-url/pull/990](https://redirect.github.com/servo/rust-url/pull/990)

#### New Contributors

- [@&#8203;brooksmtownsend](https://redirect.github.com/brooksmtownsend)
made their first contribution in
[https://github.com/servo/rust-url/pull/960](https://redirect.github.com/servo/rust-url/pull/960)
- [@&#8203;cjwatson](https://redirect.github.com/cjwatson) made their
first contribution in
[https://github.com/servo/rust-url/pull/963](https://redirect.github.com/servo/rust-url/pull/963)
- [@&#8203;joshka](https://redirect.github.com/joshka) made their first
contribution in
[https://github.com/servo/rust-url/pull/969](https://redirect.github.com/servo/rust-url/pull/969)
- [@&#8203;hansl](https://redirect.github.com/hansl) made their first
contribution in
[https://github.com/servo/rust-url/pull/975](https://redirect.github.com/servo/rust-url/pull/975)
- [@&#8203;theskim](https://redirect.github.com/theskim) made their
first contribution in
[https://github.com/servo/rust-url/pull/943](https://redirect.github.com/servo/rust-url/pull/943)
- [@&#8203;m-mueller678](https://redirect.github.com/m-mueller678) made
their first contribution in
[https://github.com/servo/rust-url/pull/985](https://redirect.github.com/servo/rust-url/pull/985)
- [@&#8203;konstin](https://redirect.github.com/konstin) made their
first contribution in
[https://github.com/servo/rust-url/pull/982](https://redirect.github.com/servo/rust-url/pull/982)
- [@&#8203;arthurscchan](https://redirect.github.com/arthurscchan) made
their first contribution in
[https://github.com/servo/rust-url/pull/988](https://redirect.github.com/servo/rust-url/pull/988)

**Full Changelog**:
https://github.com/servo/rust-url/compare/v2.5.2...v2.5.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-07 10:14:34 +02:00
Cherry
12afd1264e Add long file paths solution to Windows troubleshooting (#20317)
Currently, building on Windows may fail for people who have not enabled
long filepaths on Windows itself.

This PR adds the solution to the troubleshooting section in the
`Building Zed for Windows` guide.

For an example failure error message:
```rs
error: failed to get `pet` as a dependency of package `languages v0.1.0 (D:\a\zed-windows-builds\zed-windows-builds\crates\languages)`

Caused by:
  failed to load source for dependency `pet`

Caused by:
  Unable to update https://github.com/microsoft/python-environment-tools.git?rev=ffcbf3f28c46633abd5448a52b1f396c322e0d6c#ffcbf3f2

Caused by:
  path too long: 'C:/Users/runneradmin/.cargo/git/checkouts/python-environment-tools-903993894b37a7d2/ffcbf3f/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json'; class=Filesystem (30)
```

Release Notes:

- N/A
2024-11-07 10:01:59 +02:00
Kirill Bulatov
b526d69387 Allow Unicode-3.0 license in checks (#20339)
Part of https://github.com/zed-industries/zed/pull/20334

The license is on par with other licenses in the list:
https://www.unicode.org/license.txt

Release Notes:

- N/A
2024-11-07 09:59:41 +02:00
Jeevitha Kannan K S
4f06f5b8fe Refactor scripts to use command -v instead of which (#20306)
`which` is not a core package is some distributions.
Included changes from #20309 

Release Notes:

- N/A
2024-11-07 09:34:56 +02:00
renovate[bot]
555a219f11 Update Rust crate serde_json to v1.0.132 (#20326)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [serde_json](https://redirect.github.com/serde-rs/json) | dependencies
| patch | `1.0.128` -> `1.0.132` |
| [serde_json](https://redirect.github.com/serde-rs/json) |
workspace.dependencies | patch | `1.0.128` -> `1.0.132` |

---

### Release Notes

<details>
<summary>serde-rs/json (serde_json)</summary>

###
[`v1.0.132`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.132)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.131...1.0.132)

- Improve binary size and compile time for JSON array and JSON object
deserialization by about 50%
([#&#8203;1205](https://redirect.github.com/serde-rs/json/issues/1205))
- Improve performance of JSON array and JSON object deserialization by
about 8%
([#&#8203;1206](https://redirect.github.com/serde-rs/json/issues/1206))

###
[`v1.0.131`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.131)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.130...1.0.131)

- Implement Deserializer and IntoDeserializer for `Map<String, Value>`
and `&Map<String, Value>`
([#&#8203;1135](https://redirect.github.com/serde-rs/json/issues/1135),
thanks [@&#8203;swlynch99](https://redirect.github.com/swlynch99))

###
[`v1.0.130`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.130)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.129...1.0.130)

- Support converting and deserializing `Number` from i128 and u128
([#&#8203;1141](https://redirect.github.com/serde-rs/json/issues/1141),
thanks [@&#8203;druide](https://redirect.github.com/druide))

###
[`v1.0.129`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.129)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.128...1.0.129)

- Add
[`serde_json::Map::sort_keys`](https://docs.rs/serde_json/1/serde_json/struct.Map.html#method.sort_keys)
and
[`serde_json::Value::sort_all_objects`](https://docs.rs/serde_json/1/serde_json/enum.Value.html#method.sort_all_objects)
([#&#8203;1199](https://redirect.github.com/serde-rs/json/issues/1199))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-07 09:26:57 +02:00
renovate[bot]
74540231e5 Update Rust crate pulldown-cmark to v0.12.2 (#20325)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pulldown-cmark](https://redirect.github.com/raphlinus/pulldown-cmark)
| workspace.dependencies | patch | `0.12.1` -> `0.12.2` |

---

### Release Notes

<details>
<summary>raphlinus/pulldown-cmark (pulldown-cmark)</summary>

###
[`v0.12.2`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.12.2):
0.12.2

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.12.1...v0.12.2)

#### What's Changed

- Fix compiilation error in fuzzers by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/947](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/947)
- Make `fuzz` dir part of the workspace by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/948](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/948)
- Fix and improve `bench` by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/950](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/950)
- Reuse a couple hash maps across blocks by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/951](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/951)
- Reuse outer indent between item list, def list, and blockquote by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/952](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/952)
- Add instructions on fixing fuzz build by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/953](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/953)
- Account for definition list fixups while popping containers by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/954](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/954)
- Use byte range instead of char count for delim run bounds by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/956](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/956)
- CI improvements by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/955](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/955)
- Fix a problem that causes multiple dt's to be parsed by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/958](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/958)
- fix: emit `InlineHtml` for inline HTML inside blockquote instead of
`Html` by [@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/961](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/961)
- Complete the list of block item bodies by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/962](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/962)
- Implement into_static for CowStr and Event in pulldown-cmark by
[@&#8203;Atreyagaurav](https://redirect.github.com/Atreyagaurav) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/967](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/967)
- Enforce cargo fmt by
[@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/971](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/971)
- Respect line starts when trimming header endings by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/969](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/969)

#### New Contributors

- [@&#8203;Atreyagaurav](https://redirect.github.com/Atreyagaurav) made
their first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/967](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/967)

**Full Changelog**:
https://github.com/pulldown-cmark/pulldown-cmark/compare/v0.12.1...v0.12.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-07 09:05:22 +02:00
renovate[bot]
5c0ecc09fb Update Rust crate wasmtime-wasi to v24.0.2 (#20335)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [wasmtime-wasi](https://redirect.github.com/bytecodealliance/wasmtime)
| workspace.dependencies | patch | `24.0.1` -> `24.0.2` |

---

### Release Notes

<details>
<summary>bytecodealliance/wasmtime (wasmtime-wasi)</summary>

###
[`v24.0.2`](https://redirect.github.com/bytecodealliance/wasmtime/releases/tag/v24.0.2)

[Compare
Source](https://redirect.github.com/bytecodealliance/wasmtime/compare/v24.0.1...v24.0.2)

#### 24.0.2

Released 2024-11-05.

##### Fixed

- Update to cap-std 3.4.1, for
[#&#8203;9559](https://redirect.github.com/bytecodealliance/wasmtime/issues/9559),
which fixes a wasi-filesystem sandbox
    escape on Windows.

[CVE-2024-51745](https://redirect.github.com/bytecodealliance/wasmtime/security/advisories/GHSA-c2f5-jxjv-2hh8).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-07 09:04:52 +02:00
renovate[bot]
5b59ef3456 Update Rust crate thiserror to v1.0.68 (#20332) 2024-11-07 08:52:00 +02:00
renovate[bot]
fda3e4c69a Update Rust crate sys-locale to v0.3.2 (#20331)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [sys-locale](https://redirect.github.com/1Password/sys-locale) |
workspace.dependencies | patch | `0.3.1` -> `0.3.2` |

---

### Release Notes

<details>
<summary>1Password/sys-locale (sys-locale)</summary>

###
[`v0.3.2`](https://redirect.github.com/1Password/sys-locale/releases/tag/v0.3.2)

[Compare
Source](https://redirect.github.com/1Password/sys-locale/compare/v0.3.1...v0.3.2)

#### What's Changed

##### Added

- Support for all other Apple targets, such as watchOS and tvOS by
[@&#8203;complexspaces](https://redirect.github.com/complexspaces) in
[https://github.com/1Password/sys-locale/pull/38](https://redirect.github.com/1Password/sys-locale/pull/38).
- Support for ignoring POSIX modifiers in UNIX locales with them present
by [@&#8203;pasabanov](https://redirect.github.com/pasabanov) in
[https://github.com/1Password/sys-locale/pull/33](https://redirect.github.com/1Password/sys-locale/pull/33).
    -   Parsing support/recognition may come at a later date.
- Support for returning a list of user locales on Linux/BSD UNIX
platforms by [@&#8203;pasabanov](https://redirect.github.com/pasabanov)
in
[https://github.com/1Password/sys-locale/pull/35](https://redirect.github.com/1Password/sys-locale/pull/35).

##### Fixed

- No longer use `LC_CTYPE` when determining the locale; the crate now
uses `LC_MESSAGES` in its place by
[@&#8203;pasabanov](https://redirect.github.com/pasabanov) in
[https://github.com/1Password/sys-locale/pull/35](https://redirect.github.com/1Password/sys-locale/pull/35).
- Skip empty locale environment variables on UNIX platforms by
[@&#8203;complexspaces](https://redirect.github.com/complexspaces) in
[https://github.com/1Password/sys-locale/pull/29](https://redirect.github.com/1Password/sys-locale/pull/29).
- Corrected types mentioned and improved the public API documentation by
[@&#8203;pasabanov](https://redirect.github.com/pasabanov) in
[https://github.com/1Password/sys-locale/pull/37](https://redirect.github.com/1Password/sys-locale/pull/37).

##### Changed

- Improved crate download size by excluding unused directories and files
by [@&#8203;pasabanov](https://redirect.github.com/pasabanov).
- Very slight improvement to locale fetching performance on Windows by
[@&#8203;complexspaces](https://redirect.github.com/complexspaces) in
[https://github.com/1Password/sys-locale/pull/29](https://redirect.github.com/1Password/sys-locale/pull/29).
- Increased MSRV to Rust 1.56, which is 3 years old as of this release
by [@&#8203;complexspaces](https://redirect.github.com/complexspaces).

#### New Contributors

- [@&#8203;pasabanov](https://redirect.github.com/pasabanov) made their
first contribution in
[https://github.com/1Password/sys-locale/pull/30](https://redirect.github.com/1Password/sys-locale/pull/30)

**Full Changelog**:
https://github.com/1Password/sys-locale/compare/v0.3.1...v0.3.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 20:38:00 -07:00
renovate[bot]
028c2a8249 Update Rust crate anyhow to v1.0.93 (#20321)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anyhow](https://redirect.github.com/dtolnay/anyhow) |
workspace.dependencies | patch | `1.0.91` -> `1.0.93` |

---

### Release Notes

<details>
<summary>dtolnay/anyhow (anyhow)</summary>

###
[`v1.0.93`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.93)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.92...1.0.93)

-   Update dev-dependencies to `thiserror` v2

###
[`v1.0.92`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.92)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.91...1.0.92)

- Support Rust 1.82's `&raw const` and `&raw mut` syntax inside
`ensure!`
([#&#8203;390](https://redirect.github.com/dtolnay/anyhow/issues/390))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 20:37:43 -07:00
renovate[bot]
a86c4deb78 Update Rust crate mdbook to v0.4.41 (#20322)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mdbook](https://redirect.github.com/rust-lang/mdBook) | dependencies
| patch | `0.4.40` -> `0.4.41` |

---

### Release Notes

<details>
<summary>rust-lang/mdBook (mdbook)</summary>

###
[`v0.4.41`](https://redirect.github.com/rust-lang/mdBook/blob/HEAD/CHANGELOG.md#mdBook-0441)

[Compare
Source](https://redirect.github.com/rust-lang/mdBook/compare/v0.4.40...v0.4.41)


[v0.4.40...v0.4.41](https://redirect.github.com/rust-lang/mdBook/compare/v0.4.40...v0.4.41)

##### Added

-   Added preliminary support for Rust 2024 edition.
[#&#8203;2398](https://redirect.github.com/rust-lang/mdBook/pull/2398)
-   Added a full example of the remove-emphasis preprocessor.
[#&#8203;2464](https://redirect.github.com/rust-lang/mdBook/pull/2464)

##### Changed

-   Adjusted styling of clipboard/play icons.
[#&#8203;2421](https://redirect.github.com/rust-lang/mdBook/pull/2421)
-   Updated to handlebars v6.
[#&#8203;2416](https://redirect.github.com/rust-lang/mdBook/pull/2416)
-   Attr and section rules now have specific code highlighting.
[#&#8203;2448](https://redirect.github.com/rust-lang/mdBook/pull/2448)
- The sidebar is now loaded from a common file, significantly reducing
the book size when there are many chapters.
[#&#8203;2414](https://redirect.github.com/rust-lang/mdBook/pull/2414)
-   Updated dependencies.
[#&#8203;2470](https://redirect.github.com/rust-lang/mdBook/pull/2470)

##### Fixed

-   Improved theme support when JavaScript is disabled.
[#&#8203;2454](https://redirect.github.com/rust-lang/mdBook/pull/2454)
-   Fixed broken themes when localStorage has an invalid theme id.
[#&#8203;2463](https://redirect.github.com/rust-lang/mdBook/pull/2463)
- Adjusted the line-height of superscripts (and footnotes) to avoid
adding extra space between lines.
[#&#8203;2465](https://redirect.github.com/rust-lang/mdBook/pull/2465)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 20:37:36 -07:00
Conrad Irwin
e645aa9d20 Root rename detection (#20313)
Closes #5349

Release Notes:

- Fixed Zed when the directory that you opened is renamed.
2024-11-06 20:36:59 -07:00
Nate Butler
216ea4ddc4 Unify Solarized colors (#20330)
Lily over on discord noticed two of the colors in our Solarized themes
were off by a single point. The two colors are nearly indistinguishable,
so we might as well unify them.

This PR does exactly that.

Release Notes:

- N/A
2024-11-06 21:15:45 -05:00
Nate Butler
29c5ea0a50 More previews (#20329)
Release Notes:

- N/A
2024-11-06 21:15:35 -05:00
Marshall Bowers
b129e18396 Make slash command output streamable (#19632)
This PR adds support for streaming output from slash commands

In this PR we are focused primarily on the interface of the
`SlashCommand` trait to support streaming the output. We will follow up
later with support for extensions and context servers to take advantage
of the streaming nature.

Release Notes:

- N/A

---------

Co-authored-by: David Soria Parra <davidsp@anthropic.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: David <david@anthropic.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Will <will@zed.dev>
2024-11-06 16:24:43 -08:00
Nate Butler
f6fbf662b4 Add ui::ComponentPreview (#20319)
The `ComponentPreview` trait enables rendering storybook-like previews
of components inside of Zed.


![CleanShot 2024-11-06 at 16 32
25@2x](https://github.com/user-attachments/assets/6894663f-1bbc-4a40-b420-33882e9e239a)


This initial version will work for any component that doesn't return a
view.

Example impl:

```rust
impl ComponentPreview for Checkbox {
    fn description() -> impl Into<Option<&'static str>> {
        "A checkbox lets people choose between opposing..."
    }

    fn examples() -> Vec<ComponentExampleGroup<Self>> {
        vec![
            example_group(
                "Default",
                vec![
                    single_example(
                        "Unselected",
                        Checkbox::new("checkbox_unselected", Selection::Unselected),
                    ),
                    // ... more examples
                ],
            ),
            // ... more examples
        ]
    }
}
```

Example usage:

```rust
fn render_components_page(&self, cx: &ViewContext<Self>) -> impl IntoElement {
        v_flex()
            .gap_2()
            .child(Checkbox::render_component_previews(cx))
            .child(Icon::render_component_previews(cx))
    }
}
```

Release Notes:

- N/A
2024-11-06 16:54:18 -05:00
Peter Schilling
a409123342 Show workspace name before filename in window title (#20310)
when searching for the appropriate zed window, i scan a list of window
titles. putting the workspace before the filename makes this list a lot
easier to scan.

![CleanShot 2024-11-06 at 11 07
01@2x](https://github.com/user-attachments/assets/2dcbe96d-6f91-443e-bfd2-10bd1c81e679)

screenshot of [alt tab](https://alt-tab-macos.netlify.app/) in mac os
demonstrating how putting the workspace first makes it easier to locate
a project.


Release Notes:

- Improved window title by showing workspace name before filename
2024-11-06 22:34:49 +02:00
renovate[bot]
b0b29d91f9 Update cloudflare/wrangler-action digest to 05f17c4 (#20315)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[cloudflare/wrangler-action](https://redirect.github.com/cloudflare/wrangler-action)
| action | digest | `b2a0191` -> `05f17c4` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 22:29:17 +02:00
renovate[bot]
290c9113b7 Update astral-sh/setup-uv digest to 2e657c1 (#20314)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [astral-sh/setup-uv](https://redirect.github.com/astral-sh/setup-uv) |
action | digest | `f3bcaeb` -> `2e657c1` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 22:26:09 +02:00
Danilo Leal
36427e0a87 assistant: Refine role crease loading state design (#20311)
Follow up to https://github.com/zed-industries/zed/pull/20125 — going
for that <kbd>kbd</kbd> look.

<img width="230" alt="Screenshot 2024-11-06 at 16 51 27"
src="https://github.com/user-attachments/assets/d29a2650-8bf8-4500-8dc1-92b0be210e04">

Release Notes:

- N/A
2024-11-06 17:11:34 -03:00
Floyd Wang
e16d5c3a68 gpui: Bump crates resvg and usvg to 0.44.0 (#20067)
Closes #17388

Release Notes:

- N/A

We are using gpui to build a project, and we want to render SVGs with
the `<text>` tag. We use `resvg` and `usvg` with the same version as
gpui, like `0.41.0`. However, when we enable the feature `text`, we get
an error from `usvg`.

```shell
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
  --> /Users/madcodelife/.cargo/git/checkouts/zed-23e65a6dff445450/e681a4b/crates/gpui/src/svg_renderer.rs:49:20
   |
49 |         let tree = usvg::Tree::from_data(bytes, &usvg::Options::default())?;
   |                    ^^^^^^^^^^^^^^^^^^^^^---------------------------------- argument #3 of type `&Database` is missing
   |
```

This error occurs because when the `text` feature is enabled, the
`form_data` function needs an extra argument, `fontdb`.
[The code is
here](fb7e28513f/crates/usvg/src/parser/mod.rs (L98)).

They changed the API in version
[`0.42.0`](b1d06e9463/crates/usvg/src/parser/mod.rs (L98)).

So, I updated the versions to the latest (0.44.0).

This is our demo:

## Before:
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/7c71f8b1-e5fe-4e60-8f21-bb3bd9924e03">

## After:
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/4b0a0602-928f-4017-b5df-859eeb5f6b4a">
2024-11-06 21:40:22 +02:00
Conrad Irwin
608addf641 Extension refactor (#20305)
This contains the main changes to the extensions crate from #20049. The
primary goal here is removing dependencies that we can't include on the
remote.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-11-06 10:06:25 -07:00
Nate Butler
f22e56ff42 Improve One theme contrasts (#20304)
Closes #5334
Closes #15521 

Improve contrast across the board in default One themes. 

We are currently building out some theme tools to make improvements to
contrast and tweaking themes in general easier, so these should continue
to improve over time.

**Light**

Before | After

![CleanShot 2024-11-06 at 11 26
02@2x](https://github.com/user-attachments/assets/2e5d5649-4131-4d42-accc-9bbcf34defeb)

**Dark**
Before | After

![CleanShot 2024-11-06 at 11 30
26@2x](https://github.com/user-attachments/assets/78bc5134-6113-48fd-b026-88e427c631a3)

**Note 1**: there are more improvements to be made, but this should deal
with the most egregious issues.

Release Notes:

- Improved contrast in default One themes
2024-11-06 11:56:02 -05:00
renovate[bot]
449e20de3d Update Rust crate wasmtime to v24.0.2 [SECURITY] (#20262)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [wasmtime](https://redirect.github.com/bytecodealliance/wasmtime) |
workspace.dependencies | patch | `24.0.1` -> `24.0.2` |

### GitHub Vulnerability Alerts

####
[CVE-2024-51745](https://redirect.github.com/bytecodealliance/wasmtime/security/advisories/GHSA-c2f5-jxjv-2hh8)

### Impact

Wasmtime's filesystem sandbox implementation on Windows blocks access to
special device filenames such as "COM1", "COM2", "LPT0", "LPT1", and so
on, however it did not block access to the special device filenames
which use superscript digits, such as "COM¹", "COM²", "LPT⁰", "LPT¹",
and so on. Untrusted Wasm programs that are given access to any
filesystem directory could bypass the sandbox and access devices through
those special device filenames with superscript digits, and through them
gain access peripheral devices connected to the computer, or network
resources mapped to those devices. This can include modems, printers,
network printers, and any other device connected to a serial or parallel
port, including emulated USB serial ports.

### Patches

Patch releases for Wasmtime have been issued as 24.0.2, 25.0.3, and
26.0.1. Users of Wasmtime 23.0.x and prior are recommended to upgrade to
one of these patched versions.

### Workarounds

There are no known workarounds for this issue. Affected Windows users
are recommended to upgrade.

### References

- [Microsoft's
documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions)
of the special device filenames
 - [ISO-8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
- [The original PR reporting the
issue](https://redirect.github.com/bytecodealliance/cap-std/pull/371)

---

### Release Notes

<details>
<summary>bytecodealliance/wasmtime (wasmtime)</summary>

###
[`v24.0.2`](https://redirect.github.com/bytecodealliance/wasmtime/releases/tag/v24.0.2)

[Compare
Source](https://redirect.github.com/bytecodealliance/wasmtime/compare/v24.0.1...v24.0.2)

#### 24.0.2

Released 2024-11-05.

##### Fixed

- Update to cap-std 3.4.1, for
[#&#8203;9559](https://redirect.github.com/bytecodealliance/wasmtime/issues/9559),
which fixes a wasi-filesystem sandbox
    escape on Windows.

[CVE-2024-51745](https://redirect.github.com/bytecodealliance/wasmtime/security/advisories/GHSA-c2f5-jxjv-2hh8).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "" in timezone America/New_York,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 09:21:50 -07:00
Peter Tripp
1aac35cc1c v0.162.x dev 2024-11-06 11:09:13 -05:00
Peter Tripp
815385cc5f Add autoclosing braces for Shell Scripts (#20278)
Added support for autoclosing braces `{}` and single quotes `''` in Shell Scripts
2024-11-06 11:05:59 -05:00
Lars Diederich
eca3424cb5 Update openSUSE dependencies to build on fresh Tumbleweed installation (#20298) 2024-11-06 11:05:13 -05:00
Danilo Leal
71b3633c1b assistant: Remove automatic diagnostic attachment to tab and file commands (#20297)
This PR returns the `/tab` and `/file` commands to their original
behavior of _not_ automatically including diagnostics. This is an
assistant-only change, though, given that we can already pass the
`/diagnostic` command by itself. The inline assistant will still have
the diagnostics baked in to allow prompts such as "Fix this error."

Release Notes:

- Remove automatic diagnostic attachment to tab and file commands in the
assistant panel

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-11-06 11:36:34 -03:00
Antonio Scandurra
21f778c6db Reduce memory footprint for inline transformations (#20296)
Closes https://github.com/zed-industries/zed/issues/18062

This pull request prevents the `scores` matrix for the streaming diff
from growing quadratically.

Previously, we would store rows and columns respectively for all
characters in the old and new text. However, every time we receive a
chunk, we will always advance the position in the matrix to the very
latest character in the new text. This means we can avoid storing scores
for the new characters that were already reported.

Randomized tests still pass and I also made sure that the diffs we
produce are identical.

Release Notes:

- Improved memory footprint for inline transformations
([#18062](https://github.com/zed-industries/zed/issues/18062))
2024-11-06 15:07:16 +01:00
Roshan Padaki
1eb6fb0b5d go: Run ./... tasks against current module (#20190)
In #17108, we updated `go test ./...` to run against the package
directory, to fix cases in which the top-level project is not the go
module root. However, this leads to the confusing behavior of `go test
./...` only running tests in subdirectories of the current package.
Here, we change the behavior to instead walk up the dirtree to find the
closest `go.mod`, and run the `./...` tasks relative to that directory.
This might lead to more predictable behavior for these tasks.

Also see:
https://github.com/zed-industries/zed/pull/19987#issuecomment-2450159099

Release Notes:

- Improved go test and generate `./...` commands to run against the
current go module directory rather than the current package directory
2024-11-06 14:55:57 +01:00
Ilya Sorochan
484e5df2ee Add suggestion for CMake files (#20292)
Release Notes:

- Added NeoCMake extension suggestion for cmake files (`CMakeLists.txt`
and `.cmake`)
2024-11-06 14:51:26 +01:00
Piotr Osiewicz
fef7df667c pane: Update pinned tab counts when unnamed buffer is discarded (#20294)
Closes #19492

Release Notes:

- Fixed a crash that could happen when closing a workspace with pinned
untitled buffers.
2024-11-06 13:58:51 +01:00
Kirill Bulatov
1c84fd1fef Use Zed handler for undo and redo macOS actions (#20293)
Those seem to require a corresponding NSTextView/NSTextField with
explicitly enabled `allowsUndo` property. But Zed does not use any of
these *Text* elements, so there's nothing to allow undo on. Hence, use
the Zed handler, making both actions always enabled instead of being
always disabled.

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

Release Notes:

- Fixed undo and redo macOS menu items being always disabled
([#12335](https://github.com/zed-industries/zed/issues/12335))
2024-11-06 14:34:46 +02:00
Thorsten Ball
b6adab84a0 rope: Index tab locations for each chunk (#20289)
This is a follow-up to #19913 and adds another "index" to the `Chunk`,
this time indexing the location of tabs.

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-11-06 13:18:30 +01:00
Danilo Leal
d3a49f6d8f assistant: Rename "new context" to "new chat" (#20043)
This PR is only updating UI strings and pieces of the documentation—it
doesn't touch the actual code, where it's still using things such as
`NewContext` and similar terminology for variables, actions, etc.

Release Notes:

- N/A
2024-11-06 07:24:04 -03:00
Patrick Decat
c2cf4c45c0 Fix path to install-mold script in linux script (#20286)
Release Notes:

- N/A
2024-11-06 12:18:31 +02:00
Thorsten Ball
bd03dea296 git: Add support for opening git worktrees (#20164)
This adds support for [git
worktrees](https://matklad.github.io/2024/07/25/git-worktrees.html). It
fixes the errors that show up (git blame not working) and actually adds
support for detecting git changes in a `.git` folder that's outside of
our path (and not even in the ancestor chain of our root path).

(While working on this we discovered that our `.gitignore` handling is
not 100% correct. For example: we do stop processing `.gitignore` files
once we found a `.git` repository and don't go further up the ancestors,
which is correct, but then we also don't take into account the
`excludesFile` that a user might have configured, see:
https://git-scm.com/docs/gitignore)


Closes https://github.com/zed-industries/zed/issues/19842
Closes https://github.com/zed-industries/zed/issues/4670

Release Notes:

- Added support for git worktrees. Zed can now open git worktrees and
the git status in them is correctly handled.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-11-06 09:43:39 +01:00
Danilo Leal
3f777f0c68 Fix project panel losing focus after file creation attempt (#20273)
Closes https://github.com/zed-industries/zed/issues/19771

### Before

When pressing <kbd>esc</kbd> after attempting to create a file, the
focus is lost and you don't know where it went.


https://github.com/user-attachments/assets/2ccd82b7-b7d2-49e4-b1c7-1867331ab9dc

### After

Now, after pressing <kbd>esc</kbd>, the focus returns to where it was
before trying to create a new file.


https://github.com/user-attachments/assets/a8eb1cf1-dfef-42eb-9f3d-2ab6200056c4

Release Notes:

- Fix project panel losing focus after file creation attempt
([#19771](https://github.com/zed-industries/zed/issues/19771))

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-11-06 09:59:06 +02:00
Conrad Irwin
846aec701f Remoting: Fix opening multiple folders on one server (#20281)
Release Notes:

- Remoting: Fix opening multiple folders on one server
2024-11-05 22:16:38 -07:00
Conrad Irwin
cfce6a8fbf Potentially fix invocation of draft-release-notes (#20265)
Release Notes:

- N/A
2024-11-05 21:46:05 -07:00
Conrad Irwin
803e5d4c9f vim: Fix readonly mode (#20264)
Closes #18854

Release Notes:

- vim: Fixed `r`, `~` etc. appearing to modify readonly buffers
2024-11-05 21:45:45 -07:00
AidanV
c10c35ffda Fix duplicate SshProject's in Remote Projects menu (#20271)
Closes #20269

Release Notes:

- Changes SshConnection to use a BTreeSet of SshProject's instead of a
Vec of SshProject's in order to remove duplicate remote projects from
"settings.json" and the Remote Projects menu.
2024-11-05 21:31:57 -07:00
Conrad Irwin
38b1940251 Re-entrant SendKeystrokes (#20277)
Release Notes:

- Improved `workspace::SendKeystrokes` to support re-binding keys. For
example you can now do: `"x": ["workspace::SendKeystrokes", "\" _ x"]`
in vim mode to ensure that `x` does not clobber your clipboard.
- Improved key binding documentation
2024-11-05 21:18:16 -07:00
Max Brunsfeld
50069a2153 Unbind app menu actions (#20268)
Closes #7544

Release Notes:

- Fixed an issue that prevented removing key bindings for actions used
in the macOS application menu.
2024-11-05 16:18:41 -08:00
Kirill Bulatov
b23835b5a5 Disable sccache during dev extension builds (#20270) 2024-11-06 02:01:56 +02:00
Nathan Sobo
e47b305ca7 Use correct context path for focused element in WindowContext::bindings_for_action (#18843)
Previously, we were reaching in and using the context_stack on the dispatch tree, which was incorrect.

/cc @as-cii 
/cc @ConradIrwin

Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
2024-11-05 16:42:50 -07:00
Will Bradley
7931342455 Fix typo in Ansible docs (#20267)
fix typo in Ansible docs.

Release Notes:

- N/A
2024-11-05 16:31:39 -07:00
Kirill Bulatov
282f6241b7 Fix outline panel selection races (#20263)
Follow-up of https://github.com/zed-industries/zed/pull/20211

Release Notes:

- N/A
2024-11-06 00:54:15 +02:00
Conrad Irwin
73bbdd4456 Allow vim macros in visual mode (#20261)
Closes #19764

Release Notes:

- vim: Fixed `q` and `@` in visual mode
2024-11-05 15:52:02 -07:00
Conrad Irwin
236498408f Use zed-style shifted letters (#20254)
Release Notes:

- vim: Fixed some shortcuts to render correctly in Command
2024-11-05 15:51:52 -07:00
Conrad Irwin
86ff6e2c8e vim: Fix paragraphs with softwrap (#20259)
Closes #19778

Release Notes:

- vim: Fixed paragraph object in the presence of softwrap
2024-11-05 15:32:44 -07:00
Conrad Irwin
4bf6fb217e vim: Fix search in the Assistant (#20258)
Closes #17704

Release Notes:

- vim: Fix search in the assistant panel
2024-11-05 15:08:01 -07:00
Mikayla Maki
c527f2e212 Prevent extra line break on long token at start of rewrap (#20256)
Closes #19532

Release Notes:

- Fixed a bug where rewrapping with a long word at the start of the line
would cause a new line to be inserted.

Co-authored-by: Will Bradley <will@zed.dev>
2024-11-05 14:58:07 -07:00
Peter Tripp
47defa2849 docs: Add documentation for configuring clangd in C-only mode (#20255) 2024-11-05 16:43:31 -05:00
Will Bradley
6dfff1b46d Improve rewrap for ideographic writing systems (#20218)
Closes #19733

Before:

https://github.com/user-attachments/assets/5399e8fd-2687-445a-a8ab-023c348aff3f

After:

https://github.com/user-attachments/assets/b4ea5cb6-92ec-49ae-a982-194a1fc68d88

Release Notes:

- improve handling of text wrapping in Rewrap for some ideographic
writing systems

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-11-05 14:22:21 -07:00
Conrad Irwin
66e06616db Don't write temp files for telemetry logs (#20209)
This still keeps a telemetry.log for the current session, but not one
file per load of zed.

Closes: #20045

Release Notes:

- Fixed a bug where Zed would create a new temporary file on each boot
for telemetry logs
2024-11-05 14:05:51 -07:00
Conrad Irwin
765626a007 Disable /search by default (#20252)
This stops us sending GetCachedEmbeddings requests which frequently time
out
after 10s, and block the collab connection.

Release Notes:

- N/A
2024-11-05 14:05:10 -07:00
Kirill Bulatov
27cdc6cb93 Reuse focused buffer search query in the project search (#20253)
Closes https://github.com/zed-industries/zed/issues/10011

Release Notes:

- Reuse focused buffer search query in the project search
([#10011](https://github.com/zed-industries/zed/issues/10011))
2024-11-05 22:57:08 +02:00
Conrad Irwin
87ba5fd7bc Rebuild SSH installation (#20220)
Closes #ISSUE

This refactors SSH installation to require less shell stuff. We'd like
to
support arbitrary remote hosts, and unfortunately csh/tcsh have quoting
rules
that make it impossible to run multi-line scripts.

The primary changes are:
* The target path now contains the version:
`./zed_server/zed-remote-server-{release_channel}-{version}`
* We do all our processing in a temporary file and `mv` it into place.
* We do fewer calls to `ssh_command` overall. With the previous two
changes we can avoid lock files, and fuser calls. Instead cleanup of old
binaries now happens in `execute_run`.
* We only try to install the remote server when the connection is
established, not on each project open.

This should also put us in a good position if we want to pre-emptively
install new versions when the auto-updater detects an update for the
running version of zed (but that's not wired up yet)

Release Notes:

- Remoting: Fixed remoting when the remote runs `tcsh`
- Remoting: Improved latency of connecting
2024-11-05 13:37:54 -07:00
Kartik Vashistha
7c72929f0b docs: Add Ansible language documentation (#20087)
Co-authored-by: Peter Tripp <peter@zed.dev>
2024-11-05 13:57:15 -05:00
Danilo Leal
9e49894ed6 assistant: Remove the selection action as an extra option (#20234)
This PR should only be merged after
https://github.com/zed-industries/zed/pull/19988. Once the selection
action is added as a "proper" slash command, there's no need to have it
duplicate on the "Add Context" menu anymore. 😄

Release Notes:

- N/A
2024-11-05 15:00:43 -03:00
Tristan Marechaux
2364804f17 assistant: Implement /selection slash command (#19988)
- Closes #18868

## Summary
This PR introduces a new slash command `/selection` to enhance the
usability of the assistant's quote selection feature.

## Changes Made
1. Extracted a function from the `assistant: quote selection` action to
find the selected text and format it as an assistant section.
2. Created a new slash command `/selection` that utilizes the extracted
function to achieve the same effect as the existing `assistant: quote
selection` action.
3. Updated the documentation to include information about the new
`/selection` slash command.


Release Notes:

- Moved the text selection action to a slash command (`/selection`) in
the assistant panel

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-11-05 18:42:10 +01:00
Peter Tripp
db11a3b554 ci: Update issue templates. Rename defect to bug and improve log formatting (#20246) 2024-11-05 12:07:17 -05:00
Danilo Leal
d0ca49f0e1 Make project search inputs full width (#20242)
Closes https://github.com/zed-industries/zed/issues/13099

This PR main thing is making the inputs in the project search full
width, but it also has some slight design and UI code improvements here
and there, such as extracting the common input styles to its own
variable.

I figure that the reason why the inputs weren't full width before is
just because it'd be hard to reach for the buttons when in a large
monitor with the app maximised _and_ with a single tab open. However, I
do feel like it's common not to have these conditions in place, too,
which make the small inputs too small, like the issue states. At the
very least, we also have the keybindings.

Here's the final result:

| Small window size | Big window size |
|--------|--------|
| <img width="1279" alt="Screenshot 2024-11-05 at 11 18 08"
src="https://github.com/user-attachments/assets/73548300-1ad2-4ed0-b99f-adb3212ac163">
| <img width="2992" alt="Screenshot 2024-11-05 at 11 24 06"
src="https://github.com/user-attachments/assets/3a1ccabd-2350-42f0-8e31-112f27da98a4">
|

Release Notes:

- N/A
2024-11-05 13:04:42 -03:00
Vladimir Varankin
d6fcd9853a keymaps: Fix how single line editor handles new lines in BufferSearch (#19316)
Updates JetBrains keymap to handle the `shift-enter` as the `SelectPrevMatch` action.
2024-11-05 11:00:26 -05:00
Alex Viscreanu
bc3550d991 workspace: Add settings to dim inactive panes and highlight active pane (#18968)
Closes #12529
Closes #8639

Release Notes:

- Added option to dim inactive panes
([#12529](https://github.com/zed-industries/zed/issues/12529))
- Added option to highlight active pane with a border
([#8639](https://github.com/zed-industries/zed/issues/8639))

BREAKING: `active_pane_magnification` value is no longer used, it should
be migrated to `active_pane_modifiers.magnification`


![panes](https://github.com/user-attachments/assets/b19959bc-4c06-4320-be36-412113143af5)

> note: don't know much rust, so I wouldn't be surprised if stuff can be
done much better, happy to update things after the review.
Also, wasn't sure about introducing the new object in the settings, but
it felt better than adding two more keys to the root, let me know what
you think and if there's a better way to do this. Also happy to get
feedback on the text itself, as I didn't spend much thinking how to
document this.
2024-11-05 17:26:07 +02:00
1dNDN
b8501199c2 Fix name of vcpp libs in windows build guide (#20240)
It is not obvious that you need to choose the latest one from the same
libraries, especially in non-English locales

Release Notes:

- N/A
2024-11-05 16:00:22 +02:00
Thorsten Ball
7fb9549098 vim: Fix d shift-g not deleting until EOD if soft-wrap is on (#20160)
This previously didn't work: `d G` would delete to the end of the "first
of the soft-wrapped lines" of the last line.

To fix it, we special case the delete behavior for `shift-g`, which is
what Neovim also seems to do.


Release Notes:

- Fixed `d G` in Vim mode not deleting until the actual end of the
document if soft-wrap is turned on.
2024-11-05 14:47:14 +01:00
Piotr Osiewicz
4097118070 ui: Fix scrollbar content size calculation for non-uniform lists with single element (#20237)
Previously we were always adding the origin coordinate of last item to
the content size, which is incorrect when the list has just one item; in
that case, we should just use the size of that item as the content size
of a list.

Closes #ISSUE

Release Notes:

- N/A
2024-11-05 14:32:13 +01:00
Stanislav Alekseev
a26c0a8537 Fix toolchain detection for worktree-local paths (#20229)
Reimplements `pet::EnvironmentApi`, trying to access the `project_env`
first
Closes #20177 

Release Notes:

- Fixed python toolchain detection when worktree local path is set
2024-11-05 14:25:18 +01:00
Stephan Aßmus
f8bd6c66f4 Fix cursor shape flickering and dead-zone on 1px border around list items in project and outline panels (#20202)
Move click listener to outer div
- Avoids dead area when clicking the 1px border around a list item
- Avoids flickering cursor shape when moving the cursor above the list,
and especially when scrolling the list with a stationary cursor.

Closes #15614

Release Notes:

- Fixed mouse cursor shape flickering in project and outline panels when
crossing items
([#15614](https://github.com/zed-industries/zed/issues/15614))

---------

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2024-11-05 14:26:20 +02:00
Danilo Leal
02b1e3a3c1 assistant: Adjust the toolbar design (#20101)
This PR's most relevant change is removing the three-dot menu dropdown
from the assistant toolbar. The "Regenerate Title" button is now only
visible on hover and it appears on the far right of the title input.

<img width="700" alt="Screenshot 2024-11-04 at 13 31 37"
src="https://github.com/user-attachments/assets/891703af-7985-4b16-bb5e-d852491abd6f">

Release Notes:

- N/A
2024-11-05 09:07:26 -03:00
Alvaro Parker
83ad28dfe7 Remove duplicate load_system_fontscall (#19374)
Related comment on issue
https://github.com/zed-industries/zed/issues/14222#issuecomment-2418375056

On `crates/gpui/src/platform/linux/text_system.rs` on method
`CosmicTextSystem::new` `load_system_fonts` is being called twice:
```rust
    pub(crate) fn new() -> Self {
        let mut font_system = FontSystem::new();

        // todo(linux) make font loading non-blocking
        font_system.db_mut().load_system_fonts();

        Self(RwLock::new(CosmicTextSystemState {
            font_system,
            swash_cache: SwashCache::new(),
            scratch: ShapeBuffer::default(),
            loaded_fonts_store: Vec::new(),
            font_ids_by_family_cache: HashMap::default(),
            postscript_names: HashMap::default(),
        }))
    }
```

First one on `FontSystem::new()` and second one is explicit on
`font_system.db_mut().load_system_fonts()`. The first call
`FontSystem::new()` is defined as:
```
    pub fn new() -> Self {
        Self::new_with_fonts(core::iter::empty())
    }
```
And `new_with_fonts`: 
```rust
    /// Create a new [`FontSystem`] with a pre-specified set of fonts.
    pub fn new_with_fonts(fonts: impl IntoIterator<Item = fontdb::Source>) -> Self {
        let locale = Self::get_locale();
        log::debug!("Locale: {}", locale);

        let mut db = fontdb::Database::new();

        //TODO: configurable default fonts
        db.set_monospace_family("Fira Mono");
        db.set_sans_serif_family("Fira Sans");
        db.set_serif_family("DejaVu Serif");

        Self::load_fonts(&mut db, fonts.into_iter());

        Self::new_with_locale_and_db(locale, db)
    }
```
Finally `Self::load_fonts(&mut db, fonts.into_iter())` calls
`load_system_fonts`:
```rust
    #[cfg(feature = "std")]
    fn load_fonts(db: &mut fontdb::Database, fonts: impl Iterator<Item = fontdb::Source>) {
        #[cfg(not(target_arch = "wasm32"))]
        let now = std::time::Instant::now();

        db.load_system_fonts();

        for source in fonts {
            db.load_font_source(source);
        }
        ...
```

Release Notes:

- Remove duplicate font loading on Linux
2024-11-05 12:43:22 +02:00
Conrad Irwin
17b9d1976f Fix buffer restoration on ssh projects (#20215)
Closes #20143

Release Notes:

- Remoting: Fixed a panic restoring unsaved untitled buffers over SSH
2024-11-04 23:05:52 -07:00
Kirill Bulatov
3856599853 Improve project search performance (#20211)
Follow-up of https://github.com/zed-industries/zed/pull/20171

Reduces time Zed needs to reach maximum search results by an order of a
magnitude.

Methodology: 
* plugged-in mac with Instruments and Zed open
* Zed is restarted before each measurement, `zed` project is opened, a
*.rs file is opened and rust-analyzer is fully loaded, file is closed
then
* from an "empty" state, a `test` word is searched in the project search
* each version is checked with project panel; and then, separately,
without it
* after we reach maximum test results (the counter stops at `10191+`),
the measurement stops

Zed Dev is compiled and installed with `./script/bundle-mac -li`

------------------------


[measurements.trace.zip](https://github.com/user-attachments/files/17625516/measurements.trace.zip)

Before:

* Zed Nightly with outline panel open

<img width="1113" alt="image"
src="https://github.com/user-attachments/assets/62b29a69-c266-4d46-8c3c-0e9534ca7967">

Took over 30s to load the result set

* Zed Nightly without outline panel

<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/82d8d9d6-e8f2-4e67-af55-3f54a7c1d92d">

Took over 24s to load the result set

* Zed Dev with outline panel open

<img width="1131" alt="image"
src="https://github.com/user-attachments/assets/15605ff8-0787-428e-bbb6-f8496f7e1d43">

Took around 6s to load the result set (the profile was running a bit
longer)

* Zed Dev without outline panel

<img width="1147" alt="image"
src="https://github.com/user-attachments/assets/0715d73e-f41a-4d74-a604-a3a96ad8d585">

Took around 5s to load the result set

---------------------

Improvements in the outline panel:

* https://github.com/zed-industries/zed/pull/20171 ensured we reuse
previous rendered search results from the outline panel
* all search results are now rendered in the background thread
* only the entries that are rendered with gpui are sent to the
background thread for rendering
* FS entries' update logic does nothing before the debounce now

Improvements in the editor:

* cursor update operations are debounced and all calculations start
after the debounce only
* linked edits are now debounced and all work is done after the debounce
only

Further possible improvements:

* we could batch calculations of text coordinates, related to the search
entries: right now, each search match range is expanded around and
clipped, then fitted to the closest surrounding whitespace (if any,
otherwise it's just trimmed).
Each such calculation requires multiple tree traversals, which is
suboptimal and causes more CPU usage than we could use.

* linked edits are always calculated, even if the language settings have
it disabled, or the corresponding language having no corresponding
capabilities

Release Notes:

- Improve large project search performance
2024-11-05 03:49:37 +02:00
Ganesh Gupta
81dd4ca1c9 Fix a typo (#20210)
Release Notes:

- N/A
2024-11-05 02:02:50 +02:00
Piotr Osiewicz
2965119201 project panel: scroll when drag-hovering over the edge of a list (#20207)
Closes [19554](https://github.com/zed-industries/zed/issues/19554)

Release Notes:

- Added auto-scrolling to project panel when a vertical edge of a panel
is hovered with a dragged entry.
2024-11-05 00:56:58 +01:00
Max Brunsfeld
258cf6c746 Add inclusive range scope overrides. Don't auto-close quotes at the ends of line comments (#20206)
Closes #9195
Closes #19787

Release Notes:

- Fixed an issue where single quotation marks were spuriously
auto-closed when typing in line comments
2024-11-04 15:36:39 -08:00
Richard Feldman
369de400be Make rewrapping take tabs more into account (#20196)
Closes #18686


https://github.com/user-attachments/assets/e87b4508-3570-4395-92b4-c5e0e9e19623


Release Notes:

- The Rewrap command now considers the width of each tab character at
the beginning of the line to be the configured tab size.

---------

Co-authored-by: Will <will@zed.dev>
2024-11-04 18:10:40 -05:00
Piotr Osiewicz
dc02894db4 editor: Add scrollbar to info popovers (#20184)
Related to https://github.com/zed-industries/zed/issues/5034

Release Notes:

- Added scrollbar to info popovers in editor.
2024-11-05 00:08:38 +01:00
Patrick Sy
966b18e142 assistant: Fix Gemini 1.5 Pro throwing "missing field 'index' at line N column M" (#20200)
Closes https://github.com/zed-industries/zed/issues/20033

- Fixed deserialization error of `GenerateContentCandidate` where `index` is unexpectedly nil
2024-11-04 17:01:08 -05:00
Elias Müller
2c7e71028d Fix selection extend/shrink on JetBrains keymap (#20199)
JetBrains IDE's use `ctrl-w` and `ctrl-shift-w` on Win/Linux and
`cmd-up` and `cmd-down` on mac to extend/shrink selections.

https://www.jetbrains.com/guide/java/tips/extend-selection/

Release Notes:

- Fixed extend/shrink selection on JetBrains keymap
2024-11-04 16:35:52 -05:00
Kirill Bulatov
24dba07a9b Do not alter soft wrap based on .editorconfig contents (#20198)
Closes https://github.com/zed-industries/zed/issues/20194

Release Notes:

- Fixed Zed incorrectly changing soft wrap based on .editorconfig
contents ([#20194](https://github.com/zed-industries/zed/issues/20194))
2024-11-04 23:31:40 +02:00
Marshall Bowers
16e9b4ceeb typescript: Improve installation checks for vtsls (#20197)
This PR improves the installation checks for `vtsls`.

Previously we were checking the installed version of TypeScript against
the latest available version to determine whether we needed to installed
the `vtsls` language server or not.

However, these are two independent concerns, so we should be checking
individually whether `typescript` or `@vtsls/language-server` need to be
installed/updated.

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

Release Notes:

- typescript: Fixed an issue where `@vtsls/language-server` may not have
been updated to the latest version.
2024-11-04 16:00:51 -05:00
Richard Feldman
bc4bd2e168 Don't conservatively include Suggest Edits token in token count (#20180)
Before: (note the 1.3k in the upper right corner instead of 3 in the
second screenshot)

<img width="459" alt="Screenshot 2024-11-04 at 11 37 58 AM"
src="https://github.com/user-attachments/assets/64c06aff-f7d2-42a4-a767-0d7a4ba0f486">

Now:
<img width="631" alt="Screenshot 2024-11-04 at 11 38 11 AM"
src="https://github.com/user-attachments/assets/22af974d-915a-41e1-9ee0-f0622901e242">

This was intended to be a conservative estimate in case you pressed
Suggest Edits (and therefore might have an unpleasant surprise if you
were under the context limit but Suggest Edits failed with a "too much
context" error message anyway, after the Suggest Edits context got added
for you behind the scenes).

However, in retrospect this design created more [confusion in the common
case](https://github.com/zed-industries/zed/pull/19900#issuecomment-2453456569)
because it made it look like more context had been actually consumed
than what was actually consumed.

This does raise a potential design question for the future: the Suggest
Edits button adds more context at the last minute without ever
communicating that it's going to do that.

In the meantime it seems best to go back to the less-confusing way of
reporting the token counts, especially since only users of the
experimental flag could possibly press Suggest Edits anyway.

Release Notes:

- Fixed issue where initial token count was over-reported as 1.3k
instead of 3 (for the context string "You").
2024-11-04 15:40:10 -05:00
Max Brunsfeld
4d3a18cbdc Fix two auto-indent issues with Markdown and YAML (#20193)
Closes #13376
Closes #13338

Release Notes:

- Fixed unhelpful auto-indent suggestions in markdown.
- Added `auto_indent_on_paste` setting, which can be used on a
per-language basis, to configure whether indentation should be adjusted
when pasting. This setting is enabled by default for languages other
than YAML and Markdown.
2024-11-04 12:29:38 -08:00
Conrad Irwin
cfcbfc1d82 Fix saving files as *.sql on macOS Sequoia (#20195)
Closes #16969

Release Notes:

- Fixed a bug in macOS Sequoia where you can't save a new file as
`*.sql`, it would rename to `.sql.s`. As a side effect you can no longer
save a new file as `*sql.s`. We hope to remove this workaround when the
operating system fixes its bug; in the meantime you can either set
`"use_system_path_prompts": false` in your settings file to skip the
macOS dialogues, or create new files by right clicking in the project
panel.
2024-11-04 13:23:59 -07:00
Avinash Thakur
c9ec235b12 Sort completions by relevance for strong matches (#20145)
Further enhancement:
On exploring VSCode's sorting logic, there are two major distinctions:
* A config option exists to adjust sort priority of snippets. They can
be placed inline (default), top or at bottom of completitions.
* The sorting order sorts by (in order): sort_text (lower case),
sort_text, kind

ref:
6f2d4781e8/src/vs/editor/contrib/suggest/browser/suggest.ts (L338-L383)

Closes #19786

Release Notes:

- Improved sort order in completions to show relevant matches first
([#19786](https://github.com/zed-industries/zed/issues/19786))
2024-11-04 22:23:36 +02:00
Marshall Bowers
8196db6022 settings: Include null in the type for optional settings (#20192)
This PR updates all settings that are defined as `Option`s to include
`null` in their type.

This prevents warnings from being displayed when `null` is used a
default value.

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

Release Notes:

- Updated the settings schema to allow `null` as a value for optional
settings instead of showing a warning.
2024-11-04 14:25:44 -05:00
Piotr Osiewicz
dc5fad52a3 diagnostics: Improve performance with large # of diagnostics (#20189)
Related to: https://github.com/zed-industries/zed/issues/19022

Release Notes:

- Improve editor performance with large # of diagnostics.

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-11-04 12:16:02 -07:00
Marshall Bowers
77de20c23a settings: Allow null as a value for font fallback fields (#20186)
This PR updates the `buffer_font_fallbacks` and `ui_font_fallbacks`
settings to allow `null` as a value instead of showing a warning.

Related to https://github.com/zed-industries/zed/issues/18006.

Release Notes:

- Updated the settings schema to allow `null` as a value for
`buffer_font_fallbacks` and `ui_font_fallbacks` instead of showing a
warning.
2024-11-04 12:58:10 -05:00
Nate Butler
e1cb8a66f0 Add pages to theme_preview (#20185)
Added some simple logic + an example of adding pages to the theme
preview. Will be used for organizing theme preview sections.

Release Notes:

- N/A
2024-11-04 12:57:36 -05:00
Marshall Bowers
7025d3f29d Extract outline rendering to outline crate (#20179)
This PR extracts the `render_item` implementation for outlines to the
`outline` crate to help reduce `language`'s dependence on `theme`.

Release Notes:

- N/A
2024-11-04 11:54:37 -05:00
Bennet Bo Fenner
4bbde40267 recent projects: Fix inconsistent keybinding with which window is replaced or not (#20176)
This removes the inconsistency between these two workflows:
- Clicking on the project name in the upper left shows:
<img width="333" alt="image"
src="https://github.com/user-attachments/assets/f54c34b4-67ab-4cbc-85ee-845c41aa4a8c">

- Using `projects: Open recent` shows:
<img width="337" alt="image"
src="https://github.com/user-attachments/assets/b1eb244f-ce28-4e6c-8404-b6cd88caef1e">

---

We now use `enter` to re-use the window and `cmd-enter` to open a new
window in both cases

Closes #16361

Release Notes:

- Fixed an inconsistency in the recent project picker, where different
keybindings would determine whether to reuse the window or not
2024-11-04 17:41:25 +01:00
Bennet Bo Fenner
15e7b67559 markdown preview: Refresh preview when file is changed outside of the editor (#20175)
Closes #20091

Release Notes:

- Fixed an issue where the markdown preview would not update when a
markdown file was changed outside of the editor
2024-11-04 17:23:32 +01:00
Mike Lloyd
f0aeab7d00 Add surround aliases (#20104)
Closes #19417

Release Notes:

- vim : Added `r` and `a` as aliases for `[` and `<` text objects
(copying vim-surround).
- vim: (breaking change) rebound the function argument text object to
`g`.
- vim: Fixed surrounds to allow `b`/`B`/`r`/`a` anywhere you could use
`(`, `{`, `[`, `<`.

---


- vim: Added `b`, `B`, `r`, `s`, `a` as aliases for `()`, `{}`, `[]`,
`<>` in vim surround mode.
- Adds a new `surround_alias` function where aliases are defined.
- This function is used in `find_surround_pairs` to substitute the
chosen text with the alias
- The keymap is also modified to add support for Square and Angle
brackets when changing surrounds. These two were added to follow the
example of Tim Pope's ubiquitous `vim-surround` plugin.
- I had to overwrite the `vim::Argument` keybind in order to do this. I
moved it to use the `g` modifier. I realize this is a breaking change
and will happily move the `vim::AngleBracket` keymap to a different
letter if you'd like to avoid this. I'm just trying to keep with
convention. Ideally, Users would be able to define surround aliases
themselves in the config file but that's a much bigger task than I'm
able to do right now.
- I also added tests for the new aliases.

Thanks for making such a clean and organized codebase. I was able to
find the relevant section of code rather quickly thanks to this.
2024-11-04 09:03:27 -07:00
bangbangsheshotmedown
4bbddcad31 extension: Add support for labelDetails for LSP completions (#20144)
Closes #14278


be7336e92a/src/completion.rs (L419-L429)


be7336e92a/src/completion.rs (L555-L572)


Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-11-04 11:02:19 -05:00
Pablo Portas López
1e944a51ff Delete a.py (#20173)
Release Notes:

- N/A
2024-11-04 10:41:44 -05:00
Kirill Bulatov
d90770c673 Actually reuse previous search entries (#20171)
Release Notes:

- Improved outline panel performance during large project searches
2024-11-04 17:21:09 +02:00
Peter Tripp
6316151a83 docs: Add redirect for /conversations (#20170)
Release Notes:

- N/A
2024-11-04 09:56:07 -05:00
Piotr Osiewicz
49a0a11c4f chore: Remove toolchain section from language settings (#20168)
Closes #ISSUE

Release Notes:

- N/A
2024-11-04 14:13:20 +01:00
Danilo Leal
376a45528d assistant: Improve role button loading state (#20125)
We've received feedback that it wasn't clear how to cancel/interrupt the
LLM while it's generating a response. Additionally, I also had folks
telling me that the loading state was hard to notice—the pulsating
animation is too subtle on its own. This PR attempts to improve both of
these things. The end result is:


![llm](https://github.com/user-attachments/assets/57a94f8a-c254-4011-adc0-7c63ed13daa1)

Release Notes:

- N/A
2024-11-04 10:12:27 -03:00
Jason Lee
20eeb78251 chore: Update BranchListDelegate to use WeakView<Workspace> (#20157) 2024-11-04 12:17:11 +02:00
Jonathan Toledo
67be6ec3b5 copilot: Add support for new models (#19968)
Closes #19963

This PR implements integration with the newly announced GitHub Copilot
LLM models, including:
- Claude 3.5 Sonnet
- o1-mini
- o1-preview

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-11-04 10:55:20 +01:00
Lilith Iris
070e5914c9 markdown renderer: Add copy icon button for code block (#19312)
Closes #19061

I don't know should i add tooltip or not

Before

![image](https://github.com/user-attachments/assets/0729806b-9b0d-442a-8f71-92c0443f34ef)

After

![image](https://github.com/user-attachments/assets/08eb5178-4139-44e7-a23f-50133233911d)

Release Notes:

- Markdown Preview: Added button to copy code blocks.

---------

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-11-04 10:40:46 +01:00
Kirill Bulatov
c41a8e33a0 Fix file reloading not populating the history (#20156)
Closes https://github.com/zed-industries/zed/issues/20111
Closes https://github.com/zed-industries/zed/issues/20153

cc @mikayla-maki and @ConradIrwin 

Release Notes:

- Fixed undo stack corruption on external file changes
([#20111](https://github.com/zed-industries/zed/issues/20111))
([#20153](https://github.com/zed-industries/zed/issues/20153))

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-11-04 11:30:15 +02:00
Bennet Bo Fenner
25443a91ca image viewer: Show path in breadcrumbs (#20155)
Closes #10057

<img width="354" alt="image"
src="https://github.com/user-attachments/assets/47afe8fd-c8ac-45af-be9a-9ca8c5e066f6">

Release Notes:

- Show path in breadcrumbs/toolbar when opening an image
2024-11-04 10:18:21 +01:00
Roshan Padaki
8e00caf23b go: Add go-generate runnables and tasks (#19987)
I was missing the `go generate` runnable from other editors so I figured
I'd implement one here! Now, comments of the form `//go:generate` can
prompt for the `go generate <package>` task. Meanwhile, I've also added
a global `go generate ./...` task.

~When making the global task, I noticed that the existing `go test
./...` task runs tests in subdirectories of the CWD of the active
editor, whereas I would really expect it to run all tests across my
project. I have changed to use the latter behavior (run relative to
project root) for both `go generate ./...` and `go test ./...`. Please
let me know if the prior behavior was intended, and I can revert.~

Release Notes:

- Added runnable and tasks for `go generate` commands
2024-11-04 10:13:15 +01:00
Bennet Bo Fenner
9a869f0c5f project panel: Focus editor when single-clicking on file and preview tabs are disabled (#20154)
Closes #4324

Release Notes:

- Fixed an issue where single-clicking on a file in the project panel
would not focus the editor, when preview tabs are disabled
2024-11-04 10:02:55 +01:00
Marc
de2483e132 terminal: Do not show multibuffer hint when in centered pane (#20137)
Co-Authored-by: Bennet <bennet@zed.dev>


![image](https://github.com/user-attachments/assets/581f493e-aa9b-4767-8029-6ab83755336b)

Release Notes:

- Fixed an issue where the multibuffer hint was shown when terminal was
in centered mode

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-04 09:19:48 +01:00
Michael Sloan
95259bf9fe Add michael@zed.dev to .mailmap (#20119)
Release Notes:

- N/A
2024-11-04 09:17:53 +02:00
Henry Barreto
3b76ba6d5a docs: Align soft_wrap reference with naming pattern used (#20080)
Release Notes:

- N/A
2024-11-02 20:29:56 +02:00
Richard Feldman
773a3b335e Expand selections to Replace block boundaries (#20092)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-11-01 16:10:19 -04:00
Conrad Irwin
b5c38e9a09 Remoting: Fix connecting to servers with long hostnames (#20093)
Closes #20018

Release Notes:

- Remoting: Fixed connecting to hosts with long (>~50 character)
hostnames
2024-11-01 13:52:21 -06:00
Marshall Bowers
273173ec8a Revert "theme: Turn ThemeRegistry into a trait (#20076)" (#20094)
This PR reverts #20076 to turn the `ThemeRegistry` back into a regular
struct again.

It doesn't actually help us by having it behind a trait.

Release Notes:

- N/A
2024-11-01 15:34:20 -04:00
Conrad Irwin
4084ba36f9 Fix clang popovers (#20090)
Closes  #15498

Release Notes:

- Fixed info popups from clangd missing information
2024-11-01 13:28:34 -06:00
Marshall Bowers
770886880f Add new extension crate (#20089)
This PR adds a new `extension` crate, containing some contents extracted
from the `extension_host`.

Right now it contains just the `ExtensionManifest` and
`ExtensionBuilder`, although we may move more of the extension interface
into here.

The introduction of the `extension` crate allows us to depend on it in
the `extension_cli`, thereby eliminating the need for the `no-webrtc`
feature on a number of crates.

Release Notes:

- N/A
2024-11-01 13:20:30 -04:00
Marshall Bowers
ea44c510a3 Rename extension crate to extension_host (#20081)
This PR renames the `extension` crate to `extension_host`.

This is to free up the name so that we can create a smaller-scoped
`extension` crate.

Release Notes:

- N/A
2024-11-01 12:53:02 -04:00
Kirill Bulatov
c8f1969916 Fix the outline panel's focus tracking (#20083)
Closes https://github.com/zed-industries/zed/issues/20073

Release Notes:

- Fixed outline panel navigation
([https://github.com/zed-industries/zed/issues/20073](#20073))

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-11-01 18:01:10 +02:00
Marshall Bowers
a960344301 theme: Remove unused staff parameter for listing themes (#20077)
This PR removes the `staff` parameter for listing themes, as it was not
used.

Release Notes:

- N/A
2024-11-01 10:54:21 -04:00
Marshall Bowers
af9e7f1f96 theme: Turn ThemeRegistry into a trait (#20076)
This PR converts the `ThemeRegistry` type into a trait instead of a
concrete implementation.

This allows for the extension store to depend on an abstraction rather
than the concrete theme registry implementation.

We currently have two `ThemeRegistry` implementations:

- `RealThemeRegistry` — this was previously the `ThemeRegistry` and
contains the real implementation of the registry.
- `VoidThemeRegistry` — a null object that doesn't have any behavior.

Release Notes:

- N/A
2024-11-01 10:19:09 -04:00
renovate[bot]
c04c439d23 Update Rust crate async-compression to v0.4.17 (#19319)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[async-compression](https://redirect.github.com/Nullus157/async-compression)
| workspace.dependencies | patch | `0.4.13` -> `0.4.17` |

---

### Release Notes

<details>
<summary>Nullus157/async-compression (async-compression)</summary>

###
[`v0.4.17`](https://redirect.github.com/Nullus157/async-compression/blob/HEAD/CHANGELOG.md#0417---2024-10-20)

[Compare
Source](https://redirect.github.com/Nullus157/async-compression/compare/v0.4.16...v0.4.17)

##### Fixed

-   Fix occasional panics when consuming from pending buffers.

###
[`v0.4.16`](https://redirect.github.com/Nullus157/async-compression/blob/HEAD/CHANGELOG.md#0416---2024-10-16)

[Compare
Source](https://redirect.github.com/Nullus157/async-compression/compare/v0.4.15...v0.4.16)

##### Other

- Implement pass-through `AsyncBufRead` on write-based encoders &
decoders.

###
[`v0.4.15`](https://redirect.github.com/Nullus157/async-compression/blob/HEAD/CHANGELOG.md#0415---2024-10-13)

[Compare
Source](https://redirect.github.com/Nullus157/async-compression/compare/v0.4.14...v0.4.15)

##### Feature

- Implement pass-through `AsyncRead` or `AsyncWrite` where appropriate.
- Relax `AsyncRead`/`AsyncWrite` bounds on `*::{get_ref, get_mut,
get_pin_mut, into_inner}()` methods.

###
[`v0.4.14`](https://redirect.github.com/Nullus157/async-compression/blob/HEAD/CHANGELOG.md#0414---2024-10-10)

[Compare
Source](https://redirect.github.com/Nullus157/async-compression/compare/v0.4.13...v0.4.14)

##### Fixed

- In Tokio-based decoders, attempt to decode from internal state even if
nothing was read.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:11:16 +02:00
renovate[bot]
d3cd8f8f14 Update Rust crate proc-macro2 to v1.0.89 (#19326)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [proc-macro2](https://redirect.github.com/dtolnay/proc-macro2) |
dependencies | patch | `1.0.87` -> `1.0.89` |

---

### Release Notes

<details>
<summary>dtolnay/proc-macro2 (proc-macro2)</summary>

###
[`v1.0.89`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.89)

[Compare
Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.88...1.0.89)

- Ensure OUT_DIR is left with deterministic contents after build script
execution
([#&#8203;474](https://redirect.github.com/dtolnay/proc-macro2/issues/474))

###
[`v1.0.88`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.88)

[Compare
Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.87...1.0.88)

- Return accurate line and column from `Span::start` and `Span::end`
inside proc macros on nightly
([#&#8203;472](https://redirect.github.com/dtolnay/proc-macro2/issues/472))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:10:31 +02:00
renovate[bot]
cd8d776fe1 Update Rust crate profiling to v1.0.16 (#19334)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [profiling](https://redirect.github.com/aclysma/profiling) |
workspace.dependencies | patch | `1.0.15` -> `1.0.16` |

---

### Release Notes

<details>
<summary>aclysma/profiling (profiling)</summary>

###
[`v1.0.16`](https://redirect.github.com/aclysma/profiling/blob/HEAD/CHANGELOG.md#1016)

[Compare
Source](https://redirect.github.com/aclysma/profiling/compare/v1.0.15...v1.0.16)

-   Address warnings from upstream rustc changes
-   Update puffin to 0.19.1
-   Update tracing-tracy to 0.11.3 and tracing-subscriber to 0.3
-   Implement finish_frame! for tracing
-   Add fuction_scope!() as an alternative to the function proc macro
- Avoid local variable names that don't start with an underscore
introduced into a function's namespace

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:10:21 +02:00
renovate[bot]
6de2330253 Update Rust crate pathdiff to v0.2.2 (#19325)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pathdiff](https://redirect.github.com/Manishearth/pathdiff) |
workspace.dependencies | patch | `0.2.1` -> `0.2.2` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:10:09 +02:00
renovate[bot]
0e264b5a68 Update cloudflare/wrangler-action digest to b2a0191 (#19645)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[cloudflare/wrangler-action](https://redirect.github.com/cloudflare/wrangler-action)
| action | digest | `9681c29` -> `b2a0191` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:07:36 +02:00
renovate[bot]
1af5304074 Update Rust crate flume to v0.11.1 (#19641)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [flume](https://redirect.github.com/zesterer/flume) | dependencies |
patch | `0.11.0` -> `0.11.1` |

---

### Release Notes

<details>
<summary>zesterer/flume (flume)</summary>

###
[`v0.11.1`](https://redirect.github.com/zesterer/flume/blob/HEAD/CHANGELOG.md#0111---2024-10-19)

##### Added

-   `SendSink::sender`
- `SendFut`, `SendSink`, `RecvFut`, `RecvStream`, `WeakSender`, `Iter`,
`TryIter`, and `IntoIter` now implement `Debug`
-   Docs now show required features

##### Removed

##### Changed

-   `WeakSender` is now `Clone`
- `spin` feature no longer uses `std::thread::sleep` for locking except
on Unix-like operating systems and Windows
- Flume is now in [casual maintenance
mode](https://casuallymaintained.tech/).

##### Fixed

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:06:24 +02:00
renovate[bot]
dde692eb88 Update Rust crate libc to v0.2.161 (#19650)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [libc](https://redirect.github.com/rust-lang/libc) |
workspace.dependencies | patch | `0.2.159` -> `0.2.161` |

---

### Release Notes

<details>
<summary>rust-lang/libc (libc)</summary>

###
[`v0.2.161`](https://redirect.github.com/rust-lang/libc/releases/tag/0.2.161)

[Compare
Source](https://redirect.github.com/rust-lang/libc/compare/0.2.160...0.2.161)

##### Fixed

- OpenBSD: fix `FNM_PATHNAME` and `FNM_NOESCAPE` values
[#&#8203;3983](https://redirect.github.com/rust-lang/libc/pull/3983)

###
[`v0.2.160`](https://redirect.github.com/rust-lang/libc/releases/tag/0.2.160)

[Compare
Source](https://redirect.github.com/rust-lang/libc/compare/0.2.159...0.2.160)

##### Added

- Android: add `PR_GET_NAME` and `PR_SET_NAME`
[#&#8203;3941](https://redirect.github.com/rust-lang/libc/pull/3941)
- Apple: add `F_TRANSFEREXTENTS`
[#&#8203;3925](https://redirect.github.com/rust-lang/libc/pull/3925)
- Apple: add `mach_error_string`
[#&#8203;3913](https://redirect.github.com/rust-lang/libc/pull/3913)
- Apple: add additional `pthread` APIs
[#&#8203;3846](https://redirect.github.com/rust-lang/libc/pull/3846)
- Apple: add the `LOCAL_PEERTOKEN` socket option
[#&#8203;3929](https://redirect.github.com/rust-lang/libc/pull/3929)
- BSD: add `RTF_*`, `RTA_*`, `RTAX_*`, and `RTM_*` definitions
[#&#8203;3714](https://redirect.github.com/rust-lang/libc/pull/3714)
- Emscripten: add `AT_EACCESS`
[#&#8203;3911](https://redirect.github.com/rust-lang/libc/pull/3911)
- Emscripten: add `getgrgid`, `getgrnam`, `getgrnam_r` and `getgrgid_r`
[#&#8203;3912](https://redirect.github.com/rust-lang/libc/pull/3912)
- Emscripten: add `getpwnam_r` and `getpwuid_r`
[#&#8203;3906](https://redirect.github.com/rust-lang/libc/pull/3906)
- FreeBSD: add `POLLRDHUP`
[#&#8203;3936](https://redirect.github.com/rust-lang/libc/pull/3936)
- Haiku: add `arc4random`
[#&#8203;3945](https://redirect.github.com/rust-lang/libc/pull/3945)
- Illumos: add `ptsname_r`
[#&#8203;3867](https://redirect.github.com/rust-lang/libc/pull/3867)
- Linux: add `fanotify` interfaces
[#&#8203;3695](https://redirect.github.com/rust-lang/libc/pull/3695)
- Linux: add `tcp_info`
[#&#8203;3480](https://redirect.github.com/rust-lang/libc/pull/3480)
- Linux: add additional AF_PACKET options
[#&#8203;3540](https://redirect.github.com/rust-lang/libc/pull/3540)
- Linux: make Elf constants always available
[#&#8203;3938](https://redirect.github.com/rust-lang/libc/pull/3938)
- Musl x86: add `iopl` and `ioperm`
[#&#8203;3720](https://redirect.github.com/rust-lang/libc/pull/3720)
- Musl: add `posix_spawn` chdir functions
[#&#8203;3949](https://redirect.github.com/rust-lang/libc/pull/3949)
- Musl: add `utmpx.h` constants
[#&#8203;3908](https://redirect.github.com/rust-lang/libc/pull/3908)
- NetBSD: add `sysctlnametomib`, `CLOCK_THREAD_CPUTIME_ID` and
`CLOCK_PROCESS_CPUTIME_ID`
[#&#8203;3927](https://redirect.github.com/rust-lang/libc/pull/3927)
- Nuttx: initial support
[#&#8203;3909](https://redirect.github.com/rust-lang/libc/pull/3909)
- RTEMS: add `getentropy`
[#&#8203;3973](https://redirect.github.com/rust-lang/libc/pull/3973)
- RTEMS: initial support
[#&#8203;3866](https://redirect.github.com/rust-lang/libc/pull/3866)
- Solarish: add `POLLRDHUP`, `POSIX_FADV_*`, `O_RSYNC`, and
`posix_fallocate`
[#&#8203;3936](https://redirect.github.com/rust-lang/libc/pull/3936)
- Unix: add `fnmatch.h`
[#&#8203;3937](https://redirect.github.com/rust-lang/libc/pull/3937)
- VxWorks: add riscv64 support
[#&#8203;3935](https://redirect.github.com/rust-lang/libc/pull/3935)
- VxWorks: update constants related to the scheduler
[#&#8203;3963](https://redirect.github.com/rust-lang/libc/pull/3963)

##### Changed

- Redox: change `ino_t` to be `c_ulonglong`
[#&#8203;3919](https://redirect.github.com/rust-lang/libc/pull/3919)

##### Fixed

- ESP-IDF: fix mismatched constants and structs
[#&#8203;3920](https://redirect.github.com/rust-lang/libc/pull/3920)
- FreeBSD: fix `struct stat` on FreeBSD 12+
[#&#8203;3946](https://redirect.github.com/rust-lang/libc/pull/3946)

##### Other

- CI: Fix CI for FreeBSD 15
[#&#8203;3950](https://redirect.github.com/rust-lang/libc/pull/3950)
- Docs: link to `windows-sys`
[#&#8203;3915](https://redirect.github.com/rust-lang/libc/pull/3915)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:06:16 +02:00
renovate[bot]
cec72b837e Update Rust crate linkme to v0.3.29 (#19657)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [linkme](https://redirect.github.com/dtolnay/linkme) | dependencies |
patch | `0.3.28` -> `0.3.29` |

---

### Release Notes

<details>
<summary>dtolnay/linkme (linkme)</summary>

###
[`v0.3.29`](https://redirect.github.com/dtolnay/linkme/releases/tag/0.3.29)

[Compare
Source](https://redirect.github.com/dtolnay/linkme/compare/0.3.28...0.3.29)

- Add UEFI target support
([#&#8203;100](https://redirect.github.com/dtolnay/linkme/issues/100),
thanks [@&#8203;Javagedes](https://redirect.github.com/Javagedes))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 16:06:04 +02:00
Piotr Osiewicz
95842c7987 gpui: Add scroll anchors (#19894)
## Problem statement
I want to add keyboard navigation support to SSH modal. Doing so is
possible in current landscape, but not particularly ergonomic;
`gpui::ScrollHandle` has `scroll_to_item` API that takes an index of the
item you want to scroll to. The problem is, however, that it only works
with it's immediate children - thus in order to support scrolling via
keyboard you have to bend your UI to have a particular layout. Even when
your list of items is perfectly flat, having decorations inbetween items
is problematic as they are also children of the list, which means that
you either have to maintain the mapping to devise a correct index of an
item that you want to scroll to, or you have to make the decoration a
part of the list item itself, which might render the scrolling imprecise
(you might e.g. not want to scroll to a header, but to a button beneath
it).

## The solution
This PR adds `ScrollAnchor`, a new kind of handle to the gpui. It has a
similar role to that of a ScrollHandle, but instead of tracking how far
along an item has been scrolled, it tracks position of an element
relative to the parent to which a given scroll handle belongs. In short,
it allows us to persist the position of an element in a list of items
and scroll to it even if it's not an immediate children of a container
whose scroll position is tracked via an associated scroll handle.
Additionally this PR adds a new kind of the container to the UI crate
that serves as a convenience wrapper for using ScrollAnchors. This
container provides handlers for `menu::SelectNext` and
`menu::SelectPrev` and figures out which item should be focused next.

Release Notes:

- Improve keyboard navigation in ssh modal
2024-11-01 14:47:46 +01:00
Kirill Bulatov
183e3664cc Mention spectre-mitigated libs component in the Windows docs (#20069)
Closes https://github.com/zed-industries/zed/issues/20066

Release Notes:

- N/A
2024-11-01 13:43:35 +02:00
Yury Zhuravlev
08b124c8d4 Add possibility to build without musl (#19813)
Closes #19803 

Ad



Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-11-01 09:25:45 +02:00
Conrad Irwin
ea08026cd0 vim: Make window shortcuts work in other contexts (#20058)
Closes #18552

Release Notes:

- vim: Extended `ctrl-w` to work in non-editor contexts (like markdown
preview, or screen shares)
2024-10-31 23:49:43 -06:00
Conrad Irwin
daa9939c03 vim: o should scroll (#20054)
Closes: #19684

Release Notes:

- vim: Fixed `o` not scrolling new head into view
2024-10-31 23:26:04 -06:00
Conrad Irwin
f757e5a6c3 vim: Add :noh[lsearch] (#20056)
Closes: #18590

Release Notes:

- vim: Add :noh[lsearch]
2024-10-31 23:25:59 -06:00
Conrad Irwin
ecb874db62 vim: Fix gU$ (#20057)
Closes: #19380

Release Notes:

- vim: Fixed `gu$` missing last character of the line
2024-10-31 23:25:54 -06:00
Conrad Irwin
75f1862268 vim: Add (half of) ctrl-v/ctrl-q (#19585)
Release Notes:

- vim: Add `ctrl-v`/`ctrl-q` to type any unicode code point. For example
`ctrl-v escape` inserts an escape character(U+001B), or `ctrl-v u 1 0 E
2` types ტ (U+10E2). As in vim `ctrl-v ctrl-j` inserts U+0000 not
U+000A. Zed does not yet implement insertion of the vim-specific
representation of the typed keystroke for other keystrokes.
- vim: Add `ctrl-shift-v` as an alias for paste on Linux
2024-10-31 23:25:42 -06:00
Conrad Irwin
f8ab86f930 Simplify line normalization (#19712)
Release Notes:

- Added \u2028 and \u2029 to invisible characters. Previously these were
treated as \n.
2024-10-31 22:24:24 -06:00
Conrad Irwin
155854d9a9 Fix trigger release? (#20053)
Release Notes:

- N/A
2024-10-31 20:45:11 -06:00
Kyle Kelley
5b6578247f Upgrade nbformat and runtimelib (#20050)
Fixes an issue on load of notebooks that have `text/*` output in
`Vec<String>` rather than `String`. This ensures that Markdown output
will render correctly.

<img width="1306" alt="image"
src="https://github.com/user-attachments/assets/0bcc7dc8-527f-4067-a916-3ae569ea197d">


Release Notes:

- N/A
2024-10-31 17:58:36 -07:00
Boris Cherny
b87c4a1e13 assistant: Add health telemetry (#19928)
This PR adds a bit of telemetry for Anthropic models, in order to
understand model health. With this logging, we can monitor and diagnose
dips in performance, for example due to model rollouts.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-10-31 16:21:26 -07:00
Conrad Irwin
a0988508f0 SSHHELL escaping.... (#20046)
Closes #20027 
Closes #19976 (again)

Release Notes:

- Remoting: Fixed remotes with non-sh/bash/zsh default shells
- Remoting: Fixed remotes running busybox's version of gunzip
2024-10-31 16:10:03 -06:00
Nate Butler
a347c4def7 Add theme preview (#20039)
This PR adds a theme preview tab to help get an at a glance overview of
the styles in a theme.

![CleanShot 2024-10-31 at 11 27
18@2x](https://github.com/user-attachments/assets/798e97cf-9f80-4994-b2fd-ac1dcd58e4d9)

You can open it using `debug: open theme preview`.

The next major theme preview PR will move this into it's own crate, as
it will grow substantially as we add content.

Next for theme preview:

- Update layout to two columns, with controls on the right for selecting
theme, layer/elevation-index, etc.
- Cover more UI elements in preview
- Display theme colors in a more helpful way
- Add syntax & markdown previews


Release Notes:

- Added a way to preview the current theme's styles with the `debug:
open theme preview` command.
2024-10-31 11:40:38 -04:00
renovate[bot]
9c77bcc827 Update actions/setup-node digest to 39370e3 (#19979)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-node](https://redirect.github.com/actions/setup-node) |
action | digest | `0a44ba7` -> `39370e3` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMzUuMiIsInVwZGF0ZWRJblZlciI6IjM4LjEzNS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-31 11:28:37 -04:00
Marshall Bowers
8d1f377bf0 assistant: Add example streaming slash command (#20034)
This PR adds a `/streaming-example` slash command for the purposes of
showcasing streaming during development.

This slash command is only available to staff and isn't intended to be
shipped to the general public.

Release Notes:

- N/A
2024-10-31 10:53:47 -04:00
Kirill Bulatov
f766f6ceae Do less work when revealing entries in the outline panel (#20031)
Before this change, we were trying to determine current element before
debouncing, causing a lot of extra work on caret movement. Now, we only
do this for the task that managed to wait the entire debounce period.

Closes https://github.com/zed-industries/zed/issues/19817
Closes https://github.com/zed-industries/zed/issues/14235

Release Notes:

- Fixed outline panel-related performance issues when selections change
in the large document
([#19817](https://github.com/zed-industries/zed/issues/19817)),
([#14235](https://github.com/zed-industries/zed/issues/14235))
2024-10-31 16:29:19 +02:00
Kyle Kelley
9dad897d49 Clean up notebook item creation in project (#20030)
* Implement `clone_on_split` to allow splitting a notebook into another
pane

* Switched to `tab_content` in `impl Item for NotebookEditor` to show
both the notebook name and an icon

* Added placeholder methods and TODOs for future work, such as saving,
reloading, and search functionality within the notebook editor.

* Started moving more core `Model` bits into `NotebookItem`, including
pulling the language of the notebook (which affects every code cell)

* Loaded notebook asynchronously using `fs`

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-10-31 07:01:46 -07:00
Thorsten Ball
5b6401519b activity indicator: Reset formatting failure on click (#20029)
Release Notes:

- N/A
2024-10-31 14:33:36 +01:00
Thorsten Ball
293e080f03 tasks: Add editor: Spawn Nearest Task action (#19901)
This spawns the runnable task that that's closest to the cursor.

One thing missing right now is that it doesn't find tasks that are
attached to non-outline symbols, such as subtests in Go.

Release Notes:

- Added a new reveal option for tasks: `"no_focus"`. If used, the tasks
terminal panel will be opened and shown, but not focused.
- Added a new `editor: spawn nearest task` action that spawns the task
with a run indicator icon nearest to the cursor. It can be configured to
also use a `reveal` strategy. Example:
```json
{
  "context": "EmptyPane || SharedScreen || vim_mode == normal",
  "bindings": {
    ", r t": ["editor::SpawnNearestTask", { "reveal": "no_focus" }],
  }
}
```


Demo:



https://github.com/user-attachments/assets/0d1818f0-7ae4-4200-8c3e-0ed47550c298

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-31 14:25:57 +01:00
Auf keinen Fall Jens
633b665379 Option to insert comment character(s) at the beginning of the line(s) (#19746)
Closes #19459


This PR adds the optional setting to insert comment character(s) at the
beginning of the line(s) instead of after the indentation. It can be
enabled via keybindings:

```
"ctrl-/": ["editor::ToggleComments", { "ignore_indent": true }]
```

As suggested by @notpeter in #19459, this is implemented in
`toggle_comments` (editor.rs) taking the existing `advance_downwards`
option as example.

There's also a test case for the setting, which mimics the test case for
the regular comment toggling behavior.

---

I am not entirely happy with the name `ignore_indent`. The default would
be a double negative now `ignore_indent=false`. A positive wording would
probably easier to understand, but I could not think of anything
concise. `insert_at_line_start` or just `at_line_start` might work, but
didn't convince me either. That said, I am happy to change the name if
there are better ideas.

---

Release Notes:

- Added optional setting to insert comment character(s) at the beginning
of the line(s) instead of after the indentation. It can be used by
changing the default mapping to toggle comments like this: `"ctrl-/":
["editor::ToggleComments", { "ignore_indent": true }]`
2024-10-31 09:39:57 +01:00
Thorsten Ball
7fd334fddb proto: Remove unused UpdateUserSettings message (#20005)
Release Notes:

- N/A
2024-10-31 09:36:18 +01:00
Thorsten Ball
10226a3992 docs: Document inline blame options (#20006)
Release Notes:

- N/A
2024-10-31 09:36:05 +01:00
Peter Tripp
383e868af0 docs: SSH no longer requires Zed Preview (#20003) 2024-10-30 23:28:13 -04:00
Conrad Irwin
40802d91d4 SSH installation refactor (#19991)
This also cleans up logic for deciding how to do things.

Release Notes:

- Remoting: If downloading the binary on the remote fails, fall back to
uploading it.

---------

Co-authored-by: Mikayala <mikayla@zed.dev>
2024-10-30 16:20:11 -07:00
Danilo Leal
6d5784daa6 Adjust design of the slash command picker (#19973)
This PR removes the quote selection icon button from the footer and adds
it in the picker, and adds an icon field to each command entry. Final
result looks like:


https://github.com/user-attachments/assets/d177f1c1-b6f6-4652-9434-f6291b279e34

Release Notes:

- N/A
2024-10-30 19:42:42 -03:00
Conrad Irwin
f80eb264fb Robustify download on remote (#19983)
Closes #19976
Closes #19972

We now prefer curl to wget (as it supports socks5:// proxies) and pass
-f to
curl so it fails; and use sh instead of bash, which should have more
consistent
behaviour across systems

Release Notes:

- SSH Remoting: make downloading binary on remote more reliable.

---------

Co-authored-by: Will <will@zed.dev>
2024-10-30 15:17:50 -07:00
Conrad Irwin
3d956ca68b Fail download if download fails (#19990)
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- Remoting: Fixes a bug where we could cache an HTML error page as a
binary

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-10-30 14:50:41 -07:00
Kyle Kelley
7ce131aaf8 Trim whitespace from base64 encoded image data before decoding it (#19977)
Closes #17956
Closes #16330

This fix is for both REPL (released) and notebook (unreleased)

<img width="1210" alt="image"
src="https://github.com/user-attachments/assets/bd046f0f-3ad1-4c25-b3cb-114e008c2a69">

Release Notes:

- Fixed image support in REPL for certain versions of matplotlib that
included preceding and/or trailing whitespace in the base64 image data
2024-10-30 12:32:17 -07:00
Jen Stehlik
60be47d115 Update Gleam icon (#19978)
Improves upon: https://github.com/zed-industries/zed/pull/19887

Implements the feedback by @PixelJanitor to make the icon follow the
design guidelines.

Release Notes:

- Improved Gleam icon
2024-10-30 15:29:32 -04:00
Conrad Irwin
bd187883da Migration to remove dev servers (#19639)
Depends on #19638

Release Notes:

- None
2024-10-30 11:55:55 -06:00
Conrad Irwin
4f9217bca0 Support zed://ssh (#19970)
Closes: #15070

Release Notes:

- Added support for `zed://ssh/<connnection>/<path>`
2024-10-30 11:28:25 -06:00
Conrad Irwin
ce5222f1df Add KeyContextView (#19872)
Release Notes:

- Added `cmd-shift-p debug: Open Key Context View` to help debug custom
key bindings



https://github.com/user-attachments/assets/de273c97-5b27-45aa-9ff1-f943b0ed7dfe
2024-10-30 11:26:54 -06:00
Kirill Bulatov
cf7b0c8971 Add scrollbars to outline panel (#19969)
Part of https://github.com/zed-industries/zed/issues/15324


![image](https://github.com/user-attachments/assets/4f32d585-9bd2-46be-8234-3658a71906ee)

Repeats the approach used in the project panel.

Release Notes:

- Added scrollbars to outline panel

---------

Co-authored-by: Nate Butler <nate@zed.dev>
2024-10-30 19:09:14 +02:00
renovate[bot]
7bc4cb9868 Update Rust crate hyper to v0.14.31 (#19323)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [hyper](https://hyper.rs)
([source](https://redirect.github.com/hyperium/hyper)) |
workspace.dependencies | patch | `0.14.30` -> `0.14.31` |

---

### Release Notes

<details>
<summary>hyperium/hyper (hyper)</summary>

###
[`v0.14.31`](https://redirect.github.com/hyperium/hyper/releases/tag/v0.14.31)

[Compare
Source](https://redirect.github.com/hyperium/hyper/compare/v0.14.30...v0.14.31)

#### Bug Fixes

- **http1:** improve performance of parsing sequentially partial
messages
([97b595e](97b595e589))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-30 12:11:07 -04:00
Gherman
f84f3ffeb7 docs: Add linkedProjects section to Rust docs (#19954)
Related to #19897

Adds a section about multi-project workspaces and how to configure
rust-analyzer to diagnose them even if the cargo workspace does not list
them

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-30 11:43:44 -04:00
Richard Feldman
c564a4a26c Require /file or /tab when using Suggest Edits (#19960)
Now if you try to do Suggest Edits without a file context, you see this
(and it doesn't run the query).

<img width="635" alt="Screenshot 2024-10-30 at 10 51 24 AM"
src="https://github.com/user-attachments/assets/a3997ba6-98a9-4bfa-81b6-1d8579c26fd7">


Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-10-30 11:38:43 -04:00
Marshall Bowers
515fd7b75f git_hosting_providers: Fix support for GitLab remotes containing subgroups (#19962)
This PR fixes the support for GitLab remote URLs containing subgroups.

Reported in
https://github.com/zed-industries/zed/issues/18012#issuecomment-2446206256.

Release Notes:

- N/A
2024-10-30 11:16:44 -04:00
Peter Tripp
662a4440cc v0.161.x dev 2024-10-30 11:06:39 -04:00
Marshall Bowers
5dee43b05c dart: Extract to zed-extensions/dart repository (#19959)
This PR extracts the Dart extension to the
[zed-extensions/dart](https://github.com/zed-extensions/dart)
repository.

Release Notes:

- N/A
2024-10-30 11:00:06 -04:00
Antonio Scandurra
c8003c0697 Take a mutable context when resolving selections (#19948)
This is a behavior-preserving change, but lays the groundwork for
expanding selections when the cursor lands inside of a "replace" block.

Release Notes:

- N/A
2024-10-30 15:21:51 +01:00
Lukas Geiger
83e2889d63 Fix notebook cell-height when soft-wrapping lines (#19933) 2024-10-30 07:12:32 -07:00
Kirill Bulatov
d49cd0019f Log prettier errors on failures (#19951)
Closes https://github.com/zed-industries/zed/issues/11987

Release Notes:

- Fixed prettier not reporting failures in the status panel on
formatting and installation errors
2024-10-30 14:49:47 +02:00
Thorsten Ball
0ba40bdfb8 remote dev: Always upload binary in development mode (#19953)
Release Notes:

- N/A
2024-10-30 13:41:28 +01:00
Thorsten Ball
f6cd97f6fd remote dev: Allow canceling language server work in editor (#19946)
Release Notes:

- Added ability to cancel language server work in remote development.

Demo:



https://github.com/user-attachments/assets/c9ca91a5-617f-4886-a458-87c563c5a247
2024-10-30 13:27:11 +01:00
Thorsten Ball
774a8bf039 inline blame: Fix default setting for inline blame (#19943)
Follow-up to #19759. Fixes the default value. cc @pjtatlow 😄 

Release Notes:

- N/A
2024-10-30 11:40:04 +01:00
Antonio Scandurra
4431ef1870 Speed up point translation in the Rope (#19913)
This pull request introduces an index of Unicode codepoints, newlines
and UTF-16 codepoints.

Benchmarks worth a thousand words:

```
push/4096               time:   [467.06 µs 470.07 µs 473.24 µs]
                        thrpt:  [8.2543 MiB/s 8.3100 MiB/s 8.3635 MiB/s]
                 change:
                        time:   [-4.1462% -3.0990% -2.0527%] (p = 0.00 < 0.05)
                        thrpt:  [+2.0957% +3.1981% +4.3255%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
push/65536              time:   [1.4650 ms 1.4796 ms 1.4922 ms]
                        thrpt:  [41.885 MiB/s 42.242 MiB/s 42.664 MiB/s]
                 change:
                        time:   [-3.2871% -2.3489% -1.4555%] (p = 0.00 < 0.05)
                        thrpt:  [+1.4770% +2.4054% +3.3988%]
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) low severe
  3 (3.00%) low mild

append/4096             time:   [729.00 ns 730.57 ns 732.14 ns]
                        thrpt:  [5.2103 GiB/s 5.2215 GiB/s 5.2327 GiB/s]
                 change:
                        time:   [-81.884% -81.836% -81.790%] (p = 0.00 < 0.05)
                        thrpt:  [+449.16% +450.53% +452.01%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) low mild
  6 (6.00%) high mild
  2 (2.00%) high severe
append/65536            time:   [504.44 ns 505.58 ns 506.77 ns]
                        thrpt:  [120.44 GiB/s 120.72 GiB/s 121.00 GiB/s]
                 change:
                        time:   [-94.833% -94.807% -94.782%] (p = 0.00 < 0.05)
                        thrpt:  [+1816.3% +1825.8% +1835.5%]
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe

slice/4096              time:   [29.661 µs 29.733 µs 29.816 µs]
                        thrpt:  [131.01 MiB/s 131.38 MiB/s 131.70 MiB/s]
                 change:
                        time:   [-48.833% -48.533% -48.230%] (p = 0.00 < 0.05)
                        thrpt:  [+93.161% +94.298% +95.440%]
                        Performance has improved.
slice/65536             time:   [588.00 µs 590.22 µs 592.17 µs]
                        thrpt:  [105.54 MiB/s 105.89 MiB/s 106.29 MiB/s]
                 change:
                        time:   [-45.599% -45.347% -45.099%] (p = 0.00 < 0.05)
                        thrpt:  [+82.147% +82.971% +83.821%]
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) low severe
  1 (1.00%) high mild

bytes_in_range/4096     time:   [3.8630 µs 3.8811 µs 3.8994 µs]
                        thrpt:  [1001.8 MiB/s 1006.5 MiB/s 1011.2 MiB/s]
                 change:
                        time:   [+0.0600% +0.6000% +1.1833%] (p = 0.03 < 0.05)
                        thrpt:  [-1.1695% -0.5964% -0.0600%]
                        Change within noise threshold.
bytes_in_range/65536    time:   [98.178 µs 98.545 µs 98.931 µs]
                        thrpt:  [631.75 MiB/s 634.23 MiB/s 636.60 MiB/s]
                 change:
                        time:   [-0.6513% +0.7537% +2.2265%] (p = 0.30 > 0.05)
                        thrpt:  [-2.1780% -0.7481% +0.6555%]
                        No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
  8 (8.00%) high mild
  3 (3.00%) high severe

chars/4096              time:   [878.91 ns 879.45 ns 880.06 ns]
                        thrpt:  [4.3346 GiB/s 4.3376 GiB/s 4.3403 GiB/s]
                 change:
                        time:   [+9.1679% +9.4000% +9.6304%] (p = 0.00 < 0.05)
                        thrpt:  [-8.7844% -8.5923% -8.3979%]
                        Performance has regressed.
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low severe
  1 (1.00%) low mild
  3 (3.00%) high mild
  3 (3.00%) high severe
chars/65536             time:   [15.615 µs 15.691 µs 15.757 µs]
                        thrpt:  [3.8735 GiB/s 3.8899 GiB/s 3.9087 GiB/s]
                 change:
                        time:   [+5.4902% +5.9345% +6.4044%] (p = 0.00 < 0.05)
                        thrpt:  [-6.0190% -5.6021% -5.2045%]
                        Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) low mild

clip_point/4096         time:   [29.677 µs 29.835 µs 30.019 µs]
                        thrpt:  [130.13 MiB/s 130.93 MiB/s 131.63 MiB/s]
                 change:
                        time:   [-46.306% -45.866% -45.436%] (p = 0.00 < 0.05)
                        thrpt:  [+83.272% +84.728% +86.240%]
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe
clip_point/65536        time:   [1.5933 ms 1.6116 ms 1.6311 ms]
                        thrpt:  [38.318 MiB/s 38.782 MiB/s 39.226 MiB/s]
                 change:
                        time:   [-30.388% -29.598% -28.717%] (p = 0.00 < 0.05)
                        thrpt:  [+40.286% +42.040% +43.653%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s

point_to_offset/4096    time:   [14.493 µs 14.591 µs 14.707 µs]
                        thrpt:  [265.61 MiB/s 267.72 MiB/s 269.52 MiB/s]
                 change:
                        time:   [-71.990% -71.787% -71.588%] (p = 0.00 < 0.05)
                        thrpt:  [+251.96% +254.45% +257.01%]
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  5 (5.00%) high mild
  4 (4.00%) high severe
point_to_offset/65536   time:   [700.72 µs 713.75 µs 727.26 µs]
                        thrpt:  [85.939 MiB/s 87.566 MiB/s 89.194 MiB/s]
                 change:
                        time:   [-61.778% -61.015% -60.256%] (p = 0.00 < 0.05)
                        thrpt:  [+151.61% +156.51% +161.63%]
                        Performance has improved.
```

Calling `Rope::chars` got slightly slower but I don't think it's a big
issue (we don't really call `chars` for an entire `Rope`).

In a future pull request, I want to use the tab index (which we're not
yet using) and the char index to make `TabMap` a lot faster.

Release Notes:

- N/A
2024-10-30 10:59:03 +01:00
Mikayla Maki
b3f0ba1430 Implement panic reporting saving and uploads (#19932)
TODO: 
- [x] check that the app version is well formatted for zed.dev

Release Notes:

- N/A

---------

Co-authored-by: Trace <violet.white.batt@gmail.com>
2024-10-29 23:54:00 -07:00
Nate Butler
a5f52f0f04 Use theme families to refine user themes (#19936)
This PR changes the way we load user themes into the ThemeRegistry. 

Rather than directly pass a theme family's themes to
`insert_user_themes`, instead we use the new `refine_theme_family ` and
`ThemeFamily::refine_theme`.

This PR should have net zero change to themes today, but sets up
enabling theme variables. We need to do it this way so each theme has
access to it's family when it is refined.

Release Notes:

- N/A
2024-10-29 22:30:58 -04:00
Nate Butler
63524a2354 Add missing full-size styles for panes (#19935)
As we don't use scrolling flex layouts directly in panes that often, the
methods that would normally be applied to containers that should fill
the space weren't applied here.

Should help un-stuck #19872's layout issue, but I'm merging this change
separately in case it creates some other layout issue in panes.

Release Notes:

- N/A
2024-10-29 21:16:45 -04:00
Marshall Bowers
90edb7189f git_hosting_providers: Clean up tests (#19927)
This PR cleans up the tests for the various Git hosting providers.

These tests had rotted a bit over time, to the point that some of them
weren't even testing what they claimed anymore.

Release Notes:

- N/A
2024-10-29 17:24:32 -04:00
Max Brunsfeld
518f6b529b Fix missing diagnostic and text highlights after blocks (#19920)
Release Notes:

- Fixed an issue where diagnostic underlines and certain text highlights
were not rendered correctly below block decorations such as the inline
assistant prompt.

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
2024-10-29 13:47:43 -07:00
Conrad Irwin
fb97e462de Better handle interrupted connections for shared SSH (#19925)
Co-Authored-By: Mikayla <mikayla@zed.dev>
2024-10-29 16:43:34 -04:00
Marshall Bowers
5b7fa05a87 Make Git remote URL parsing more robust (#19924)
This PR improves the parsing of Git remote URLs in order to make
features that depend on them more robust.

Previously we were just treating these as plain strings and doing
one-off shotgun parsing to massage them into the right format. This
meant that we weren't accounting for edge cases in URL structure.

One of these cases was HTTPS Git URLs containing a username, which can
arise when using GitHub Enterprise (see
https://github.com/zed-industries/zed/issues/11160).

We now have a `RemoteUrl` typed to represent a parsed Git remote URL and
use the `Url` parser to parse it.

Release Notes:

- Improved the parsing of Git remote URLs to support additional
scenarios.
2024-10-29 16:19:05 -04:00
Conrad Irwin
d310a1269f SSH Remoting: Fix diagnostic summary syncing (#19923)
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- SSH Remoting: Fix diagnostics summary over collab

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-10-29 13:02:32 -07:00
Mikayla Maki
9818835c9d Fix the log spam from the BlameBuffer request (#19921)
Release Notes:

- N/A
2024-10-29 13:02:21 -07:00
Mikayla Maki
f3b7f5944d Fix a rare crash on startup (#19922)
Release Notes:

- Fixed a rare crash that could happen when certain SQL statements are
prepared
2024-10-29 12:30:55 -07:00
Conrad Irwin
fc5cde9434 Fix quotes in Rust (#19914)
Release Notes:

- (preview only) Fixed quote-autoclose in Rust
2024-10-29 12:35:34 -06:00
Kyle Kelley
6ea4662326 Initial Notebook UI structure (#19756)
This is the start of a notebook UI for Zed. 

`🔔 Note: This won't be useable yet when it is merged! Read below. 🔔`

This is going to be behind a feature flag so that we can merge this
initial PR and then make follow up PRs. Release notes will be produced
in a future PR.

Minimum checklist for merging this:

* [x] All functionality behind the `notebooks` feature flag (with env
var opt out)
* [x] Open notebook files in the workspace
* [x] Remove the "Open Notebook" button from title bar
* [x] Incorporate text style refinements for cell editors
* [x] Rely on `nbformat` crate for parsing the notebook into our
in-memory format
* [x] Move notebook to a `gpui::List`
* [x] Hook up output rendering


Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-10-29 11:30:07 -07:00
Joseph T. Lyons
9d12308d06 Fix Julia icon extension lookup (#19916)
Release Notes:

- Fixed a bug where the Julia icon was not displayed for Julia files.
2024-10-29 14:07:54 -04:00
Richard Feldman
21137d2ba7 Delete /workflow (#19900)
This a separate PR from https://github.com/zed-industries/zed/pull/19705
so we can revert it more easily if we want it back later.

Release Notes:

- Added "Suggest Edit" button to the assistant panel if
`"enable_experimental_live_diffs": true` is set in the `"assistant"`
section of `settings.json`. This button takes the place of the previous
`/workflow` command, but it is experimental and may change!

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2024-10-29 13:57:33 -04:00
Conrad Irwin
273cb1921f Fix wrong UpdateWorktree chunk size being used in release mode (#19912)
Release Notes:

- Fixed slowness when collaborating

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-29 11:22:41 -06:00
Nathan Sobo
cfa20ff221 Sketch in assistant edit button (#19705)
Add an edit button to the assistant. This is totally hacked in for now,
just to see how this would feel rendered simply in the UI.

![CleanShot 2024-10-24 at 16 26
14@2x](https://github.com/user-attachments/assets/e630d078-78b7-42d7-93f1-cf61c00bd20e)

cc @as-cii @danilo-leal 

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2024-10-29 13:21:10 -04:00
Mikayla Maki
759d136fe6 Update a few doc comments (#19911)
Release Notes:

- N/A
2024-10-29 10:09:49 -07:00
Marshall Bowers
322aa41ad6 Add support for self-hosted GitLab instances for Git permalinks (#19909)
This PR adds support for self-hosted GitLab instances when generating
Git permalinks.

If the `origin` Git remote contains `gitlab` in the URL hostname we will
then attempt to register it as a self-hosted GitLab instance.

A note on this: I don't think relying on specific keywords is going to
be a suitable long-term solution to detection. In reality the
self-hosted instance could be hosted anywhere (e.g.,
`vcs.my-company.com`), so we will ultimately need a way to have the user
indicate which Git provider they are using (perhaps via a setting).

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

Release Notes:

- Added support for self-hosted GitLab instances when generating Git
permalinks.
- The instance URL must have `gitlab` somewhere in the host in order to
be recognized.
2024-10-29 12:31:51 -04:00
Max Brunsfeld
3e2f1d733c Fix horizontal scroll caused by diagnostic block width error (#19856)
Previously, when scrolling the diagnostics view with the mouse, we'd get
a spurious horizontal scroll (even if the content was not overflowing
horizontally) due to an error in the widths of the diagnostic blocks.

Release Notes:

- Fixed an issue where the project diagnostics view spuriously allowed
horizontal scrolling by a small amount.
2024-10-29 09:16:38 -07:00
Michael Sloan
3fed738d2f Use same logic for skipping single instance check on Linux as on Mac/Win (#19446)
Release Notes:

- Linux: Now skips check which exits with "zed is already running" when
in development mode or when run with `zed-local`, matching the behavior
on Mac and Windows

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-10-29 09:12:34 -07:00
Kirill Bulatov
5893e85708 Ensure shared ssh project propagates buffer changes to all participants (#19907)
Fixed the bug when shared ssh project did not account for client
changing things in their buffers.
Also ensures Prettier formatting workflow works for both ssh project
owner and ssh project clients.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-10-29 17:24:10 +02:00
Joseph T. Lyons
1356665ed3 Update community links page url (#19899)
See:

- https://github.com/zed-industries/zed.dev/pull/786

Release Notes:

- N/A
2024-10-29 10:13:26 -04:00
Jen Stehlik
9739da8de3 Add Gleam icon (#19887)
I took a shot at creating an icon version of the Gleam logo in response
to https://github.com/zed-industries/zed/pull/19529

Release Notes:

- Added an icon for Gleam files.


![image](https://github.com/user-attachments/assets/97432ded-342f-4d87-8eb2-dc9145513d8c)

<img width="231" alt="Screenshot 2024-10-29 at 9 46 33 AM"
src="https://github.com/user-attachments/assets/c957c98f-3da0-4b92-bc21-2a5adca1daa3">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-29 09:54:21 -04:00
Joseph T. Lyons
249c8a4d96 Remove community content from docs and point to zed.dev (#19895)
The community content now lives on zed.dev, discoverable via the navbar
`resources` menu.

See:

- https://github.com/zed-industries/zed.dev/pull/783

Release Notes:

- N/A
2024-10-29 09:44:58 -04:00
Thorsten Ball
f919fa92de remote servers: Fix title from alpha to beta (#19889)
Discussed this in Slack yesterday. We use `beta` because that's what we
use in the docs as well.

Release Notes:

- N/A
2024-10-29 13:38:30 +01:00
Bennet Bo Fenner
21b58643fa vsc menu: Fix issue when switching branch while non-visible worktree is open (#19888)
Fixes a regression introduced in #19755

<img width="935" alt="Screenshot 2024-10-29 at 12 13 04"
src="https://github.com/user-attachments/assets/7699b8da-631d-4932-89a8-bc5d7f2546f1">

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

Release Notes:

- Fixed an issue where the branch switcher would show an error, when
opening a file outside of the project

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-29 12:27:30 +01:00
Bennet Bo Fenner
6a0bcca9ec ssh remoting: Hide share button while connecting to project (#19885)
Co-Authored-by: Thorsten <thorsten@zed.dev>

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-29 12:13:21 +01:00
PJ Tatlow
84328c303b Include commit summary in inline Git blame (#19759)
Closes #19758

Release Notes:

- Added feature to show commit summary as part of the inline Git blame

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-10-29 11:35:31 +01:00
Bennet Bo Fenner
f7b2b41df9 ssh remoting: Check nightly version correctly by comparing commit SHA (#19884)
This ensures that we detect if a new nightly version of the remote
server is available.
Previously we would always mark a version as matching if they had the
same semantic version.
However, for nightly versions we also need to check if they have the
same commit SHA.

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

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-29 11:32:55 +01:00
Bennet Bo Fenner
7a6b6435c4 languages: Enable grammar loading when compiling with test feature (#19881)
This ensures that `cargo tests -p languages` will not fail with a
confusing error message.

Follow up to #19821

We opted to check the `test` feature flag instead of defining a runtime
flag, because we only want to include the `tree-sitter-*` dependencies
in some cases, which is not possible with a runtime flag.

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

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-29 11:00:44 +01:00
Bennet Bo Fenner
bdb54decdc ssh remoting: Show the host's GitHub name in the titlebar when sharing an SSH project (#19844)
The name (GitHub name) of the host was not displayed when sharing an ssh
project.

Previously we assumed that the a collaborator is a host if the
`replica_id` of the collaborator was `0`,
but for ssh project the `replica_id` is actually `1`.

<img width="329" alt="Screenshot 2024-10-28 at 18 16 30"
src="https://github.com/user-attachments/assets/c0151e12-a96f-4f38-aec1-4ed5475a9eaf">


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

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-29 09:52:54 +01:00
Bennet Bo Fenner
b5c41eeb98 Future-proof indent guides settings for panels (#19878)
This PR ensures that we do not have to break the indent guides settings
for the project/outline panel. In the future we might want to have a
more granular way to control when to show indent guides, or control
other indent guide properties, like its width.

Release Notes:

- N/A
2024-10-29 09:52:36 +01:00
Conrad Irwin
719a7f7890 Fix block cursor on graphemes (#19867)
Release Notes:

- Fixed block cursor rendering only first char of multii-char graphemes.
2024-10-28 21:05:24 -06:00
Joseph T. Lyons
1b84fee708 restore editor::UnfoldRecursive binding (#19865) 2024-10-28 22:32:59 -04:00
Conrad Irwin
58e5d4ff02 Reland invisibles (#19846)
Release Notes:

- Show invisibles in the editor

Relands #19298 

Trying to quantify a performance impact, it doesn't seem to impact much
visible in Instruments or in a micro-benchmark of Editor#layout_lines.
We're still taking a few hundred micro-seconds (+/- a lot) every time.
The ascii file has just ascii, where as the cc file has one control
character per line.

<img width="1055" alt="Screenshot 2024-10-28 at 12 14 53"
src="https://github.com/user-attachments/assets/1c382063-bb19-4e92-bbba-ed5e7c02309f">
<img width="1020" alt="Screenshot 2024-10-28 at 12 15 07"
src="https://github.com/user-attachments/assets/1789f65e-5f83-4c32-be47-7748c62c3703">
2024-10-28 20:27:09 -06:00
Mikayla Maki
85ff03cde0 Add more context to the save new file path picker (#19863)
Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
2024-10-28 17:21:41 -07:00
Conrad Irwin
a3f0bb4547 SSH Remoting: Document manual binary management (#19862)
Release Notes:

- N/A
2024-10-28 17:10:08 -06:00
Marshall Bowers
93b20008e0 Add support for Doxygen doc comments in C++ (#19858)
This PR adds support for Doxygen-style doc comments in C++.

<img width="962" alt="Screenshot 2024-10-28 at 5 38 34 PM"
src="https://github.com/user-attachments/assets/57d0fa4b-07c1-4b71-899a-fba78e822e8f">

https://www.doxygen.nl/manual/docblocks.html

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

Release Notes:

- C++: Added support for Doxygen-style doc comments starting with `/// `
or `//! `.
2024-10-28 17:44:23 -04:00
ClanEver
188a893fd0 python: Enhance syntax highlighting for type hints (#18185)
Release Notes:

- Python: Improved syntax highlighting for type hints.

# Before

![image](https://github.com/user-attachments/assets/876a69ab-a572-4d1b-af99-e6f85f249ea6)

# After

![image](https://github.com/user-attachments/assets/4fb98a9b-bc5d-4799-b535-057047884383)

---
Why manual recursion?
- Due to tree-sitter grammar not supporting recursion in query
(https://github.com/tree-sitter-grammars/tree-sitter-lua/issues/24),
currently only manual recursion is possible (refer to
https://github.com/projekt0n/github-nvim-theme/pull/250/files).

<br/>

Unable to highlight when simple structures appear before complex
structures, example:
```python
def t() -> str | dict[int, dict[int, dict[int, str]]]:
    pass
```
Because complex structures are parsed as `subscript` rather than
`generic_type` by tree-sitter in this case ☹

<br/>

Related:

- https://github.com/zed-industries/zed/issues/14715
- [Union Type (Python
Doc)](https://docs.python.org/3/library/stdtypes.html#union-type)
- [Type parameter lists (Python
Doc)](https://docs.python.org/3/reference/compound_stmts.html#type-parameter-lists)

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-28 16:56:59 -04:00
Piotr Osiewicz
052b746fbd language_selector: Fix debug_assert firing off on context menu creation for LSP view (#19854)
Closes #ISSUE

Release Notes:

- N/A
2024-10-28 21:55:38 +01:00
Mikayla Maki
80f89059aa Fix mouse clicks on remote-open-folder UI (#19851)
Also change Zed's standard style to use
`.track_focus(&self.focus_handle(cx))`, instead of
`.track_focus(&self.focus_handle)`, to catch these kinds of errors more
easily in the future.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-10-28 12:55:55 -07:00
Mikayla Maki
826d83edfe Fix backtrace spam on remote server (#19850)
Release Notes:

- N/A

Co-authored-by: conrad <conrad@zed.dev>
2024-10-28 12:28:42 -07:00
Joseph T. Lyons
f5d5fab2c8 Improve fold_at_level performance (#19845)
Just spotted a tiny error that was causing us to continue looking for
nested folds 1 layer deeper than any fold already found at the target
level. We shouldn't continue to seek for a deeper fold after the fold at
the target level is found.

Tested on a debug build and used `editor.rs` as the source material:

```
Old

Level 1 fold:
[crates/editor/src/editor.rs:10777:9] counter = 2806
[crates/editor/src/editor.rs:10778:9] time_elapsed = 320.570792ms

Level 2 fold:
[crates/editor/src/editor.rs:10777:9] counter = 5615
[crates/editor/src/editor.rs:10778:9] time_elapsed = 497.4305ms

Level 3 fold:
[crates/editor/src/editor.rs:10777:9] counter = 7528
[crates/editor/src/editor.rs:10778:9] time_elapsed = 619.818334ms

New

Level 1 fold:
[crates/editor/src/editor.rs:10776:9] counter = 543
[crates/editor/src/editor.rs:10777:9] time_elapsed = 139.115625ms

Level 2 fold:
[crates/editor/src/editor.rs:10776:9] counter = 2806
[crates/editor/src/editor.rs:10777:9] time_elapsed = 312.560416ms

Level 3 fold:
[crates/editor/src/editor.rs:10776:9] counter = 5615
[crates/editor/src/editor.rs:10777:9] time_elapsed = 498.873292ms
```

Release Notes:

- N/A
2024-10-28 13:37:28 -04:00
Thorsten Ball
fab2f22a89 remote project: Fix project reference leak when waiting for prompt reply (#19838)
When the language server gave us a prompt and we'd close the window, we
wouldn't release the `project` until the next `flush_effects` call that
came in when opening a window.

With this change, we no longer hold a strong reference to the project in
the future. Fixes the leak and makes sure we clean up the SSH connection
when closing a window.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-28 17:07:30 +01:00
Marshall Bowers
a451bcc3c4 collab: Exempt staff from LLM usage limits (#19836)
This PR updates the usage limit check to exempt Zed staff members from
usage limits.

We previously had some affordances for the rate limits, but hadn't yet
updated it for the usage-based billing.

Release Notes:

- N/A
2024-10-28 11:45:18 -04:00
Marshall Bowers
5e9ff3e313 dart: Bump to v0.1.2 (#19835)
This PR bumps the Dart extension to v0.1.2.

Changes:

- https://github.com/zed-industries/zed/pull/19592

Release Notes:

- N/A
2024-10-28 11:36:44 -04:00
Thorsten Ball
cc81f19c68 remote server: Fix error log about inability to open buffer (#19824)
Turns out that we used client-side `fs` to check whether something is a
directory or not, which obviously doesn't work with SSH projects.

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-28 16:35:37 +01:00
Ömer Sinan Ağacan
5e89fba681 dart: Add support for documentation comments (#19592)
Closes #19590

Release Notes:

- N/A
---

I'm unable to test this because rebuilding Zed with the changes does not
seem to use the changes. If maintainers could let me know how to test
these changes I'd like to verify that this really fixes #19590.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-28 11:20:04 -04:00
Thorsten Ball
67eb652bf1 remote servers: Always dismiss modal (#19831)
We display the errors in another window anyway and if the connection
takes a while it looks like a bug that the modal stays open.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-28 16:12:37 +01:00
Bennet Bo Fenner
e0ea9a9ab5 Remove leftover comments from previous PR (#19820)
Co-Authored-by: Thorsten <thorsten@zed.dev>

Removes some leftover comments from #19766 

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-28 16:00:38 +01:00
xdBronch
ff29a34298 zig: Account for doctests in outline (#19776)
zig has a feature called
[doctests](https://ziglang.org/documentation/master/#Doctests) where
instead of providing a string as the name of a test you use an
identifier so that the test is "tied" to it and can be used in
documentation. this wasnt accounted for so any tests using this were
unnamed in the outline

Release Notes:

- N/A
2024-10-28 10:49:40 -04:00
Thorsten Ball
6686f66949 ollama: Ensure only single task fetches models (#19830)
Before this change, we'd see a ton of requests from the Ollama provider
trying to fetch models:

```
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: https://api.zed.dev/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
[2024-10-28T15:00:52+01:00 DEBUG reqwest::connect] starting new connection: http://localhost:11434/
```

Turns out we'd send a request on *every* change to settings.

Now, with this change, we only send a single request.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-28 15:40:50 +01:00
David Soria Parra
8a96ea25c4 context_servers: Support tools (#19548)
This PR depends on #19547 

This PR adds support for tools from context servers. Context servers are
free to expose tools that Zed can pass to models. When called by the
model, Zed forwards the request to context servers. This allows for some
interesting techniques. Context servers can easily expose tools such as
querying local databases, reading or writing local files, reading
resources over authenticated APIs (e.g. kubernetes, asana, etc).

This is currently experimental. 

Things to discuss
* I want to still add a confirm dialog asking people if a server is
allows to use the tool. Should do this or just use the tool and assume
trustworthyness of context servers?
* Can we add tool use behind a local setting flag?

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-28 10:37:58 -04:00
Piotr Osiewicz
cdddb4d360 Add language toolchains (#19576)
This PR adds support for selecting toolchains for a given language (e.g.
Rust toolchains or Python virtual environments) with support for SSH
projects provided out of the box. For Python we piggy-back off of
[PET](https://github.com/microsoft/python-environment-tools), a library
maintained by Microsoft.
Closes #16421
Closes #7646

Release Notes:

- Added toolchain selector to the status bar (with initial support for
Python virtual environments)
2024-10-28 15:34:03 +01:00
Thorsten Ball
03bd95405b docs: Add diagram to remote development docs (#19827)
Release Notes:

- N/A
2024-10-28 14:14:51 +01:00
Kirill Bulatov
177dfdf900 Declare RUSTFLAGS env var for all CI jobs (#19826)
Follow-up of https://github.com/zed-industries/zed/pull/19149 

Makes RUSTFLAGS propagation uniform, to ensure all `cargo ...` jobs get
the same RUSTFLAGS env set.

Release Notes:

- N/A
2024-10-28 14:53:40 +02:00
Thorsten Ball
2ab0b3b819 remote server: Fix language servers not starting (#19821)
PR #19653 change the code in this diff, which lead to the remote_server
binary trying to load language grammars, which in turn failed, and
stopped languages from being loaded correctly.

That then lead to language servers not starting up.

This change reintroduces what #19653 removed, so that we don't load the
grammar on the remote_server, by ignoring the grammar name from the
config. The tests still all work.


Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-28 11:02:46 +01:00
Bennet Bo Fenner
888fec9299 outline panel: Add indent guides (#19719)
See #12673

| File | Search |
|--------|--------|
| <img width="302" alt="image"
src="https://github.com/user-attachments/assets/44b8d5f9-8446-41b5-8c0f-e438050f0ac9">
| <img width="301" alt="image"
src="https://github.com/user-attachments/assets/a2e6f77b-6d3b-4f1c-8fcb-16bd35274807">
|



Release Notes:

- Added indent guides to the outline panel
2024-10-28 09:54:18 +01:00
Bennet Bo Fenner
e86b096b92 docs: Add indent_guides setting to project panel docs (#19819)
Follow up to #18260 

Release Notes:

- N/A
2024-10-28 09:45:19 +01:00
Mikayla Maki
ffe36c9beb Remove hosted projects (#19754)
Release Notes:

- N/A
2024-10-27 19:44:21 -07:00
Kirill Bulatov
2d16d2d036 Fixed outline panel panicking on filtering (#19811)
Closes https://github.com/zed-industries/zed/issues/19732

Release Notes:

- Fixed outline panel panicking on filtering
([#19732](https://github.com/zed-industries/zed/issues/19732))
2024-10-28 02:31:02 +02:00
Mikayla Maki
c69da2df70 Add support for git branches on remote projects (#19755)
Release Notes:

- Fixed a bug where the branch switcher could not be used remotely.
2024-10-27 15:50:54 -07:00
CharlesChen0823
5506669b06 windows: Fix more windows platform test (#19802)
Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-10-27 19:15:23 +02:00
Bennet Bo Fenner
b13940720a markdown preview: Ignore inline HTML tags in text (#19804)
Follow up to #19785

This PR ensures that we explicitly ignore inline HTML tags so that we
can still extract the text between the tags and show them to the user

Release Notes:

- N/A
2024-10-27 14:34:59 +01:00
Peter Tripp
db61711753 ci: Don't run GitHub Actions workflows on forks (#19789)
- Closes: https://github.com/zed-industries/zed/issues/19351

Release Notes:

- N/A
2024-10-27 09:04:52 -04:00
Joseph T. Lyons
c12a9f2673 Add fold_at_level test (#19800) 2024-10-26 21:57:55 -04:00
Kirill Bulatov
2e32f1c8a1 Restore horizontal scrollbar checks (#19767)
Closes https://github.com/zed-industries/zed/issues/19637

Follow-up of https://github.com/zed-industries/zed/pull/18927 , restores
the condition that removed the horizontal scrollbar when panel's items
are not long enough.

Release Notes:

- Fixed horizontal scrollbar not being hidden
([#19637](https://github.com/zed-industries/zed/issues/19637))
2024-10-26 21:57:22 +03:00
Bennet Bo Fenner
03a1c8d2b8 markdown preview: Fix infinite loop in parser when parsing list items (#19785)
Release Notes:

- Fixed an issue with the markdown parser when opening a markdown
preview file that contained HTML tags inside a list item
2024-10-26 14:59:46 +02:00
Kirill Bulatov
d7a277607b Fix a few Windows tests (#19773) 2024-10-26 03:32:22 +03:00
Thorsten Ball
fc8a72cdd8 WIP: ssh remoting: Add upload_binary field to SshConnections (#19748)
This removes the old `remote_server { "download_binary_on_host": bool }`
field and replaces it with a `upload_binary: bool` on every
`ssh_connection`.


@ConradIrwin it compiles, it connects, but I haven't tested it really
yet

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-10-25 17:32:54 -06:00
Kirill Bulatov
1acebb3c47 Remove another false-positive Danger message (#19769)
Follow-up of https://github.com/zed-industries/zed/pull/19151

Ignores any URLs aftrer `Release Notes:` (if present) and after
`Follow-up of` and `Part of` words.


Release Notes:

- N/A
2024-10-26 01:55:46 +03:00
Conrad Irwin
78ed0c9312 vim: Copy comment to new lines with o/O (#19766)
Co-Authored-By: Kurt Wolf <kurtwolfbuilds@gmail.com>

Closes: #4691

Closes #ISSUE

Release Notes:

- vim: o/O now respect `extend_comment_on_newline`
2024-10-25 16:47:44 -06:00
Conrad Irwin
98d2e5fe73 Quote fixes (#19765)
Closes #19372

Release Notes:

- Fixed autoclosing quotes when the string is already open.
- Added autoclosing of rust multiline strings

---------

Co-authored-by: Kurt Wolf <kurtwolfbuilds@gmail.com>
2024-10-25 16:28:08 -06:00
Max Brunsfeld
4325819075 Fix more failure cases of assistant edits (#19653)
* Make `description` optional (since we describe it as optional in the
prompt, and we're currently not showing it)
* Fix fuzzy location bug that neglected the cost of deleting prefixes of
the query.
* Make auto-indent work for single-line edits. Previously, auto-indent
would not occur when overwriting a single line (without inserting or
deleting a newline)

Release Notes:

- N/A
2024-10-25 14:30:34 -07:00
Marshall Bowers
c19c89e6df collab: Include checkout_complete query parameter after checking out (#19763)
This PR updates the checkout flow to include the `?checkout_complete=1`
query parameter after successfully checking out.

We'll use this on the account page to adapt the UI accordingly.

Release Notes:

- N/A
2024-10-25 16:29:20 -04:00
Joseph T. Lyons
507929cb79 Add editor: fold at level <level> commands (#19750)
Closes https://github.com/zed-industries/zed/issues/5142

Note that I only moved the cursor to the top of the file so it wouldn't
jump - the commands work no matter where you are in the file.


https://github.com/user-attachments/assets/78c74ca6-5c17-477c-b5d1-97c5665e44b0

Also, is VS Code doing this right thing here? or is it busted?


https://github.com/user-attachments/assets/8c503b50-9671-4221-b9f8-1e692fe8cd9a

Release Notes:

- Added `editor: fold at level <level>` commands. macOS: `cmd-k,
cmd-<number>`, Linux: `ctrl-k, ctrl-<number>`.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-10-25 16:08:37 -04:00
Max Brunsfeld
7d0a7aff44 Fix condition for re-using highlights when seeking buffer chunks iterator (#19760)
Fixes a syntax highlighting regression introduced in
https://github.com/zed-industries/zed/pull/19531, which caused syntax
highlighting to be missing after any block.

Release Notes:

- N/A
2024-10-25 12:37:03 -07:00
Kirill Bulatov
92ba18342c Properly deserialize active pane in the workspace (#19744)
Without setting the active pane metadata, no center pane events are
emitted on start before the pane is focused manually, which breaks
deserialization of other components like outline panel, which should
show the active pane's active item outlines on start.

Release Notes:

- N/A

Co-authored-by: Thorsten Ball <thorsten@zed.dev>
2024-10-25 22:04:09 +03:00
Kirill Bulatov
6de5ace116 Update outline panel representation when a theme is changed (#19747)
Release Notes:

- N/A
2024-10-25 22:04:02 +03:00
Richard Feldman
c9db1b9a7b Add keybindings for accepting hunks (#19749)
I went with Cmd-Shift-Y on macOS (Ctrl-Shift-Y on Linux) for "yes accept
this individual hunk" - both are currently unused.

I went with Cmd-Shift-A on macOS (Ctrl-Alt-A on Linux) for "accept all
hunks" - both are unused. (Ctrl-Shift-A on Linux was taken, as is
Ctrl-Alt-Y, so although the pairing of Ctrl-Shift-Y and Ctrl-Alt-A isn't
necessarily obvious, the letters seem intuitive - "yes" and "all" - and
those key combinations don't conflict with anything.)

Release Notes:

- Added keybindings for applying hunks in Proposed Changes
<img width="247" alt="Screenshot 2024-10-25 at 12 47 00 PM"
src="https://github.com/user-attachments/assets/d6355621-ba80-4ee2-8918-b7239a4d29be">
2024-10-25 14:10:04 -04:00
Nathan Sobo
24cb694494 Update placeholder text with key bindings to focus context panel and navigate history (#19447)
Hopefully, this will help people understand how easy it is to add
context to an inline transformation.

![CleanShot 2024-10-18 at 22 41
00@2x](https://github.com/user-attachments/assets/c09c1d89-3df2-4079-9849-9de7ac63c003)

@as-cii @maxdeviant @rtfeldman could somebody update this to display the
actual correct key bindings and ship it. I have them hard coded for now.

Release Notes:

- Updated placeholder text with key bindings to focus context panel and
navigate history.

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2024-10-25 14:09:21 -04:00
Conrad Irwin
85bdd9329b Revert "Show invisibles in editor (#19298)" (#19752)
Closes: #19714

This reverts commit 6dcec47235.

Release Notes:

- (preview only) Fixes a crash when rendering invisibles
2024-10-25 11:59:22 -06:00
Kirill Bulatov
d40ea8fc81 Make macOS bundle script compatible with GNU sed (#19745)
Closes https://github.com/zed-industries/zed/issues/19742

Release Notes:

- N/A
2024-10-25 19:04:38 +03:00
Marshall Bowers
5f9a1482f1 assistant: Make /file emit events as they occur (#19743)
This PR updates the `/file` command to emit its `SlashCommandEvent`s in
a way that can actually be streamed.

Previously it was buffering up all of the events and then returning them
all at once.

Note that we still don't yet support streaming in the context editor on
`main`, so there won't be any visible changes just yet.

Release Notes:

- N/A
2024-10-25 11:02:27 -04:00
Thorsten Ball
5c2238c7a5 ssh remoting: Use matching versions of remote server binary (#19740)
This changes the download logic to not fetch the latest version, but to
fetch the version matching the current version of Zed.


Release Notes:

- Changed the update logic of the SSH remote server to not fetch the
latest version for a current channel, but to fetch the version matching
the current Zed version. If Zed is updated, the server is updated too.
If the server is newer than the Zed version an error will be displayed.
2024-10-25 16:27:36 +02:00
Piotr Osiewicz
5769065f27 project panel: Persist full filename when renaming auto-folded entries (#19728)
This fixes a debug-only panic when processing filenames. The underflow
that happens in Preview/Stable shouldn't cause any issues (other than
maybe unmarking an entry in the project panel).

/cc @notpeter

Closes #ISSUE

Release Notes:

- N/A
2024-10-25 13:47:01 +02:00
Thorsten Ball
0173479d18 ssh remoting: Lock file becomes stale if connection drops & no update if binary is running (#19724)
Release Notes:

- Changed the update process of the remote server binary to not attempt
an update if we can detect that the current binary is used by another
process.
- Changed the update process of the remote server binary to mark the
lock file as stale in case the SSH connection of the process that
created the lock file isn't open anymore.
2024-10-25 12:42:31 +02:00
Max Brunsfeld
08a3c54bac Allow editor blocks to replace ranges of text (#19531)
This PR adds the ability for editor blocks to replace lines of text, but
does not yet use that feature anywhere. We'll update assistant patches
to use replace blocks on another branch:
https://github.com/zed-industries/zed/tree/assistant-patch-replace-blocks

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: Marshall Bowers <marshall@zed.dev>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-10-25 12:29:25 +02:00
Piotr Osiewicz
3617873431 project panel: Fix interactions with auto-folded directories (#19723)
Closes https://github.com/zed-industries/zed/issues/19566

Release Notes:

- N/A

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-10-25 12:13:21 +02:00
Bennet Bo Fenner
6eb6788201 image viewer: Reuse existing tabs (#19717)
Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>

Fixes #9896

Release Notes:

- Fixed an issue where clicking on an image inside the project panel
would not re-use an existing image tab

Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-10-25 09:34:50 +02:00
Conrad Irwin
ebc3031fd9 Inline initialization (#19711)
This restores all the init behaviour into main again. This means we
never need to call init_ui (and so we can't call it more than once).

Release Notes:

- (Nightly only) fixes a panic when using the cli to open another file
in a running zed.
2024-10-24 20:43:40 -06:00
Danilo Leal
42a7402cc5 assistant: Use a labeled button for the slash command menu (#19703)
This should help a bit more the discoverability of the slash commands.

Release Notes:

- N/A
2024-10-24 19:37:42 -03:00
Danilo Leal
6cd5c9e32f assistant: Tweak the model selector design (#19704)
Exploring using the UI font for it, as it is more common for dropdowns
and popovers throughout the app. Feeling like it makes it lighter and
also shorter in width!

| Before | After |
|--------|--------|
| <img width="1296" alt="Screenshot 2024-10-24 at 16 39 04"
src="https://github.com/user-attachments/assets/0412f922-77a9-4d83-adf9-5632534d6c5b">
| <img width="1296" alt="Screenshot 2024-10-24 at 16 38 26"
src="https://github.com/user-attachments/assets/8bf52ba7-fda7-4437-b53e-903c282f2931">
|

Release Notes:

- N/A
2024-10-24 19:37:09 -03:00
Conrad Irwin
d45b830412 SSH connection pooling (#19692)
Co-Authored-By: Max <max@zed.dev>

Closes #ISSUE

Release Notes:

- SSH Remoting: Reuse connections across hosts

---------

Co-authored-by: Max <max@zed.dev>
2024-10-24 14:37:54 -06:00
Conrad Irwin
3a9c071e6e Fix partial downloads of ssh remote server (#19700)
Release Notes:

- SSH Remoting: fix a bug where inerrrupting ssh connecting could leave
your local binary cached in an invalid state
2024-10-24 14:37:02 -06:00
Marshall Bowers
ca861bb1bb ui: Fix swapped element background colors (#19701)
This PR fixes an issue introduced in
https://github.com/zed-industries/zed/pull/18768 where the element
backgrounds colors for `ElevationIndex::ElevatedSurface` and
`ElevationIndex::Surface` were swapped.

Release Notes:

- N/A
2024-10-24 16:34:45 -04:00
Kirill Bulatov
454d3dd52b Fix ssh project history (#19683)
Use `Fs` instead of `std::fs` and do entry existence checks better:
* first, check the worktree entry existence without any FS checks
* then, only for local cases, use `Fs` to check for abs_path existence
of items, in case those came from single-filed worktrees that got closed
and removed.

Remote entries do not get file existence checks, so might try opening
previously removed buffers for now.

Release Notes:

- N/A
2024-10-24 21:49:07 +03:00
Peter Tripp
3ec015b325 docs: Example theme_overrides for docstrings as italic (#19694) 2024-10-24 14:37:57 -04:00
Mikayla Maki
02718284ef Remove dev servers (#19638)
TODO:

- [ ] Check that workspace migration worked
- [ ] Add server migrations and make sure SeaORM files are in sync
(maybe?)

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-10-24 12:14:03 -06:00
Marshall Bowers
b5f816dde5 assistant: Add implementation for /delta argument completion (#19693)
This PR fixes a panic that could occur when trying to complete arguments
for the `/delta` slash command.

We were using `unimplemented!()` instead of providing a default no-op
implementation like we do for other slash commands that do not support
completing arguments.

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

Release Notes:

- Fixed a panic that could occur when trying to complete arguments with
the `/delta` command.
2024-10-24 13:39:06 -04:00
1089 changed files with 92508 additions and 38484 deletions

View File

@@ -13,6 +13,12 @@ rustflags = ["-C", "link-arg=-fuse-ld=mold"]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-args=-Objc -all_load"]
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-args=-Objc -all_load"]
# This cfg will reduce the size of `windows::core::Error` from 16 bytes to 4 bytes
[target.'cfg(target_os = "windows")']
rustflags = ["--cfg", "windows_slim_errors"]

View File

@@ -3,15 +3,6 @@ export default {
const url = new URL(request.url);
url.hostname = "docs-anw.pages.dev";
// These pages were removed, but may still be served due to Cloudflare's
// [asset retention](https://developers.cloudflare.com/pages/configuration/serving-pages/#asset-retention).
if (
url.pathname === "/docs/assistant/context-servers" ||
url.pathname === "/docs/assistant/model-context-protocol"
) {
return await fetch("https://zed.dev/404");
}
let res = await fetch(url, request);
if (res.status === 404) {

View File

@@ -15,6 +15,13 @@ body:
description: A clear and concise description of what you want to happen.
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. If you are unable to run the command, please include your Zed version and release channel, operating system and version, RAM amount, and architecture.
validations:
required: true
- type: textarea
attributes:
label: |

View File

@@ -2,7 +2,7 @@ name: Bug Report
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"]
labels: ["admin read", "triage", "bug"]
body:
- type: checkboxes
attributes:
@@ -21,13 +21,13 @@ body:
id: environment
attributes:
label: Environment
description: Run the `copy system specs into clipboard` command palette action and paste the output in the field below.
description: Run the `copy system specs into clipboard` command palette action and paste the output in the field below. If you are unable to run the command, please include your Zed version and release channel, operating system and version, RAM amount, and architecture.
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
label: If applicable, add screenshots or screencasts of the incorrect state / behavior
description: Drag images / videos into the text input below
validations:
required: false
- type: textarea
@@ -38,9 +38,12 @@ body:
Linux: `~/.local/share/zed/logs/Zed.log` or $XDG_DATA_HOME
If you only need the most recent lines, you can run the `zed: open log` command palette action to see the last 1000.
value: |
<details><summary>Zed.log</summary><pre>
<!-- Click below this line and paste or drag-and-drop your log-->
<details><summary>Zed.log</summary>
<!-- Click above this line and paste or drag-and-drop your log--></pre></details>
<!-- Click below this line and paste or drag-and-drop your log-->
```
```
<!-- Click above this line and paste or drag-and-drop your log--></details>
validations:
required: false

View File

@@ -1,7 +1,7 @@
name: Crash Report
description: |
Use this template for crash reports.
labels: ["admin read", "triage", "defect", "panic / crash"]
labels: ["admin read", "triage", "bug", "panic / crash"]
body:
- type: checkboxes
attributes:
@@ -20,7 +20,7 @@ body:
id: environment
attributes:
label: Environment
description: Run the `copy system specs into clipboard` command palette action and paste the output in the field below.
description: Run the `copy system specs into clipboard` command palette action and paste the output in the field below. If you are unable to run the command, please include your Zed version and release channel, operating system and version, RAM amount, and architecture.
validations:
required: true
- type: textarea
@@ -31,9 +31,12 @@ body:
Linux: `~/.local/share/zed/logs/Zed.log` or $XDG_DATA_HOME
If you only need the most recent lines, you can run the `zed: open log` command palette action to see the last 1000.
value: |
<details><summary>Zed.log</summary><pre>
<!-- Click below this line and paste or drag-and-drop your log-->
<details><summary>Zed.log</summary>
<!-- Click above this line and paste or drag-and-drop your log--></pre></details>
<!-- Click below this line and paste or drag-and-drop your log-->
```
```
<!-- Click above this line and paste or drag-and-drop your log--></details>
validations:
required: false

View File

@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-issue-config.json
blank_issues_enabled: false
contact_links:
- name: Language Request

View File

@@ -10,7 +10,7 @@ runs:
cargo install cargo-nextest
- name: Install Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "18"

View File

@@ -43,6 +43,8 @@ jobs:
esac
which cargo-set-version > /dev/null || cargo install cargo-edit
output=$(cargo set-version -p zed --bump patch 2>&1 | sed 's/.* //')
export GIT_COMMITTER_NAME="Zed Bot"
export GIT_COMMITTER_EMAIL="hi@zed.dev"
git commit -am "Bump to $output for @$GITHUB_ACTOR" --author "Zed Bot <hi@zed.dev>"
git tag v${output}${tag_suffix}
git push origin HEAD v${output}${tag_suffix}

View File

@@ -13,7 +13,7 @@ on:
branches:
- "**"
paths-ignore:
- "docs/**"
- "docs/**/*"
- ".github/workflows/community_*"
concurrency:
@@ -25,6 +25,7 @@ env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
jobs:
migration_checks:
@@ -91,6 +92,7 @@ jobs:
macos_tests:
timeout-minutes: 60
name: (macOS) Run Clippy and tests
if: github.repository_owner == 'zed-industries'
runs-on:
- self-hosted
- test
@@ -111,21 +113,30 @@ jobs:
script/check-licenses
script/generate-licenses /tmp/zed_licenses_output
- name: Check for new vulnerable dependencies
if: github.event_name == 'pull_request'
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4
with:
license-check: false
- name: Run tests
uses: ./.github/actions/run_tests
- name: Build collab
run: RUSTFLAGS="-D warnings" cargo build -p collab
run: cargo build -p collab
- name: Build other binaries and features
run: |
RUSTFLAGS="-D warnings" cargo build --workspace --bins --all-features
cargo build --workspace --bins --all-features
cargo check -p gpui --features "macos-blade"
RUSTFLAGS="-D warnings" cargo build -p remote_server
cargo check -p workspace
cargo build -p remote_server
script/check-rust-livekit-macos
linux_tests:
timeout-minutes: 60
name: (Linux) Run Clippy and tests
if: github.repository_owner == 'zed-industries'
runs-on:
- buildjet-16vcpu-ubuntu-2204
steps:
@@ -152,12 +163,15 @@ jobs:
- name: Run tests
uses: ./.github/actions/run_tests
- name: Build Zed
run: RUSTFLAGS="-D warnings" cargo build -p zed
- name: Build other binaries and features
run: |
cargo build -p zed
cargo check -p workspace
build_remote_server:
timeout-minutes: 60
name: (Linux) Build Remote Server
if: github.repository_owner == 'zed-industries'
runs-on:
- buildjet-16vcpu-ubuntu-2204
steps:
@@ -179,14 +193,18 @@ jobs:
run: ./script/remote-server && ./script/install-mold 2.34.0
- name: Build Remote Server
run: RUSTFLAGS="-D warnings" cargo build -p remote_server
run: cargo build -p remote_server
# todo(windows): Actually run the tests
windows_tests:
timeout-minutes: 60
name: (Windows) Run Clippy and tests
if: github.repository_owner == 'zed-industries'
runs-on: hosted-windows-1
steps:
# more info here:- https://github.com/rust-lang/cargo/issues/13020
- name: Enable longer pathnames for git
run: git config --system core.longpaths true
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
@@ -203,7 +221,7 @@ jobs:
run: cargo xtask clippy
- name: Build Zed
run: $env:RUSTFLAGS="-D warnings"; cargo build
run: cargo build
bundle-mac:
timeout-minutes: 60
@@ -224,7 +242,7 @@ jobs:
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
steps:
- name: Install Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "18"
@@ -237,6 +255,7 @@ jobs:
# 25 was chosen arbitrarily.
fetch-depth: 25
clean: false
ref: ${{ github.ref }}
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100
@@ -252,7 +271,10 @@ jobs:
run: |
mkdir -p target/
# Ignore any errors that occur while drafting release notes to not fail the build.
script/draft-release-notes "$version" "$channel" > target/release-notes.md || true
script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md || true
script/create-draft-release target/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate license file
run: script/generate-licenses
@@ -260,18 +282,12 @@ jobs:
- name: Create macOS app bundle
run: script/bundle-mac
- name: Rename single-architecture binaries
- name: Rename binaries
if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
run: |
mv target/aarch64-apple-darwin/release/Zed.dmg target/aarch64-apple-darwin/release/Zed-aarch64.dmg
mv target/x86_64-apple-darwin/release/Zed.dmg target/x86_64-apple-darwin/release/Zed-x86_64.dmg
- name: Upload app bundle (universal) to workflow run if main branch or specific label
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
with:
name: Zed_${{ github.event.pull_request.head.sha || github.sha }}.dmg
path: target/release/Zed.dmg
- name: Upload app bundle (aarch64) to workflow run if main branch or specific label
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
@@ -297,8 +313,6 @@ jobs:
target/zed-remote-server-macos-aarch64.gz
target/aarch64-apple-darwin/release/Zed-aarch64.dmg
target/x86_64-apple-darwin/release/Zed-x86_64.dmg
target/release/Zed.dmg
body_path: target/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -345,7 +359,6 @@ jobs:
files: |
target/zed-remote-server-linux-x86_64.gz
target/release/zed-linux-x86_64.tar.gz
body: ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -392,6 +405,18 @@ jobs:
files: |
target/zed-remote-server-linux-aarch64.gz
target/release/zed-linux-aarch64.tar.gz
body: ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
auto-release-preview:
name: Auto release preview
if: ${{ startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre') }}
needs: [bundle-mac, bundle-linux, bundle-linux-aarch64]
runs-on:
- self-hosted
- bundle
steps:
- name: gh release
run: gh release edit $GITHUB_REF_NAME --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -6,6 +6,7 @@ on:
jobs:
stale:
if: github.repository_owner == 'zed-industries'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
@@ -24,7 +25,7 @@ jobs:
# issues, preventing 365 days from working until then.
days-before-stale: 180
days-before-close: 7
any-of-issue-labels: "defect,panic / crash"
any-of-issue-labels: "bug,panic / crash"
operations-per-run: 1000
ascending: true
enable-statistics: true

View File

@@ -8,11 +8,11 @@ on:
jobs:
update_top_ranking_issues:
runs-on: ubuntu-latest
if: github.repository_owner == 'zed-industries'
if: github.repository == 'zed-industries/zed'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up uv
uses: astral-sh/setup-uv@f3bcaebff5eace81a1c062af9f9011aae482ca9d # v3
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
with:
version: "latest"
enable-cache: true

View File

@@ -8,11 +8,11 @@ on:
jobs:
update_top_ranking_issues:
runs-on: ubuntu-latest
if: github.repository_owner == 'zed-industries'
if: github.repository == 'zed-industries/zed'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up uv
uses: astral-sh/setup-uv@f3bcaebff5eace81a1c062af9f9011aae482ca9d # v3
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
with:
version: "latest"
enable-cache: true

View File

@@ -21,7 +21,7 @@ jobs:
version: 9
- name: Setup Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "20"
cache: "pnpm"

View File

@@ -37,28 +37,28 @@ jobs:
mdbook build ./docs --dest-dir=../target/deploy/docs/
- name: Deploy Docs
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy target/deploy --project-name=docs
- name: Deploy Install
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: r2 object put -f script/install.sh zed-open-source-website-assets/install.sh
- name: Deploy Docs Workers
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy .cloudflare/docs-proxy/src/worker.js
- name: Deploy Install Workers
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

View File

@@ -22,7 +22,7 @@ jobs:
- buildjet-16vcpu-ubuntu-2204
steps:
- name: Install Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "18"

View File

@@ -70,7 +70,7 @@ jobs:
ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
steps:
- name: Install Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "18"
@@ -140,7 +140,7 @@ jobs:
name: Create a Linux *.tar.gz bundle for ARM
if: github.repository_owner == 'zed-industries'
runs-on:
- hosted-linux-arm-1
- buildjet-16vcpu-ubuntu-2204-arm
needs: tests
env:
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}

21
.github/workflows/script_checks.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Script
on:
pull_request:
paths:
- "script/**"
push:
branches:
- main
jobs:
shellcheck:
name: "ShellCheck Scripts"
if: github.repository_owner == 'zed-industries'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Shellcheck ./scripts
run: |
./script/shellcheck-scripts error

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/.direnv
.envrc
.idea
**/target
**/cargo-target

View File

@@ -22,10 +22,14 @@ Antonio Scandurra <me@as-cii.com> <antonio@zed.dev>
Bennet Bo Fenner <bennet@zed.dev>
Bennet Bo Fenner <bennet@zed.dev> <53836821+bennetbo@users.noreply.github.com>
Bennet Bo Fenner <bennet@zed.dev> <bennetbo@gmx.de>
Boris Cherny <boris@anthropic.com>
Boris Cherny <boris@anthropic.com> <boris@performancejs.com>
Chris Hayes <chris+git@hayes.software>
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>
Dairon Medina <dairon.medina@gmail.com>
Danilo Leal <danilo@zed.dev>
Danilo Leal <danilo@zed.dev> <67129314+danilo-leal@users.noreply.github.com>
Evren Sen <nervenes@icloud.com>
@@ -35,6 +39,7 @@ Fernando Tagawa <tagawafernando@gmail.com>
Fernando Tagawa <tagawafernando@gmail.com> <fernando.tagawa.gamail.com@gmail.com>
Greg Morenz <greg-morenz@droid.cafe>
Greg Morenz <greg-morenz@droid.cafe> <morenzg@gmail.com>
Ihnat Aŭtuška <autushka.ihnat@gmail.com>
Ivan Žužak <izuzak@gmail.com>
Ivan Žužak <izuzak@gmail.com> <ivan.zuzak@github.com>
Joseph T. Lyons <JosephTLyons@gmail.com>
@@ -60,9 +65,14 @@ Max Brunsfeld <maxbrunsfeld@gmail.com>
Max Brunsfeld <maxbrunsfeld@gmail.com> <max@zed.dev>
Max Linke <maxlinke88@gmail.com>
Max Linke <maxlinke88@gmail.com> <kain88-de@users.noreply.github.com>
Michael Sloan <michael@zed.dev>
Michael Sloan <michael@zed.dev> <mgsloan@gmail.com>
Michael Sloan <michael@zed.dev> <mgsloan@google.com>
Mikayla Maki <mikayla@zed.dev>
Mikayla Maki <mikayla@zed.dev> <mikayla.c.maki@gmail.com>
Mikayla Maki <mikayla@zed.dev> <mikayla.c.maki@icloud.com>
Muhammad Talal Anwar <mail@talal.io>
Muhammad Talal Anwar <mail@talal.io> <talalanwar@outlook.com>
Nate Butler <iamnbutler@gmail.com>
Nate Butler <iamnbutler@gmail.com> <nate@zed.dev>
Nathan Sobo <nathan@zed.dev>
@@ -86,7 +96,11 @@ Robert Clover <git@clo4.net>
Robert Clover <git@clo4.net> <robert@clover.gdn>
Roy Williams <roy.williams.iii@gmail.com>
Roy Williams <roy.williams.iii@gmail.com> <roy@anthropic.com>
Sebastijan Kelnerič <sebastijan.kelneric@sebba.dev>
Sebastijan Kelnerič <sebastijan.kelneric@sebba.dev> <sebastijan.kelneric@vichava.com>
Sergey Onufrienko <sergey@onufrienko.com>
Shish <webmaster@shishnet.org>
Shish <webmaster@shishnet.org> <shish@shishnet.org>
Thorben Kröger <dev@thorben.net>
Thorben Kröger <dev@thorben.net> <thorben.kroeger@hexagon.com>
Thorsten Ball <thorsten@zed.dev>

View File

@@ -1,3 +1,3 @@
# Code of Conduct
The Code of Conduct for this repository can be found online at [zed.dev/docs/code-of-conduct](https://zed.dev/docs/code-of-conduct).
The Code of Conduct for this repository can be found online at [zed.dev/code-of-conduct](https://zed.dev/code-of-conduct).

View File

@@ -2,7 +2,7 @@
Thanks for your interest in contributing to Zed, the collaborative platform that is also a code editor!
All activity in Zed forums is subject to our [Code of Conduct](https://zed.dev/docs/code-of-conduct). Additionally, contributors must sign our [Contributor License Agreement](https://zed.dev/cla) before their contributions can be merged.
All activity in Zed forums is subject to our [Code of Conduct](https://zed.dev/code-of-conduct). Additionally, contributors must sign our [Contributor License Agreement](https://zed.dev/cla) before their contributions can be merged.
## Contribution ideas

4698
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,10 +5,13 @@ members = [
"crates/anthropic",
"crates/assets",
"crates/assistant",
"crates/assistant2",
"crates/assistant_slash_command",
"crates/assistant_tool",
"crates/assistant_tools",
"crates/audio",
"crates/auto_update",
"crates/auto_update_ui",
"crates/breadcrumbs",
"crates/call",
"crates/channel",
@@ -20,10 +23,10 @@ members = [
"crates/collections",
"crates/command_palette",
"crates/command_palette_hooks",
"crates/context_servers",
"crates/context_server",
"crates/context_server_settings",
"crates/copilot",
"crates/db",
"crates/dev_server_projects",
"crates/diagnostics",
"crates/docs_preprocessor",
"crates/editor",
@@ -31,6 +34,7 @@ members = [
"crates/extension",
"crates/extension_api",
"crates/extension_cli",
"crates/extension_host",
"crates/extensions_ui",
"crates/feature_flags",
"crates/feedback",
@@ -45,21 +49,25 @@ members = [
"crates/google_ai",
"crates/gpui",
"crates/gpui_macros",
"crates/headless",
"crates/html_to_markdown",
"crates/http_client",
"crates/image_viewer",
"crates/indexed_docs",
"crates/inline_completion",
"crates/inline_completion_button",
"crates/install_cli",
"crates/journal",
"crates/language",
"crates/language_extension",
"crates/language_model",
"crates/language_model_selector",
"crates/language_models",
"crates/language_selector",
"crates/language_tools",
"crates/languages",
"crates/live_kit_client",
"crates/live_kit_server",
"crates/livekit_client",
"crates/livekit_client_macos",
"crates/livekit_server",
"crates/lsp",
"crates/markdown",
"crates/markdown_preview",
@@ -79,7 +87,6 @@ members = [
"crates/project_panel",
"crates/project_symbols",
"crates/proto",
"crates/quick_action_bar",
"crates/recent_projects",
"crates/refineable",
"crates/refineable/derive_refineable",
@@ -115,10 +122,12 @@ members = [
"crates/terminal_view",
"crates/text",
"crates/theme",
"crates/theme_extension",
"crates/theme_importer",
"crates/theme_selector",
"crates/time_format",
"crates/title_bar",
"crates/toolchain_selector",
"crates/ui",
"crates/ui_input",
"crates/ui_macros",
@@ -126,11 +135,14 @@ members = [
"crates/util",
"crates/vcs_menu",
"crates/vim",
"crates/vim_mode_setting",
"crates/welcome",
"crates/workspace",
"crates/worktree",
"crates/zed",
"crates/zed_actions",
"crates/zeta",
"crates/git_ui",
#
# Extensions
@@ -139,7 +151,6 @@ members = [
"extensions/astro",
"extensions/clojure",
"extensions/csharp",
"extensions/dart",
"extensions/deno",
"extensions/elixir",
"extensions/elm",
@@ -149,7 +160,6 @@ members = [
"extensions/haskell",
"extensions/html",
"extensions/lua",
"extensions/ocaml",
"extensions/php",
"extensions/perplexity",
"extensions/prisma",
@@ -183,10 +193,13 @@ ai = { path = "crates/ai" }
anthropic = { path = "crates/anthropic" }
assets = { path = "crates/assets" }
assistant = { path = "crates/assistant" }
assistant2 = { path = "crates/assistant2" }
assistant_slash_command = { path = "crates/assistant_slash_command" }
assistant_tool = { path = "crates/assistant_tool" }
assistant_tools = { path = "crates/assistant_tools" }
audio = { path = "crates/audio" }
auto_update = { path = "crates/auto_update" }
auto_update_ui = { path = "crates/auto_update_ui" }
breadcrumbs = { path = "crates/breadcrumbs" }
call = { path = "crates/call" }
channel = { path = "crates/channel" }
@@ -198,13 +211,14 @@ collab_ui = { path = "crates/collab_ui" }
collections = { path = "crates/collections" }
command_palette = { path = "crates/command_palette" }
command_palette_hooks = { path = "crates/command_palette_hooks" }
context_servers = { path = "crates/context_servers" }
context_server = { path = "crates/context_server" }
context_server_settings = { path = "crates/context_server_settings" }
copilot = { path = "crates/copilot" }
db = { path = "crates/db" }
dev_server_projects = { path = "crates/dev_server_projects" }
diagnostics = { path = "crates/diagnostics" }
editor = { path = "crates/editor" }
extension = { path = "crates/extension" }
extension_host = { path = "crates/extension_host" }
extensions_ui = { path = "crates/extensions_ui" }
feature_flags = { path = "crates/feature_flags" }
feedback = { path = "crates/feedback" }
@@ -214,26 +228,33 @@ fs = { path = "crates/fs" }
fsevent = { path = "crates/fsevent" }
fuzzy = { path = "crates/fuzzy" }
git = { path = "crates/git" }
git_ui = { path = "crates/git_ui" }
git_hosting_providers = { path = "crates/git_hosting_providers" }
go_to_line = { path = "crates/go_to_line" }
google_ai = { path = "crates/google_ai" }
gpui = { path = "crates/gpui", default-features = false, features = ["http_client"]}
gpui = { path = "crates/gpui", default-features = false, features = [
"http_client",
] }
gpui_macros = { path = "crates/gpui_macros" }
headless = { path = "crates/headless" }
html_to_markdown = { path = "crates/html_to_markdown" }
http_client = { path = "crates/http_client" }
image_viewer = { path = "crates/image_viewer" }
indexed_docs = { path = "crates/indexed_docs" }
inline_completion = { path = "crates/inline_completion" }
inline_completion_button = { path = "crates/inline_completion_button" }
install_cli = { path = "crates/install_cli" }
journal = { path = "crates/journal" }
language = { path = "crates/language" }
language_extension = { path = "crates/language_extension" }
language_model = { path = "crates/language_model" }
language_model_selector = { path = "crates/language_model_selector" }
language_models = { path = "crates/language_models" }
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" }
livekit_client = { path = "crates/livekit_client" }
livekit_client_macos = { path = "crates/livekit_client_macos" }
livekit_server = { path = "crates/livekit_server" }
lsp = { path = "crates/lsp" }
markdown = { path = "crates/markdown" }
markdown_preview = { path = "crates/markdown_preview" }
@@ -255,7 +276,6 @@ project = { path = "crates/project" }
project_panel = { path = "crates/project_panel" }
project_symbols = { path = "crates/project_symbols" }
proto = { path = "crates/proto" }
quick_action_bar = { path = "crates/quick_action_bar" }
recent_projects = { path = "crates/recent_projects" }
refineable = { path = "crates/refineable" }
release_channel = { path = "crates/release_channel" }
@@ -290,21 +310,25 @@ terminal = { path = "crates/terminal" }
terminal_view = { path = "crates/terminal_view" }
text = { path = "crates/text" }
theme = { path = "crates/theme" }
theme_extension = { path = "crates/theme_extension" }
theme_importer = { path = "crates/theme_importer" }
theme_selector = { path = "crates/theme_selector" }
time_format = { path = "crates/time_format" }
title_bar = { path = "crates/title_bar" }
toolchain_selector = { path = "crates/toolchain_selector" }
ui = { path = "crates/ui" }
ui_input = { path = "crates/ui_input" }
ui_macros = { path = "crates/ui_macros" }
util = { path = "crates/util" }
vcs_menu = { path = "crates/vcs_menu" }
vim = { path = "crates/vim" }
vim_mode_setting = { path = "crates/vim_mode_setting" }
welcome = { path = "crates/welcome" }
workspace = { path = "crates/workspace" }
worktree = { path = "crates/worktree" }
zed = { path = "crates/zed" }
zed_actions = { path = "crates/zed_actions" }
zeta = { path = "crates/zeta" }
#
# External crates
@@ -315,7 +339,7 @@ alacritty_terminal = { git = "https://github.com/alacritty/alacritty", rev = "91
any_vec = "0.14"
anyhow = "1.0.86"
arrayvec = { version = "0.7.4", features = ["serde"] }
ashpd = "0.9.1"
ashpd = { version = "0.10", default-features = false, features = ["async-std"]}
async-compat = "0.2.1"
async-compression = { version = "0.4", features = ["gzip", "futures-io"] }
async-dispatcher = "0.1"
@@ -324,7 +348,7 @@ async-pipe = { git = "https://github.com/zed-industries/async-pipe-rs", rev = "8
async-recursion = "1.0.0"
async-tar = "0.5.0"
async-trait = "0.1"
async-tungstenite = "0.24"
async-tungstenite = "0.28"
async-watch = "0.3.1"
async_zip = { version = "0.0.17", features = ["deflate", "deflate64"] }
base64 = "0.22"
@@ -334,12 +358,12 @@ blade-macros = { git = "https://github.com/kvark/blade", rev = "e142a3a5e678eb6a
blade-util = { git = "https://github.com/kvark/blade", rev = "e142a3a5e678eb6a13e642ad8401b1f3aa38e969" }
blake3 = "1.5.3"
bytes = "1.0"
cargo_metadata = "0.18"
cargo_metadata = "0.19"
cargo_toml = "0.20"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.4", features = ["derive"] }
clickhouse = "0.11.6"
cocoa = "0.26"
cocoa-foundation = "0.2.0"
convert_case = "0.6.0"
core-foundation = "0.9.3"
core-foundation-sys = "0.8.6"
@@ -351,6 +375,7 @@ ec4rs = "1.1"
emojis = "0.6.1"
env_logger = "0.11"
exec = "0.3.1"
fancy-regex = "0.14.0"
fork = "0.2.0"
futures = "0.3"
futures-batch = "0.6.1"
@@ -362,17 +387,23 @@ heed = { version = "0.20.1", features = ["read-txn-no-tls"] }
hex = "0.4.3"
html5ever = "0.27.0"
hyper = "0.14"
http = "1.1"
ignore = "0.4.22"
image = "0.25.1"
indexmap = { version = "1.6.2", features = ["serde"] }
indoc = "2"
itertools = "0.13.0"
jsonwebtoken = "9.3"
jupyter-protocol = { version = "0.5.0" }
jupyter-websocket-client = { version = "0.8.0" }
libc = "0.2"
libsqlite3-sys = { version = "0.30.1", features = ["bundled"] }
linkify = "0.10.0"
livekit = { git = "https://github.com/zed-industries/rust-sdks", rev="799f10133d93ba2a88642cd480d01ec4da53408c", features = ["dispatcher", "services-dispatcher", "rustls-tls-native-roots"], default-features = false }
log = { version = "0.4.16", features = ["kv_unstable_serde", "serde"] }
markup5ever_rcdom = "0.3.0"
nanoid = "0.4"
nbformat = { version = "0.9.0" }
nix = "0.29"
num-format = "0.4.4"
once_cell = "1.19.0"
@@ -380,14 +411,21 @@ ordered-float = "2.1.1"
palette = { version = "0.7.5", default-features = false, features = ["std"] }
parking_lot = "0.12.1"
pathdiff = "0.2"
pet = { git = "https://github.com/microsoft/python-environment-tools.git", rev = "ffcbf3f28c46633abd5448a52b1f396c322e0d6c" }
pet-fs = { git = "https://github.com/microsoft/python-environment-tools.git", rev = "ffcbf3f28c46633abd5448a52b1f396c322e0d6c" }
pet-conda = { git = "https://github.com/microsoft/python-environment-tools.git", rev = "ffcbf3f28c46633abd5448a52b1f396c322e0d6c" }
pet-core = { git = "https://github.com/microsoft/python-environment-tools.git", rev = "ffcbf3f28c46633abd5448a52b1f396c322e0d6c" }
pet-poetry = { git = "https://github.com/microsoft/python-environment-tools.git", rev = "ffcbf3f28c46633abd5448a52b1f396c322e0d6c" }
pet-reporter = { git = "https://github.com/microsoft/python-environment-tools.git", rev = "ffcbf3f28c46633abd5448a52b1f396c322e0d6c" }
postage = { version = "0.5", features = ["futures-traits"] }
pretty_assertions = "1.3.0"
pretty_assertions = { version = "1.3.0", features = ["unstable"] }
profiling = "1"
prost = "0.9"
prost-build = "0.9"
prost-types = "0.9"
pulldown-cmark = { version = "0.12.0", default-features = false }
rand = "0.8.5"
rayon = "1.8"
regex = "1.5"
repair_json = "0.1.0"
reqwest = { git = "https://github.com/zed-industries/reqwest.git", rev = "fd110f6998da16bbca97b6dddda9be7827c50e29", default-features = false, features = [
@@ -399,12 +437,12 @@ reqwest = { git = "https://github.com/zed-industries/reqwest.git", rev = "fd110f
"stream",
] }
rsa = "0.9.6"
runtimelib = { version = "0.15", default-features = false, features = [
runtimelib = { version = "0.24.0", default-features = false, features = [
"async-dispatcher-runtime",
] }
rustc-demangle = "0.1.23"
rust-embed = { version = "8.4", features = ["include-exclude"] }
rustls = "0.20.3"
rustls = "0.21.12"
rustls-native-certs = "0.8.0"
schemars = { version = "0.8", features = ["impl_json_schema"] }
semver = "1.0"
@@ -468,9 +506,10 @@ tree-sitter-typescript = "0.23"
tree-sitter-yaml = { git = "https://github.com/zed-industries/tree-sitter-yaml", rev = "baff0b51c64ef6a1fb1f8390f3ad6015b83ec13a" }
unicase = "2.6"
unindent = "0.1.7"
unicode-segmentation = "1.11"
unicode-segmentation = "1.10"
unicode-script = "0.5.7"
url = "2.2"
uuid = { version = "1.1.2", features = ["v4", "v5", "serde"] }
uuid = { version = "1.1.2", features = ["v4", "v5", "v7", "serde"] }
wasmparser = "0.215"
wasm-encoder = "0.215"
wasmtime = { version = "24", default-features = false, features = [
@@ -539,6 +578,10 @@ features = [
"Win32_UI_WindowsAndMessaging",
]
# TODO livekit https://github.com/RustAudio/cpal/pull/891
[patch.crates-io]
cpal = { git = "https://github.com/zed-industries/cpal", rev = "fd8bc2fd39f1f5fdee5a0690656caff9a26d9d50" }
[profile.dev]
split-debuginfo = "unpacked"
debug = "limited"
@@ -552,6 +595,46 @@ rustybuzz = { opt-level = 3 }
ttf-parser = { opt-level = 3 }
wasmtime-cranelift = { opt-level = 3 }
wasmtime = { opt-level = 3 }
# Build single-source-file crates with cg=1 as it helps make `cargo build` of a whole workspace a bit faster
activity_indicator = { codegen-units = 1 }
assets = { codegen-units = 1 }
breadcrumbs = { codegen-units = 1 }
collections = { codegen-units = 1 }
command_palette = { codegen-units = 1 }
command_palette_hooks = { codegen-units = 1 }
evals = { codegen-units = 1 }
extension_cli = { codegen-units = 1 }
feature_flags = { codegen-units = 1 }
file_icons = { codegen-units = 1 }
fsevent = { codegen-units = 1 }
image_viewer = { codegen-units = 1 }
inline_completion_button = { codegen-units = 1 }
install_cli = { codegen-units = 1 }
journal = { codegen-units = 1 }
menu = { codegen-units = 1 }
notifications = { codegen-units = 1 }
ollama = { codegen-units = 1 }
outline = { codegen-units = 1 }
paths = { codegen-units = 1 }
prettier = { codegen-units = 1 }
project_symbols = { codegen-units = 1 }
refineable = { codegen-units = 1 }
release_channel = { codegen-units = 1 }
reqwest_client = { codegen-units = 1 }
rich_text = { codegen-units = 1 }
semantic_version = { codegen-units = 1 }
session = { codegen-units = 1 }
snippet = { codegen-units = 1 }
snippets_ui = { codegen-units = 1 }
sqlez_macros = { codegen-units = 1 }
story = { codegen-units = 1 }
supermaven_api = { codegen-units = 1 }
telemetry_events = { codegen-units = 1 }
theme_selector = { codegen-units = 1 }
time_format = { codegen-units = 1 }
ui_input = { codegen-units = 1 }
vcs_menu = { codegen-units = 1 }
zed_actions = { codegen-units = 1 }
[profile.release]
debug = "limited"
@@ -601,6 +684,7 @@ new_ret_no_self = { level = "allow" }
# We have a few `next` functions that differ in lifetimes
# compared to Iterator::next. Yet, clippy complains about those.
should_implement_trait = { level = "allow" }
let_underscore_future = "allow"
[workspace.metadata.cargo-machete]
ignored = ["bindgen", "cbindgen", "prost_build", "serde"]

1
assets/icons/blocks.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-blocks"><rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/></svg>

After

Width:  |  Height:  |  Size: 368 B

View File

@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor"><path d="M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1"/><path d="M7 22h1a4 4 0 0 0 4-4v-1"/><path d="M7 2h1a4 4 0 0 1 4 4v1"/></svg>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 20H16C14.9391 20 13.9217 19.6629 13.1716 19.0627C12.4214 18.4626 12 17.6487 12 16.8V7.2C12 6.35131 12.4214 5.53737 13.1716 4.93726C13.9217 4.33714 14.9391 4 16 4H17" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7 20H8C9.06087 20 10.0783 19.5786 10.8284 18.8284C11.5786 18.0783 12 17.0609 12 16V15" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7 4H8C9.06087 4 10.0783 4.42143 10.8284 5.17157C11.5786 5.92172 12 6.93913 12 8V9" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 715 B

4
assets/icons/eraser.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eraser">
<path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/>
<path d="M22 21H7"/><path d="m5 11 9 9"/>
</svg>

After

Width:  |  Height:  |  Size: 365 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-diff"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M9 10h6"/><path d="M12 13V7"/><path d="M9 17h6"/></svg>

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -1,4 +1,8 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.20721 10.8551C7.67694 10.8551 6.33401 11.0424 5.52243 11.1878C5.15088 11.2543 4.808 10.9114 4.87454 10.5399C5.01987 9.72825 5.20721 8.38532 5.20721 6.85505C5.20721 5.69375 5.09932 4.64034 4.98377 3.84516C4.9431 3.56522 5.40267 3.3722 5.5684 3.60145C6.30333 4.61809 7.44022 6.08806 8.70721 7.35505C9.9742 8.62204 11.4442 9.75893 12.4608 10.4939C12.69 10.6596 12.497 11.1192 12.2171 11.0785C11.4219 10.963 10.3685 10.8551 9.20721 10.8551Z" fill="black" stroke="black" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.11129 10.6816L5.28324 8.85355C5.08798 8.65829 4.7714 8.65829 4.57613 8.85355L3.35355 10.0761C3.15829 10.2714 3.15829 10.588 3.35355 10.7832L5.1816 12.6113C5.37686 12.8066 5.69345 12.8066 5.88871 12.6113L7.11129 11.3887C7.30655 11.1934 7.30655 10.8769 7.11129 10.6816Z" fill="black"/>
<path d="M3.5 6.66666V8.66666" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.5 5V11" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.5 3V13" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.5 5.33334V10" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.5 4V12" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13.5 6.66666V8.66666" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 946 B

After

Width:  |  Height:  |  Size: 751 B

View File

@@ -0,0 +1,5 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.5 3L8.5 10" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5 6.5H12" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5 13H12" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 415 B

View File

@@ -34,6 +34,7 @@
"dat": "storage",
"db": "storage",
"dbf": "storage",
"diff": "diff",
"dll": "storage",
"doc": "document",
"docx": "document",
@@ -58,6 +59,12 @@
"gitignore": "vcs",
"gitkeep": "vcs",
"gitmodules": "vcs",
"TAG_EDITMSG": "vcs",
"MERGE_MSG": "vcs",
"COMMIT_EDITMSG": "vcs",
"NOTES_EDITMSG": "vcs",
"EDIT_DESCRIPTION": "vcs",
"gleam": "gleam",
"go": "go",
"gql": "graphql",
"graphql": "graphql",
@@ -83,6 +90,7 @@
"j2k": "image",
"java": "java",
"jfif": "image",
"jl": "julia",
"jp2": "image",
"jpeg": "image",
"jpg": "image",
@@ -90,7 +98,6 @@
"json": "storage",
"jsonc": "storage",
"jsx": "react",
"julia": "julia",
"jxl": "image",
"kt": "kotlin",
"ldf": "storage",
@@ -106,11 +113,13 @@
"mdf": "storage",
"mdx": "document",
"metadata": "code",
"metal": "metal",
"mjs": "javascript",
"mka": "audio",
"mkv": "video",
"ml": "ocaml",
"mli": "ocaml",
"mod": "go",
"mov": "video",
"mp3": "audio",
"mp4": "video",
@@ -126,6 +135,7 @@
"ogg": "audio",
"opus": "audio",
"otf": "font",
"pcss": "css",
"pdb": "storage",
"pdf": "document",
"php": "php",
@@ -172,6 +182,9 @@
"tsx": "react",
"ttf": "font",
"txt": "document",
"v": "v",
"vsh": "v",
"vv": "v",
"vue": "vue",
"wav": "audio",
"webm": "video",
@@ -180,6 +193,7 @@
"wmv": "video",
"woff": "font",
"woff2": "font",
"work": "go",
"wv": "audio",
"xls": "document",
"xlsx": "document",
@@ -234,6 +248,9 @@
"default": {
"icon": "icons/file_icons/file.svg"
},
"diff": {
"icon": "icons/file_icons/diff.svg"
},
"docker": {
"icon": "icons/file_icons/docker.svg"
},
@@ -264,6 +281,9 @@
"fsharp": {
"icon": "icons/file_icons/fsharp.svg"
},
"gleam": {
"icon": "icons/file_icons/gleam.svg"
},
"go": {
"icon": "icons/file_icons/go.svg"
},
@@ -303,6 +323,9 @@
"lua": {
"icon": "icons/file_icons/lua.svg"
},
"metal": {
"icon": "icons/file_icons/metal.svg"
},
"nim": {
"icon": "icons/file_icons/nim.svg"
},
@@ -375,6 +398,9 @@
"typescript": {
"icon": "icons/file_icons/typescript.svg"
},
"v": {
"icon": "icons/file_icons/v.svg"
},
"vcs": {
"icon": "icons/file_icons/git.svg"
},

View File

@@ -0,0 +1,7 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.3848 9.30444C7.3848 9.30444 7.53254 10.2646 8.53248 10.0882C9.53242 9.91193 9.36378 8.95549 9.36378 8.95549" stroke="black" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.54155 5.54157C6.12355 4.90104 6.01688 2.62541 7.22875 2.3985C8.44063 2.17158 9.19097 4.33148 9.91982 4.6814C10.6487 5.03133 12.8517 4.3028 13.4381 5.38734C14.0244 6.47188 12.1395 7.95973 12.026 8.64088C11.9126 9.32203 13.3614 11.2416 12.4675 12.1701C11.5736 13.0986 9.73005 11.7545 8.90486 11.8834C8.07966 12.0123 6.79244 13.9095 5.67367 13.3502C4.55491 12.7909 5.16702 10.5455 4.82437 9.87612C4.48171 9.20673 2.34028 8.54978 2.4525 7.35049C2.56471 6.15121 4.95956 6.1821 5.54155 5.54157Z" stroke="#FF7676" stroke-opacity="0.52" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.54155 5.54157C6.12355 4.90104 6.01688 2.62541 7.22875 2.3985C8.44063 2.17158 9.19097 4.33148 9.91982 4.6814C10.6487 5.03133 12.8517 4.3028 13.4381 5.38734C14.0244 6.47188 12.1395 7.95973 12.026 8.64088C11.9126 9.32203 13.3614 11.2416 12.4675 12.1701C11.5736 13.0986 9.73005 11.7545 8.90486 11.8834C8.07966 12.0123 6.79244 13.9095 5.67367 13.3502C4.55491 12.7909 5.16702 10.5455 4.82437 9.87612C4.48171 9.20673 2.34028 8.54978 2.4525 7.35049C2.56471 6.15121 4.95956 6.1821 5.54155 5.54157Z" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="6.25098" cy="7.75" r="0.75" fill="black"/>
<circle cx="10.1035" cy="7.25" r="0.75" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.56 4.502 3.25 3.027V11.5h1.5V6.973l2.69 3.025 1.31 1.475V7.918l3.306 3.582h2.042L8.55 5.491 7.25 4.081V7.528L4.56 4.502Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 269 B

View File

@@ -0,0 +1,4 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.5" d="M10.0469 12.8661L13.3884 3.31889C13.4386 3.1754 13.3167 3.03055 13.1667 3.05554L10.7292 3.46179C10.5875 3.48542 10.4693 3.58324 10.4197 3.71807L7.24789 12.3271C7.12763 12.6536 7.36919 13 7.71706 13H9.8581C9.94309 13 10.0188 12.9463 10.0469 12.8661Z" fill="black"/>
<path d="M6.90625 12.7321L3.61161 3.31889C3.56139 3.1754 3.6833 3.03055 3.83326 3.05554L6.27076 3.46179C6.4125 3.48542 6.53067 3.58324 6.58034 3.71807L9.90084 12.7309C9.94895 12.8614 9.85232 13 9.71317 13H7.28379C7.11381 13 6.9624 12.8926 6.90625 12.7321Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 663 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-search"><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3"/><path d="m9 18-1.5-1.5"/><circle cx="5" cy="14" r="3"/></svg>

After

Width:  |  Height:  |  Size: 393 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-git-branch"><line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/></svg>

After

Width:  |  Height:  |  Size: 348 B

1
assets/icons/globe.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-globe"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></svg>

After

Width:  |  Height:  |  Size: 327 B

View File

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.4662 14.9152C13.5801 15.0291 13.7648 15.0291 13.8787 14.9152L14.9145 13.8793C15.0284 13.7654 15.0284 13.5807 14.9145 13.4667L12.9483 11.5004L14.9145 9.53392C15.0285 9.42004 15.0285 9.23533 14.9145 9.12137L13.8787 8.08547C13.7648 7.97154 13.5801 7.97154 13.4662 8.08547L11.5 10.0519L9.53376 8.08545C9.41988 7.97152 9.23517 7.97152 9.12124 8.08545L8.08543 9.12136C7.97152 9.23533 7.97152 9.42004 8.08543 9.53392L10.0517 11.5004L8.08545 13.4667C7.97155 13.5807 7.97155 13.7654 8.08545 13.8793L9.12126 14.9152C9.23517 15.0292 9.41988 15.0292 9.53376 14.9152L11.5 12.9489L13.4662 14.9152Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 756 B

12
assets/icons/info.svg Normal file
View File

@@ -0,0 +1,12 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2131_1193)">
<circle cx="7" cy="7" r="6" stroke="black" stroke-width="1.5"/>
<path d="M6 10H7M8 10H7M7 10V7.1C7 7.04477 6.95523 7 6.9 7H6" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
<circle cx="7" cy="4.5" r="1" fill="black"/>
</g>
<defs>
<clipPath id="clip0_2131_1193">
<rect width="14" height="14" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 479 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-keyboard"><path d="M10 8h.01"/><path d="M12 12h.01"/><path d="M14 8h.01"/><path d="M16 12h.01"/><path d="M18 8h.01"/><path d="M6 8h.01"/><path d="M7 16h10"/><path d="M8 12h.01"/><rect width="20" height="16" x="2" y="4" rx="2"/></svg>

After

Width:  |  Height:  |  Size: 436 B

View File

@@ -0,0 +1,3 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.1" y="2.1" width="6.8" height="6.8" rx="3.4" stroke="black" stroke-width="1.8"/>
</svg>

After

Width:  |  Height:  |  Size: 195 B

View File

@@ -0,0 +1,3 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="3" width="5" height="5" rx="2.5" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 166 B

View File

@@ -0,0 +1,10 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2080_948)">
<path d="M1.52492 8.72287L1.04243 9.55H2H9H9.95757L9.47508 8.72287L5.97508 2.72287L5.5 1.90845L5.02492 2.72287L1.52492 8.72287Z" stroke="black" stroke-width="1.1"/>
</g>
<defs>
<clipPath id="clip0_2080_948">
<rect width="11" height="11" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 412 B

View File

@@ -0,0 +1,3 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 9H9L5.5 3L2 9Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 146 B

View File

@@ -0,0 +1,10 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2050_903)">
<path d="M1.83327 2.89393L1.19687 3.53033L1.83327 4.16672L3.16654 5.5L1.83327 6.83327L1.19687 7.46967L1.83327 8.10606L2.89393 9.16672L3.53033 9.80312L4.16672 9.16672L5.5 7.83345L6.83327 9.16672L7.46967 9.80312L8.10606 9.16672L9.16672 8.10606L9.80312 7.46967L9.16672 6.83327L7.83345 5.5L9.16672 4.16672L9.80312 3.53033L9.16672 2.89393L8.10606 1.83327L7.46967 1.19687L6.83327 1.83327L5.5 3.16654L4.16672 1.83327L3.53033 1.19687L2.89393 1.83327L1.83327 2.89393Z" stroke="black" stroke-width="1.8"/>
</g>
<defs>
<clipPath id="clip0_2050_903">
<rect width="11" height="11" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 743 B

View File

@@ -0,0 +1,3 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 3L5.5 5.5M8 8L5.5 5.5M5.5 5.5L3 8M5.5 5.5L8 3" stroke="black" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 198 B

7
assets/icons/list_x.svg Normal file
View File

@@ -0,0 +1,7 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.33333 8H3" stroke="#FBF1C7" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.6667 4H3" stroke="#FBF1C7" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.6667 12H3" stroke="#FBF1C7" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13.6667 6.66663L11 9.33329" stroke="#FBF1C7" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11 6.66663L13.6667 9.33329" stroke="#FBF1C7" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 579 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></svg>

After

Width:  |  Height:  |  Size: 289 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-right"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/></svg>

After

Width:  |  Height:  |  Size: 291 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone-incoming"><polyline points="16 2 16 8 22 8"/><line x1="22" x2="16" y1="2" y2="8"/><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/></svg>

After

Width:  |  Height:  |  Size: 594 B

View File

@@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 21V12M7 12H3M7 12H11" stroke="black" stroke-width="2" stroke-linecap="round"/>
<path d="M21 19L16 19L16 14" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.99987 5.07027L7.49915 4.20467L7.99987 5.07027ZM6.04652 5.25026C5.63245 5.61573 5.59305 6.24766 5.95851 6.66173C6.32398 7.0758 6.95592 7.1152 7.36999 6.74974L6.04652 5.25026ZM11.9999 5C15.8659 5 18.9999 8.13401 18.9999 12H20.9999C20.9999 7.02944 16.9705 3 11.9999 3V5ZM18.9999 12C18.9999 14.2101 17.9768 16.1806 16.3744 17.4651L17.6254 19.0256C19.6809 17.3779 20.9999 14.8426 20.9999 12H18.9999ZM8.5006 5.93588C9.5292 5.34086 10.7232 5 11.9999 5V3C10.3623 3 8.82395 3.4383 7.49915 4.20467L8.5006 5.93588ZM7.36999 6.74974C7.71803 6.44255 8.09667 6.16954 8.5006 5.93588L7.49915 4.20467C6.9797 4.50515 6.49329 4.85593 6.04652 5.25026L7.36999 6.74974Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 979 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-dot"><rect width="18" height="18" x="3" y="3" rx="2"/><circle cx="12" cy="12" r="1"/></svg>

After

Width:  |  Height:  |  Size: 301 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-minus"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M8 12h8"/></svg>

After

Width:  |  Height:  |  Size: 291 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-plus"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M8 12h8"/><path d="M12 8v8"/></svg>

After

Width:  |  Height:  |  Size: 309 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-swatch-book"><path d="M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z"/><path d="M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7"/><path d="M 7 17h.01"/><path d="m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8"/></svg>

After

Width:  |  Height:  |  Size: 456 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-thumbs-down"><path d="M17 14V2"/><path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"/></svg>

After

Width:  |  Height:  |  Size: 405 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-thumbs-up"><path d="M7 10v12"/><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"/></svg>

After

Width:  |  Height:  |  Size: 404 B

View File

@@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.5 3L3 12H14L8.5 3Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 150 B

1
assets/icons/wand.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wand"><path d="M15 4V2"/><path d="M15 16v-2"/><path d="M8 9h2"/><path d="M20 9h2"/><path d="M17.8 11.8 19 13"/><path d="M15 9h.01"/><path d="M17.8 6.2 19 5"/><path d="m3 21 9-9"/><path d="M12.2 6.2 11 5"/></svg>

After

Width:  |  Height:  |  Size: 414 B

3
assets/icons/x.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 4.5L12 11.5M12 4.5L5 11.5" stroke="black" stroke-width="2" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 199 B

View File

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 8.9V11C5.93097 11 5.06903 11 3 11V10.4L8 5.6V5H3V7.1" stroke="black" stroke-width="1.5"/>
<path d="M11 5L13 8L11 11" stroke="black" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 268 B

View File

@@ -56,7 +56,8 @@
"shift-tab": "editor::TabPrev",
"ctrl-k": "editor::CutToEndOfLine",
// "ctrl-t": "editor::Transpose",
"alt-q": "editor::Rewrap",
"ctrl-k ctrl-q": "editor::Rewrap",
"ctrl-k q": "editor::Rewrap",
"ctrl-backspace": "editor::DeleteToPreviousWordStart",
"ctrl-delete": "editor::DeleteToNextWordEnd",
"shift-delete": "editor::Cut",
@@ -107,7 +108,9 @@
"ctrl-'": "editor::ToggleHunkDiff",
"ctrl-\"": "editor::ExpandAllHunkDiffs",
"ctrl-i": "editor::ShowSignatureHelp",
"alt-g b": "editor::ToggleGitBlame"
"alt-g b": "editor::ToggleGitBlame",
"menu": "editor::OpenContextMenu",
"shift-f10": "editor::OpenContextMenu"
}
},
{
@@ -126,7 +129,8 @@
"shift-enter": "editor::Newline",
"ctrl-enter": "editor::NewlineAbove",
"ctrl-shift-enter": "editor::NewlineBelow",
"alt-z": "editor::ToggleSoftWrap",
"ctrl-k ctrl-z": "editor::ToggleSoftWrap",
"ctrl-k z": "editor::ToggleSoftWrap",
"ctrl-f": "buffer_search::Deploy",
"ctrl-h": ["buffer_search::Deploy", { "replace_enabled": true }],
// "cmd-e": ["buffer_search::Deploy", { "focus": false }],
@@ -140,7 +144,7 @@
"bindings": {
"alt-]": "editor::NextInlineCompletion",
"alt-[": "editor::PreviousInlineCompletion",
"ctrl-right": "editor::AcceptPartialInlineCompletion"
"alt-right": "editor::AcceptPartialInlineCompletion"
}
},
{
@@ -169,7 +173,7 @@
"ctrl-k c": "assistant::CopyCode",
"ctrl-g": "search::SelectNextMatch",
"ctrl-shift-g": "search::SelectPrevMatch",
"alt-m": "assistant::ToggleModelSelector",
"ctrl-shift-m": "assistant::ToggleModelSelector",
"ctrl-k h": "assistant::DeployHistory",
"ctrl-k l": "assistant::DeployPromptLibrary",
"ctrl-n": "assistant::NewContext"
@@ -249,12 +253,14 @@
"ctrl-pagedown": "pane::ActivateNextItem",
"ctrl-shift-pageup": "pane::SwapItemLeft",
"ctrl-shift-pagedown": "pane::SwapItemRight",
"back": "pane::GoBack",
"forward": "pane::GoForward",
"ctrl-w": "pane::CloseActiveItem",
"ctrl-f4": "pane::CloseActiveItem",
"alt-ctrl-t": "pane::CloseInactiveItems",
"alt-ctrl-t": ["pane::CloseInactiveItems", { "close_pinned": false }],
"alt-ctrl-shift-w": "workspace::CloseInactiveTabsAndPanes",
"ctrl-k u": "pane::CloseCleanItems",
"ctrl-k w": "pane::CloseAllItems",
"ctrl-k u": ["pane::CloseCleanItems", { "close_pinned": false }],
"ctrl-k w": ["pane::CloseAllItems", { "close_pinned": false }],
"ctrl-shift-f": "project_search::ToggleFocus",
"ctrl-alt-g": "search::SelectNextMatch",
"ctrl-alt-shift-g": "search::SelectPrevMatch",
@@ -313,11 +319,19 @@
"ctrl-k ctrl-l": "editor::ToggleFold",
"ctrl-k ctrl-[": "editor::FoldRecursive",
"ctrl-k ctrl-]": "editor::UnfoldRecursive",
"ctrl-k ctrl-1": ["editor::FoldAtLevel", { "level": 1 }],
"ctrl-k ctrl-2": ["editor::FoldAtLevel", { "level": 2 }],
"ctrl-k ctrl-3": ["editor::FoldAtLevel", { "level": 3 }],
"ctrl-k ctrl-4": ["editor::FoldAtLevel", { "level": 4 }],
"ctrl-k ctrl-5": ["editor::FoldAtLevel", { "level": 5 }],
"ctrl-k ctrl-6": ["editor::FoldAtLevel", { "level": 6 }],
"ctrl-k ctrl-7": ["editor::FoldAtLevel", { "level": 7 }],
"ctrl-k ctrl-8": ["editor::FoldAtLevel", { "level": 8 }],
"ctrl-k ctrl-9": ["editor::FoldAtLevel", { "level": 9 }],
"ctrl-k ctrl-0": "editor::FoldAll",
"ctrl-k ctrl-j": "editor::UnfoldAll",
"ctrl-space": "editor::ShowCompletions",
"ctrl-.": "editor::ToggleCodeActions",
"alt-ctrl-r": "editor::RevealInFileManager",
"ctrl-k r": "editor::RevealInFileManager",
"ctrl-k p": "editor::CopyPath",
"ctrl-\\": "pane::SplitRight",
@@ -393,7 +407,7 @@
"ctrl-shift-p": "command_palette::Toggle",
"f1": "command_palette::Toggle",
"ctrl-shift-m": "diagnostics::Deploy",
"ctrl-shift-e": "project_panel::ToggleFocus",
"ctrl-shift-e": "pane::RevealInProjectPanel",
"ctrl-shift-b": "outline_panel::ToggleFocus",
"ctrl-?": "assistant::ToggleFocus",
"ctrl-alt-s": "workspace::SaveAll",
@@ -408,6 +422,8 @@
"ctrl-k shift-up": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-k shift-down": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-shift-x": "zed::Extensions",
"ctrl-shift-r": "task::Rerun",
"ctrl-alt-r": "task::Rerun",
"alt-t": "task::Rerun",
"alt-shift-t": "task::Spawn"
}
@@ -452,13 +468,21 @@
},
{
"context": "Editor && showing_completions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCompletion"
}
},
{
"context": "Editor && !inline_completion && showing_completions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCompletion",
"tab": "editor::ComposeCompletion"
}
},
{
"context": "Editor && inline_completion && !showing_completions",
"context": "Editor && inline_completion",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::AcceptInlineCompletion"
}
@@ -505,6 +529,13 @@
"ctrl-enter": "assistant::InlineAssist"
}
},
{
"context": "ProposedChangesEditor",
"bindings": {
"ctrl-shift-y": "editor::ApplyDiffHunk",
"ctrl-alt-a": "editor::ApplyAllDiffHunks"
}
},
{
"context": "Editor && jupyter && !ContextEditor",
"bindings": {
@@ -516,6 +547,7 @@
"context": "ContextEditor > Editor",
"bindings": {
"ctrl-enter": "assistant::Assist",
"ctrl-shift-enter": "assistant::Edit",
"ctrl-s": "workspace::Save",
"ctrl->": "assistant::QuoteSelection",
"ctrl-<": "assistant::InsertIntoEditor",
@@ -547,9 +579,11 @@
"ctrl-alt-c": "outline_panel::CopyPath",
"alt-ctrl-shift-c": "outline_panel::CopyRelativePath",
"alt-ctrl-r": "outline_panel::RevealInFileManager",
"space": ["outline_panel::Open", { "change_selection": false }],
"space": "outline_panel::Open",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev"
"shift-up": "menu::SelectPrev",
"alt-enter": "editor::OpenExcerpts",
"ctrl-k enter": "editor::OpenExcerptsSplit"
}
},
{
@@ -570,7 +604,8 @@
"ctrl-delete": ["project_panel::Delete", { "skip_prompt": false }],
"alt-ctrl-r": "project_panel::RevealInFileManager",
"ctrl-shift-enter": "project_panel::OpenWithSystem",
"alt-shift-f": "project_panel::NewSearchInDirectory",
"ctrl-shift-e": "project_panel::ToggleFocus",
"ctrl-shift-f": "project_panel::NewSearchInDirectory",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev",
"escape": "menu::Cancel"
@@ -627,7 +662,28 @@
},
{
"context": "FileFinder",
"bindings": { "ctrl-shift-p": "file_finder::SelectPrev" }
"bindings": {
"ctrl": "file_finder::ToggleMenu"
}
},
{
"context": "FileFinder && !menu_open",
"bindings": {
"ctrl-shift-p": "file_finder::SelectPrev",
"ctrl-j": "pane::SplitDown",
"ctrl-k": "pane::SplitUp",
"ctrl-h": "pane::SplitLeft",
"ctrl-l": "pane::SplitRight"
}
},
{
"context": "FileFinder && menu_open",
"bindings": {
"j": "pane::SplitDown",
"k": "pane::SplitUp",
"h": "pane::SplitLeft",
"l": "pane::SplitRight"
}
},
{
"context": "TabSwitcher",

View File

@@ -1,6 +1,7 @@
[
// Standard macOS bindings
{
"use_key_equivalents": true,
"bindings": {
"up": "menu::SelectPrev",
"shift-tab": "menu::SelectPrev",
@@ -40,6 +41,7 @@
},
{
"context": "Editor",
"use_key_equivalents": true,
"bindings": {
"escape": "editor::Cancel",
"backspace": "editor::Backspace",
@@ -49,21 +51,22 @@
"ctrl-d": "editor::Delete",
"tab": "editor::Tab",
"shift-tab": "editor::TabPrev",
"ctrl-k": "editor::CutToEndOfLine",
"ctrl-t": "editor::Transpose",
"alt-q": "editor::Rewrap",
"ctrl-k": "editor::KillRingCut",
"ctrl-y": "editor::KillRingYank",
"cmd-k q": "editor::Rewrap",
"cmd-k cmd-q": "editor::Rewrap",
"cmd-backspace": "editor::DeleteToBeginningOfLine",
"cmd-delete": "editor::DeleteToEndOfLine",
"alt-backspace": "editor::DeleteToPreviousWordStart",
"ctrl-w": "editor::DeleteToPreviousWordStart",
"alt-delete": "editor::DeleteToNextWordEnd",
"alt-h": "editor::DeleteToPreviousWordStart",
"alt-d": "editor::DeleteToNextWordEnd",
"cmd-x": "editor::Cut",
"cmd-c": "editor::Copy",
"cmd-v": "editor::Paste",
"cmd-z": "editor::Undo",
"cmd-shift-z": "editor::Redo",
"ctrl-shift-z": "zeta::RateCompletions",
"up": "editor::MoveUp",
"ctrl-up": "editor::MoveToStartOfParagraph",
"pageup": "editor::MovePageUp",
@@ -86,9 +89,7 @@
"ctrl-f": "editor::MoveRight",
"ctrl-l": "editor::ScrollCursorCenter",
"alt-left": "editor::MoveToPreviousWordStart",
"alt-b": "editor::MoveToPreviousWordStart",
"alt-right": "editor::MoveToNextWordEnd",
"alt-f": "editor::MoveToNextWordEnd",
"cmd-left": "editor::MoveToBeginningOfLine",
"ctrl-a": "editor::MoveToBeginningOfLine",
"cmd-right": "editor::MoveToEndOfLine",
@@ -104,9 +105,7 @@
"shift-right": "editor::SelectRight",
"ctrl-shift-f": "editor::SelectRight",
"alt-shift-left": "editor::SelectToPreviousWordStart", // cursorWordLeftSelect
"alt-shift-b": "editor::SelectToPreviousWordStart",
"alt-shift-right": "editor::SelectToNextWordEnd", // cursorWordRightSelect
"alt-shift-f": "editor::SelectToNextWordEnd",
"ctrl-shift-up": "editor::SelectToStartOfParagraph",
"ctrl-shift-down": "editor::SelectToEndOfParagraph",
"cmd-shift-up": "editor::SelectToBeginning",
@@ -121,7 +120,7 @@
"shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
"ctrl-shift-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
"ctrl-v": ["editor::MovePageDown", { "center_cursor": true }],
"alt-v": ["editor::MovePageUp", { "center_cursor": true }],
"ctrl-shift-v": ["editor::MovePageUp", { "center_cursor": true }],
"ctrl-cmd-space": "editor::ShowCharacterPalette",
"cmd-;": "editor::ToggleLineNumbers",
"cmd-alt-z": "editor::RevertSelectedHunks",
@@ -135,12 +134,13 @@
},
{
"context": "Editor && mode == full",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::Newline",
"shift-enter": "editor::Newline",
"cmd-enter": "editor::NewlineBelow",
"cmd-shift-enter": "editor::NewlineAbove",
"alt-z": "editor::ToggleSoftWrap",
"cmd-k z": "editor::ToggleSoftWrap",
"cmd-f": "buffer_search::Deploy",
"cmd-alt-f": ["buffer_search::Deploy", { "replace_enabled": true }],
"cmd-alt-l": ["buffer_search::Deploy", { "selection_search_enabled": true }],
@@ -152,20 +152,23 @@
},
{
"context": "Editor && mode == full && inline_completion",
"use_key_equivalents": true,
"bindings": {
"alt-]": "editor::NextInlineCompletion",
"alt-[": "editor::PreviousInlineCompletion",
"cmd-right": "editor::AcceptPartialInlineCompletion"
"alt-tab": "editor::NextInlineCompletion",
"alt-shift-tab": "editor::PreviousInlineCompletion",
"ctrl-right": "editor::AcceptPartialInlineCompletion"
}
},
{
"context": "Editor && !inline_completion",
"use_key_equivalents": true,
"bindings": {
"alt-\\": "editor::ShowInlineCompletion"
"alt-tab": "editor::ShowInlineCompletion"
}
},
{
"context": "Editor && mode == auto_height",
"use_key_equivalents": true,
"bindings": {
"ctrl-enter": "editor::Newline",
"shift-enter": "editor::Newline",
@@ -174,12 +177,14 @@
},
{
"context": "Markdown",
"use_key_equivalents": true,
"bindings": {
"cmd-c": "markdown::Copy"
}
},
{
"context": "Editor && jupyter && !ContextEditor",
"use_key_equivalents": true,
"bindings": {
"ctrl-shift-enter": "repl::Run",
"ctrl-alt-enter": "repl::RunInPlace"
@@ -187,11 +192,12 @@
},
{
"context": "AssistantPanel",
"use_key_equivalents": true,
"bindings": {
"cmd-k c": "assistant::CopyCode",
"cmd-g": "search::SelectNextMatch",
"cmd-shift-g": "search::SelectPrevMatch",
"alt-m": "assistant::ToggleModelSelector",
"cmd-shift-m": "assistant::ToggleModelSelector",
"cmd-k h": "assistant::DeployHistory",
"cmd-k l": "assistant::DeployPromptLibrary",
"cmd-n": "assistant::NewContext"
@@ -199,8 +205,10 @@
},
{
"context": "ContextEditor > Editor",
"use_key_equivalents": true,
"bindings": {
"cmd-enter": "assistant::Assist",
"cmd-shift-enter": "assistant::Edit",
"cmd-s": "workspace::Save",
"cmd->": "assistant::QuoteSelection",
"cmd-<": "assistant::InsertIntoEditor",
@@ -210,8 +218,24 @@
"alt-enter": "editor::Newline"
}
},
{
"context": "AssistantPanel2",
"use_key_equivalents": true,
"bindings": {
"cmd-n": "assistant2::NewThread",
"cmd-shift-h": "assistant2::OpenHistory"
}
},
{
"context": "MessageEditor > Editor",
"use_key_equivalents": true,
"bindings": {
"enter": "assistant2::Chat"
}
},
{
"context": "PromptLibrary",
"use_key_equivalents": true,
"bindings": {
"cmd-n": "prompt_library::NewPrompt",
"cmd-shift-s": "prompt_library::ToggleDefaultPrompt",
@@ -220,6 +244,7 @@
},
{
"context": "BufferSearchBar",
"use_key_equivalents": true,
"bindings": {
"escape": "buffer_search::Dismiss",
"tab": "buffer_search::FocusEditor",
@@ -233,6 +258,7 @@
},
{
"context": "BufferSearchBar && in_replace > Editor",
"use_key_equivalents": true,
"bindings": {
"enter": "search::ReplaceNext",
"cmd-enter": "search::ReplaceAll"
@@ -240,6 +266,7 @@
},
{
"context": "BufferSearchBar && !in_replace > Editor",
"use_key_equivalents": true,
"bindings": {
"up": "search::PreviousHistoryQuery",
"down": "search::NextHistoryQuery"
@@ -247,6 +274,7 @@
},
{
"context": "ProjectSearchBar",
"use_key_equivalents": true,
"bindings": {
"escape": "project_search::ToggleFocus",
"cmd-shift-j": "project_search::ToggleFilters",
@@ -258,6 +286,7 @@
},
{
"context": "ProjectSearchBar > Editor",
"use_key_equivalents": true,
"bindings": {
"up": "search::PreviousHistoryQuery",
"down": "search::NextHistoryQuery"
@@ -265,6 +294,7 @@
},
{
"context": "ProjectSearchBar && in_replace > Editor",
"use_key_equivalents": true,
"bindings": {
"enter": "search::ReplaceNext",
"cmd-enter": "search::ReplaceAll"
@@ -272,6 +302,7 @@
},
{
"context": "ProjectSearchView",
"use_key_equivalents": true,
"bindings": {
"escape": "project_search::ToggleFocus",
"cmd-shift-j": "project_search::ToggleFilters",
@@ -282,6 +313,7 @@
},
{
"context": "Pane",
"use_key_equivalents": true,
"bindings": {
"cmd-{": "pane::ActivatePrevItem",
"cmd-}": "pane::ActivateNextItem",
@@ -290,10 +322,10 @@
"ctrl-shift-pageup": "pane::SwapItemLeft",
"ctrl-shift-pagedown": "pane::SwapItemRight",
"cmd-w": "pane::CloseActiveItem",
"alt-cmd-t": "pane::CloseInactiveItems",
"alt-cmd-t": ["pane::CloseInactiveItems", { "close_pinned": false }],
"ctrl-alt-cmd-w": "workspace::CloseInactiveTabsAndPanes",
"cmd-k u": "pane::CloseCleanItems",
"cmd-k cmd-w": "pane::CloseAllItems",
"cmd-k u": ["pane::CloseCleanItems", { "close_pinned": false }],
"cmd-k cmd-w": ["pane::CloseAllItems", { "close_pinned": false }],
"cmd-f": "project_search::ToggleFocus",
"cmd-g": "search::SelectNextMatch",
"cmd-shift-g": "search::SelectPrevMatch",
@@ -310,6 +342,7 @@
// Bindings from VS Code
{
"context": "Editor",
"use_key_equivalents": true,
"bindings": {
"cmd-[": "editor::Outdent",
"cmd-]": "editor::Indent",
@@ -344,17 +377,25 @@
"alt-cmd-f12": "editor::GoToTypeDefinitionSplit",
"alt-shift-f12": "editor::FindAllReferences",
"ctrl-m": "editor::MoveToEnclosingBracket",
"cmd-shift-\\": "editor::MoveToEnclosingBracket",
"cmd-|": "editor::MoveToEnclosingBracket",
"alt-cmd-[": "editor::Fold",
"alt-cmd-]": "editor::UnfoldLines",
"cmd-k cmd-l": "editor::ToggleFold",
"cmd-k cmd-[": "editor::FoldRecursive",
"cmd-k cmd-]": "editor::UnfoldRecursive",
"cmd-k cmd-1": ["editor::FoldAtLevel", { "level": 1 }],
"cmd-k cmd-2": ["editor::FoldAtLevel", { "level": 2 }],
"cmd-k cmd-3": ["editor::FoldAtLevel", { "level": 3 }],
"cmd-k cmd-4": ["editor::FoldAtLevel", { "level": 4 }],
"cmd-k cmd-5": ["editor::FoldAtLevel", { "level": 5 }],
"cmd-k cmd-6": ["editor::FoldAtLevel", { "level": 6 }],
"cmd-k cmd-7": ["editor::FoldAtLevel", { "level": 7 }],
"cmd-k cmd-8": ["editor::FoldAtLevel", { "level": 8 }],
"cmd-k cmd-9": ["editor::FoldAtLevel", { "level": 9 }],
"cmd-k cmd-0": "editor::FoldAll",
"cmd-k cmd-j": "editor::UnfoldAll",
"ctrl-space": "editor::ShowCompletions",
"cmd-.": "editor::ToggleCodeActions",
"alt-cmd-r": "editor::RevealInFileManager",
"cmd-k r": "editor::RevealInFileManager",
"cmd-k p": "editor::CopyPath",
"cmd-\\": "pane::SplitRight",
@@ -365,6 +406,7 @@
},
{
"context": "Editor && mode == full",
"use_key_equivalents": true,
"bindings": {
"cmd-shift-o": "outline::Toggle",
"ctrl-g": "go_to_line::Toggle"
@@ -372,6 +414,7 @@
},
{
"context": "Pane",
"use_key_equivalents": true,
"bindings": {
"ctrl-1": ["pane::ActivateItem", 0],
"ctrl-2": ["pane::ActivateItem", 1],
@@ -391,6 +434,7 @@
},
{
"context": "Workspace",
"use_key_equivalents": true,
"bindings": {
// Change the default action on `menu::Confirm` by setting the parameter
// "alt-cmd-o": ["projects::OpenRecent", {"create_new_window": true }],
@@ -427,7 +471,7 @@
"ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }],
"cmd-shift-p": "command_palette::Toggle",
"cmd-shift-m": "diagnostics::Deploy",
"cmd-shift-e": "project_panel::ToggleFocus",
"cmd-shift-e": "pane::RevealInProjectPanel",
"cmd-shift-b": "outline_panel::ToggleFocus",
"cmd-?": "assistant::ToggleFocus",
"cmd-alt-s": "workspace::SaveAll",
@@ -446,14 +490,18 @@
},
{
"context": "Workspace && !Terminal",
"use_key_equivalents": true,
"bindings": {
"alt-t": "task::Rerun",
"cmd-shift-r": "task::Spawn",
"cmd-alt-r": "task::Rerun",
"alt-t": "task::Spawn",
"alt-shift-t": "task::Spawn"
}
},
// Bindings from Sublime Text
{
"context": "Editor",
"use_key_equivalents": true,
"bindings": {
"ctrl-j": "editor::JoinLines",
"ctrl-alt-backspace": "editor::DeleteToPreviousSubwordStart",
@@ -473,6 +521,7 @@
// Bindings from Atom
{
"context": "Pane",
"use_key_equivalents": true,
"bindings": {
"cmd-k up": "pane::SplitUp",
"cmd-k down": "pane::SplitDown",
@@ -483,31 +532,42 @@
// Bindings that should be unified with bindings for more general actions
{
"context": "Editor && renaming",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmRename"
}
},
{
"context": "Editor && showing_completions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCompletion"
}
},
{
"context": "Editor && !inline_completion && showing_completions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCompletion",
"tab": "editor::ComposeCompletion"
}
},
{
"context": "Editor && inline_completion && !showing_completions",
"context": "Editor && inline_completion",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::AcceptInlineCompletion"
}
},
{
"context": "Editor && showing_code_actions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCodeAction"
}
},
{
"context": "Editor && (showing_code_actions || showing_completions)",
"use_key_equivalents": true,
"bindings": {
"up": "editor::ContextMenuPrev",
"ctrl-p": "editor::ContextMenuPrev",
@@ -519,6 +579,7 @@
},
// Custom bindings
{
"use_key_equivalents": true,
"bindings": {
"ctrl-alt-cmd-f": "workspace::FollowNextCollaborator",
// TODO: Move this to a dock open action
@@ -529,6 +590,7 @@
},
{
"context": "Editor && mode == full",
"use_key_equivalents": true,
"bindings": {
"alt-enter": "editor::OpenExcerpts",
"shift-enter": "editor::ExpandExcerpts",
@@ -538,8 +600,17 @@
"ctrl-enter": "assistant::InlineAssist"
}
},
{
"context": "ProposedChangesEditor",
"use_key_equivalents": true,
"bindings": {
"cmd-shift-y": "editor::ApplyDiffHunk",
"cmd-shift-a": "editor::ApplyAllDiffHunks"
}
},
{
"context": "PromptEditor",
"use_key_equivalents": true,
"bindings": {
"ctrl-[": "assistant::CyclePreviousInlineAssist",
"ctrl-]": "assistant::CycleNextInlineAssist"
@@ -547,12 +618,14 @@
},
{
"context": "ProjectSearchBar && !in_replace",
"use_key_equivalents": true,
"bindings": {
"cmd-enter": "project_search::SearchInNew"
}
},
{
"context": "OutlinePanel && not_editing",
"use_key_equivalents": true,
"bindings": {
"escape": "menu::Cancel",
"left": "outline_panel::CollapseSelectedEntry",
@@ -560,13 +633,16 @@
"cmd-alt-c": "outline_panel::CopyPath",
"alt-cmd-shift-c": "outline_panel::CopyRelativePath",
"alt-cmd-r": "outline_panel::RevealInFileManager",
"space": ["outline_panel::Open", { "change_selection": false }],
"space": "outline_panel::Open",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev"
"shift-up": "menu::SelectPrev",
"alt-enter": "editor::OpenExcerpts",
"cmd-k enter": "editor::OpenExcerptsSplit"
}
},
{
"context": "ProjectPanel",
"use_key_equivalents": true,
"bindings": {
"left": "project_panel::CollapseSelectedEntry",
"right": "project_panel::ExpandSelectedEntry",
@@ -586,8 +662,9 @@
"cmd-delete": ["project_panel::Delete", { "skip_prompt": false }],
"alt-cmd-r": "project_panel::RevealInFileManager",
"ctrl-shift-enter": "project_panel::OpenWithSystem",
"cmd-shift-e": "project_panel::ToggleFocus",
"cmd-alt-backspace": ["project_panel::Delete", { "skip_prompt": false }],
"alt-shift-f": "project_panel::NewSearchInDirectory",
"cmd-shift-f": "project_panel::NewSearchInDirectory",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev",
"escape": "menu::Cancel"
@@ -595,12 +672,14 @@
},
{
"context": "ProjectPanel && not_editing",
"use_key_equivalents": true,
"bindings": {
"space": "project_panel::Open"
}
},
{
"context": "CollabPanel && not_editing",
"use_key_equivalents": true,
"bindings": {
"ctrl-backspace": "collab_panel::Remove",
"space": "menu::Confirm"
@@ -608,18 +687,21 @@
},
{
"context": "(CollabPanel && editing) > Editor",
"use_key_equivalents": true,
"bindings": {
"space": "collab_panel::InsertSpace"
}
},
{
"context": "ChannelModal",
"use_key_equivalents": true,
"bindings": {
"tab": "channel_modal::ToggleMode"
}
},
{
"context": "Picker > Editor",
"use_key_equivalents": true,
"bindings": {
"tab": "picker::ConfirmCompletion",
"alt-enter": ["picker::ConfirmInput", { "secondary": false }],
@@ -628,16 +710,42 @@
},
{
"context": "ChannelModal > Picker > Editor",
"use_key_equivalents": true,
"bindings": {
"tab": "channel_modal::ToggleMode"
}
},
{
"context": "FileFinder",
"bindings": { "cmd-shift-p": "file_finder::SelectPrev" }
"use_key_equivalents": true,
"bindings": {
"cmd": "file_finder::ToggleMenu"
}
},
{
"context": "FileFinder && !menu_open",
"use_key_equivalents": true,
"bindings": {
"cmd-shift-p": "file_finder::SelectPrev",
"cmd-j": "pane::SplitDown",
"cmd-k": "pane::SplitUp",
"cmd-h": "pane::SplitLeft",
"cmd-l": "pane::SplitRight"
}
},
{
"context": "FileFinder && menu_open",
"use_key_equivalents": true,
"bindings": {
"j": "pane::SplitDown",
"k": "pane::SplitUp",
"h": "pane::SplitLeft",
"l": "pane::SplitRight"
}
},
{
"context": "TabSwitcher",
"use_key_equivalents": true,
"bindings": {
"ctrl-up": "menu::SelectPrev",
"ctrl-down": "menu::SelectNext",
@@ -647,6 +755,7 @@
},
{
"context": "Terminal",
"use_key_equivalents": true,
"bindings": {
"ctrl-cmd-space": "terminal::ShowCharacterPalette",
"cmd-c": "terminal::Copy",
@@ -680,7 +789,30 @@
"cmd-end": "terminal::ScrollToBottom",
"shift-home": "terminal::ScrollToTop",
"shift-end": "terminal::ScrollToBottom",
"ctrl-shift-space": "terminal::ToggleViMode"
"ctrl-shift-space": "terminal::ToggleViMode",
"ctrl-k up": "pane::SplitUp",
"ctrl-k down": "pane::SplitDown",
"ctrl-k left": "pane::SplitLeft",
"ctrl-k right": "pane::SplitRight"
}
},
{
"context": "RateCompletionModal",
"use_key_equivalents": true,
"bindings": {
"cmd-enter": "zeta::ThumbsUp",
"shift-down": "zeta::NextEdit",
"shift-up": "zeta::PreviousEdit",
"right": "zeta::PreviewCompletion"
}
},
{
"context": "RateCompletionModal > Editor",
"use_key_equivalents": true,
"bindings": {
"escape": "zeta::FocusCompletions",
"cmd-shift-enter": "zeta::ThumbsUpActiveCompletion",
"cmd-shift-backspace": "zeta::ThumbsDownActiveCompletion"
}
}
]

73
assets/keymaps/linux/emacs.json Executable file
View File

@@ -0,0 +1,73 @@
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"context": "Editor",
"bindings": {
"ctrl-g": "editor::Cancel",
"ctrl-shift-g": "go_to_line::Toggle",
//"ctrl-space": "editor::SetMark",
"ctrl-x u": "editor::Undo",
"ctrl-x ctrl-u": "editor::Redo",
"ctrl-f": "editor::MoveRight",
"ctrl-b": "editor::MoveLeft",
"ctrl-n": "editor::MoveDown",
"ctrl-p": "editor::MoveUp",
"home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
"end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
"ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
"ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
"alt-f": "editor::MoveToNextSubwordEnd",
"alt-b": "editor::MoveToPreviousSubwordStart",
"ctrl-d": "editor::Delete",
"alt-d": "editor::DeleteToNextWordEnd",
"ctrl-k": "editor::CutToEndOfLine",
"ctrl-w": "editor::Cut",
"alt-w": "editor::Copy",
"ctrl-y": "editor::Paste",
"ctrl-_": "editor::Undo",
"ctrl-v": "editor::MovePageDown",
"alt-v": "editor::MovePageUp",
"ctrl-x ]": "editor::MoveToEnd",
"ctrl-x [": "editor::MoveToBeginning",
"ctrl-l": "editor::ScrollCursorCenterTopBottom",
"ctrl-s": "buffer_search::Deploy",
"ctrl-x ctrl-f": "file_finder::Toggle",
"ctrl-shift-r": "editor::Rename"
}
},
{
"context": "Workspace",
"bindings": {
"ctrl-x k": "pane::CloseActiveItem",
"ctrl-x ctrl-c": "workspace::CloseWindow",
"ctrl-x o": "workspace::ActivateNextPane",
"ctrl-x b": "tab_switcher::Toggle",
"ctrl-x 0": "pane::CloseActiveItem",
"ctrl-x 1": "pane::CloseInactiveItems",
"ctrl-x 2": "pane::SplitVertical",
"ctrl-x ctrl-f": "file_finder::Toggle",
"ctrl-x ctrl-s": "workspace::Save",
"ctrl-x ctrl-w": "workspace::SaveAs",
"ctrl-x s": "workspace::SaveAll",
"shift shift": "file_finder::Toggle"
}
},
{
"context": "BufferSearchBar > Editor",
"bindings": {
"ctrl-s": "search::SelectNextMatch",
"ctrl-r": "search::SelectPrevMatch",
"ctrl-g": "buffer_search::Dismiss"
}
},
{
"context": "Pane",
"bindings": {
"ctrl-alt-left": "pane::GoBack",
"ctrl-alt-right": "pane::GoForward"
}
}
]

View File

@@ -1,6 +1,7 @@
[
{
"bindings": {
"ctrl-alt-s": "zed::OpenSettings",
"ctrl-shift-[": "pane::ActivatePrevItem",
"ctrl-shift-]": "pane::ActivateNextItem"
}
@@ -11,7 +12,7 @@
"ctrl->": "zed::IncreaseBufferFontSize",
"ctrl-<": "zed::DecreaseBufferFontSize",
"ctrl-shift-j": "editor::JoinLines",
"ctrl-d": "editor::DuplicateLineDown",
"ctrl-d": "editor::DuplicateSelection",
"ctrl-y": "editor::DeleteLine",
"ctrl-m": "editor::ScrollCursorCenter",
"ctrl-pagedown": "editor::MovePageDown",
@@ -25,8 +26,8 @@
"alt-j": ["editor::SelectNext", { "replace_newest": false }],
"alt-shift-j": ["editor::SelectPrevious", { "replace_newest": false }],
"ctrl-/": ["editor::ToggleComments", { "advance_downwards": true }],
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"ctrl-w": "editor::SelectLargerSyntaxNode",
"ctrl-shift-w": "editor::SelectSmallerSyntaxNode",
"shift-alt-up": "editor::MoveLineUp",
"shift-alt-down": "editor::MoveLineDown",
"ctrl-alt-l": "editor::Format",
@@ -43,6 +44,7 @@
"shift-f2": "editor::GoToPrevDiagnostic",
"ctrl-alt-shift-down": "editor::GoToHunk",
"ctrl-alt-shift-up": "editor::GoToPrevHunk",
"ctrl-alt-z": "editor::RevertSelectedHunks",
"ctrl-home": "editor::MoveToBeginning",
"ctrl-end": "editor::MoveToEnd",
"ctrl-shift-home": "editor::SelectToBeginning",

View File

@@ -4,9 +4,7 @@
"ctrl-shift-[": "pane::ActivatePrevItem",
"ctrl-shift-]": "pane::ActivateNextItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"ctrl-pagedown": "pane::ActivateNextItem",
"ctrl-tab": "pane::ActivateNextItem",
"ctrl-shift-tab": "pane::ActivatePrevItem"
"ctrl-pagedown": "pane::ActivateNextItem"
}
},
{
@@ -17,7 +15,8 @@
"ctrl-shift-m": "editor::SelectLargerSyntaxNode",
"ctrl-shift-l": "editor::SplitSelectionIntoLines",
"ctrl-shift-a": "editor::SelectLargerSyntaxNode",
"ctrl-shift-d": "editor::DuplicateLineDown",
"ctrl-shift-d": "editor::DuplicateSelection",
"alt-f3": "editor::SelectAllMatches", // find_all_under
"f12": "editor::GoToDefinition",
"ctrl-f12": "editor::GoToDefinitionSplit",
"shift-f12": "editor::FindAllReferences",

73
assets/keymaps/macos/emacs.json Executable file
View File

@@ -0,0 +1,73 @@
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"context": "Editor",
"bindings": {
"ctrl-g": "editor::Cancel",
"ctrl-shift-g": "go_to_line::Toggle",
//"ctrl-space": "editor::SetMark",
"ctrl-x u": "editor::Undo",
"ctrl-x ctrl-u": "editor::Redo",
"ctrl-f": "editor::MoveRight",
"ctrl-b": "editor::MoveLeft",
"ctrl-n": "editor::MoveDown",
"ctrl-p": "editor::MoveUp",
"home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
"end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
"ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
"ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
"alt-f": "editor::MoveToNextSubwordEnd",
"alt-b": "editor::MoveToPreviousSubwordStart",
"ctrl-d": "editor::Delete",
"alt-d": "editor::DeleteToNextWordEnd",
"ctrl-k": "editor::CutToEndOfLine",
"ctrl-w": "editor::Cut",
"alt-w": "editor::Copy",
"ctrl-y": "editor::Paste",
"ctrl-_": "editor::Undo",
"ctrl-v": "editor::MovePageDown",
"alt-v": "editor::MovePageUp",
"ctrl-x ]": "editor::MoveToEnd",
"ctrl-x [": "editor::MoveToBeginning",
"ctrl-l": "editor::ScrollCursorCenterTopBottom",
"ctrl-s": "buffer_search::Deploy",
"ctrl-x ctrl-f": "file_finder::Toggle",
"ctrl-shift-r": "editor::Rename"
}
},
{
"context": "Workspace",
"bindings": {
"ctrl-x k": "pane::CloseActiveItem",
"ctrl-x ctrl-c": "workspace::CloseWindow",
"ctrl-x o": "workspace::ActivateNextPane",
"ctrl-x b": "tab_switcher::Toggle",
"ctrl-x 0": "pane::CloseActiveItem",
"ctrl-x 1": "pane::CloseInactiveItems",
"ctrl-x 2": "pane::SplitVertical",
"ctrl-x ctrl-f": "file_finder::Toggle",
"ctrl-x ctrl-s": "workspace::Save",
"ctrl-x ctrl-w": "workspace::SaveAs",
"ctrl-x s": "workspace::SaveAll",
"shift shift": "file_finder::Toggle"
}
},
{
"context": "BufferSearchBar > Editor",
"bindings": {
"ctrl-s": "search::SelectNextMatch",
"ctrl-r": "search::SelectPrevMatch",
"ctrl-g": "buffer_search::Dismiss"
}
},
{
"context": "Pane",
"bindings": {
"ctrl-alt-left": "pane::GoBack",
"ctrl-alt-right": "pane::GoForward"
}
}
]

View File

@@ -11,7 +11,7 @@
"ctrl->": "zed::IncreaseBufferFontSize",
"ctrl-<": "zed::DecreaseBufferFontSize",
"ctrl-shift-j": "editor::JoinLines",
"cmd-d": "editor::DuplicateLineDown",
"cmd-d": "editor::DuplicateSelection",
"cmd-backspace": "editor::DeleteLine",
"cmd-pagedown": "editor::MovePageDown",
"cmd-pageup": "editor::MovePageUp",
@@ -24,8 +24,8 @@
"ctrl-g": ["editor::SelectNext", { "replace_newest": false }],
"ctrl-cmd-g": ["editor::SelectPrevious", { "replace_newest": false }],
"cmd-/": ["editor::ToggleComments", { "advance_downwards": true }],
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"cmd-up": "editor::SelectLargerSyntaxNode",
"cmd-down": "editor::SelectSmallerSyntaxNode",
"shift-alt-up": "editor::MoveLineUp",
"shift-alt-down": "editor::MoveLineDown",
"cmd-alt-l": "editor::Format",
@@ -58,6 +58,12 @@
"alt-enter": "editor::ToggleCodeActions"
}
},
{
"context": "BufferSearchBar > Editor",
"bindings": {
"shift-enter": "search::SelectPrevMatch"
}
},
{
"context": "Workspace",
"bindings": {

View File

@@ -4,9 +4,7 @@
"cmd-shift-[": "pane::ActivatePrevItem",
"cmd-shift-]": "pane::ActivateNextItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"ctrl-pagedown": "pane::ActivateNextItem",
"ctrl-tab": "pane::ActivateNextItem",
"ctrl-shift-tab": "pane::ActivatePrevItem"
"ctrl-pagedown": "pane::ActivateNextItem"
}
},
{
@@ -20,7 +18,8 @@
"ctrl-shift-m": "editor::SelectLargerSyntaxNode",
"cmd-shift-l": "editor::SplitSelectionIntoLines",
"cmd-shift-a": "editor::SelectLargerSyntaxNode",
"cmd-shift-d": "editor::DuplicateLineDown",
"cmd-shift-d": "editor::DuplicateSelection",
"ctrl-cmd-g": "editor::SelectAllMatches", // find_all_under
"shift-f12": "editor::FindAllReferences",
"alt-cmd-down": "editor::GoToDefinition",
"ctrl-alt-cmd-down": "editor::GoToDefinitionSplit",

View File

@@ -32,6 +32,18 @@
"(": "vim::SentenceBackward",
")": "vim::SentenceForward",
"|": "vim::GoToColumn",
"] ]": "vim::NextSectionStart",
"] [": "vim::NextSectionEnd",
"[ [": "vim::PreviousSectionStart",
"[ ]": "vim::PreviousSectionEnd",
"] m": "vim::NextMethodStart",
"] M": "vim::NextMethodEnd",
"[ m": "vim::PreviousMethodStart",
"[ M": "vim::PreviousMethodEnd",
"[ *": "vim::PreviousComment",
"[ /": "vim::PreviousComment",
"] *": "vim::NextComment",
"] /": "vim::NextComment",
// Word motions
"w": "vim::NextWordStart",
"e": "vim::NextWordEnd",
@@ -54,6 +66,10 @@
"n": "vim::MoveToNextMatch",
"shift-n": "vim::MoveToPrevMatch",
"%": "vim::Matching",
"] }": ["vim::UnmatchedForward", { "char": "}" }],
"[ {": ["vim::UnmatchedBackward", { "char": "{" }],
"] )": ["vim::UnmatchedForward", { "char": ")" }],
"[ (": ["vim::UnmatchedBackward", { "char": "(" }],
"f": ["vim::PushOperator", { "FindForward": { "before": false } }],
"t": ["vim::PushOperator", { "FindForward": { "before": true } }],
"shift-f": ["vim::PushOperator", { "FindBackward": { "after": false } }],
@@ -127,6 +143,9 @@
"shift-h": "vim::WindowTop",
"shift-m": "vim::WindowMiddle",
"shift-l": "vim::WindowBottom",
"q": "vim::ToggleRecord",
"shift-q": "vim::ReplayLastRecording",
"@": ["vim::PushOperator", "ReplayRegister"],
// z commands
"z enter": ["workspace::SendKeystrokes", "z t ^"],
"z -": ["workspace::SendKeystrokes", "z b ^"],
@@ -137,14 +156,14 @@
"z .": ["workspace::SendKeystrokes", "z z ^"],
"z b": "editor::ScrollCursorBottom",
"z a": "editor::ToggleFold",
"z A": "editor::ToggleFoldRecursive",
"z shift-a": "editor::ToggleFoldRecursive",
"z c": "editor::Fold",
"z C": "editor::FoldRecursive",
"z shift-c": "editor::FoldRecursive",
"z o": "editor::UnfoldLines",
"z O": "editor::UnfoldRecursive",
"z shift-o": "editor::UnfoldRecursive",
"z f": "editor::FoldSelectedRanges",
"z M": "editor::FoldAll",
"z R": "editor::UnfoldAll",
"z shift-m": "editor::FoldAll",
"z shift-r": "editor::UnfoldAll",
"shift-z shift-q": ["pane::CloseActiveItem", { "saveIntent": "skip" }],
"shift-z shift-z": ["pane::CloseActiveItem", { "saveIntent": "saveAll" }],
// Count support
@@ -157,51 +176,6 @@
"7": ["vim::Number", 7],
"8": ["vim::Number", 8],
"9": ["vim::Number", 9],
// window related commands (ctrl-w X)
"ctrl-w": null,
"ctrl-w left": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w right": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w up": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w down": ["workspace::ActivatePaneInDirection", "Down"],
"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"],
"ctrl-w shift-left": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-w shift-right": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-w shift-up": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-w shift-down": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-w shift-h": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-w shift-l": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-w shift-k": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-w shift-j": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-w g t": "pane::ActivateNextItem",
"ctrl-w ctrl-g t": "pane::ActivateNextItem",
"ctrl-w g shift-t": "pane::ActivatePrevItem",
"ctrl-w ctrl-g shift-t": "pane::ActivatePrevItem",
"ctrl-w w": "workspace::ActivateNextPane",
"ctrl-w ctrl-w": "workspace::ActivateNextPane",
"ctrl-w p": "workspace::ActivatePreviousPane",
"ctrl-w ctrl-p": "workspace::ActivatePreviousPane",
"ctrl-w shift-w": "workspace::ActivatePreviousPane",
"ctrl-w ctrl-shift-w": "workspace::ActivatePreviousPane",
"ctrl-w v": "pane::SplitVertical",
"ctrl-w ctrl-v": "pane::SplitVertical",
"ctrl-w s": "pane::SplitHorizontal",
"ctrl-w shift-s": "pane::SplitHorizontal",
"ctrl-w ctrl-s": "pane::SplitHorizontal",
"ctrl-w c": "pane::CloseAllItems",
"ctrl-w ctrl-c": "pane::CloseAllItems",
"ctrl-w q": "pane::CloseAllItems",
"ctrl-w ctrl-q": "pane::CloseAllItems",
"ctrl-w o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w ctrl-o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w n": "workspace::NewFileSplitHorizontal",
"ctrl-w ctrl-n": "workspace::NewFileSplitHorizontal",
"ctrl-w d": "editor::GoToDefinitionSplit",
"ctrl-w g d": "editor::GoToDefinitionSplit",
"ctrl-w shift-d": "editor::GoToTypeDefinitionSplit",
@@ -245,15 +219,13 @@
"shift-s": "vim::SubstituteLine",
">": ["vim::PushOperator", "Indent"],
"<": ["vim::PushOperator", "Outdent"],
"=": ["vim::PushOperator", "AutoIndent"],
"g u": ["vim::PushOperator", "Lowercase"],
"g shift-u": ["vim::PushOperator", "Uppercase"],
"g ~": ["vim::PushOperator", "OppositeCase"],
"\"": ["vim::PushOperator", "Register"],
"g q": ["vim::PushOperator", "Rewrap"],
"g w": ["vim::PushOperator", "Rewrap"],
"q": "vim::ToggleRecord",
"shift-q": "vim::ReplayLastRecording",
"@": ["vim::PushOperator", "ReplayRegister"],
"ctrl-pagedown": "pane::ActivateNextItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"insert": "vim::InsertBefore",
@@ -279,7 +251,7 @@
"bindings": {
":": "vim::VisualCommand",
"u": "vim::ConvertToLowerCase",
"U": "vim::ConvertToUpperCase",
"shift-u": "vim::ConvertToUpperCase",
"o": "vim::OtherEnd",
"shift-o": "vim::OtherEnd",
"d": "vim::VisualDelete",
@@ -303,8 +275,8 @@
"g ctrl-x": ["vim::Decrement", { "step": true }],
"shift-i": "vim::InsertBefore",
"shift-a": "vim::InsertAfter",
"g I": "vim::VisualInsertFirstNonWhiteSpace",
"g A": "vim::VisualInsertEndOfLine",
"g shift-i": "vim::VisualInsertFirstNonWhiteSpace",
"g shift-a": "vim::VisualInsertEndOfLine",
"shift-j": "vim::JoinLines",
"r": ["vim::PushOperator", "Replace"],
"ctrl-c": ["vim::SwitchMode", "Normal"],
@@ -312,6 +284,7 @@
"ctrl-[": ["vim::SwitchMode", "Normal"],
">": "vim::Indent",
"<": "vim::Outdent",
"=": "vim::AutoIndent",
"i": ["vim::PushOperator", { "Object": { "around": false } }],
"a": ["vim::PushOperator", { "Object": { "around": true } }],
"g c": "vim::ToggleComments",
@@ -339,10 +312,32 @@
"ctrl-t": "vim::Indent",
"ctrl-d": "vim::Outdent",
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }],
"ctrl-v": ["vim::PushOperator", { "Literal": {} }],
"ctrl-shift-v": "editor::Paste", // note: this is *very* similar to ctrl-v in vim, but ctrl-shift-v on linux is the typical shortcut for paste when ctrl-v is already in use.
"ctrl-q": ["vim::PushOperator", { "Literal": {} }],
"ctrl-shift-q": ["vim::PushOperator", { "Literal": {} }],
"ctrl-r": ["vim::PushOperator", "Register"],
"insert": "vim::ToggleReplace"
"insert": "vim::ToggleReplace",
"ctrl-o": "vim::TemporaryNormal"
}
},
{
"context": "vim_mode == helix_normal",
"bindings": {
"i": "vim::InsertBefore",
"a": "vim::InsertAfter",
"d": "vim::HelixDelete",
"w": "vim::NextWordStart",
"e": "vim::NextWordEnd",
"b": "vim::PreviousWordStart",
"h": "vim::Left",
"j": "vim::Down",
"k": "vim::Up",
"l": "vim::Right"
}
},
{
"context": "vim_mode == insert && !(showing_code_actions || showing_completions)",
"bindings": {
@@ -357,6 +352,10 @@
"ctrl-c": "vim::NormalBefore",
"ctrl-[": "vim::NormalBefore",
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }],
"ctrl-v": ["vim::PushOperator", { "Literal": {} }],
"ctrl-shift-v": "editor::Paste", // note: this is *very* similar to ctrl-v in vim, but ctrl-shift-v on linux is the typical shortcut for paste when ctrl-v is already in use.
"ctrl-q": ["vim::PushOperator", { "Literal": {} }],
"ctrl-shift-q": ["vim::PushOperator", { "Literal": {} }],
"backspace": "vim::UndoReplace",
"tab": "vim::Tab",
"enter": "vim::Enter",
@@ -371,7 +370,9 @@
"escape": "vim::ClearOperators",
"ctrl-c": "vim::ClearOperators",
"ctrl-[": "vim::ClearOperators",
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }]
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }],
"ctrl-v": ["vim::PushOperator", { "Literal": {} }],
"ctrl-q": ["vim::PushOperator", { "Literal": {} }]
}
},
{
@@ -379,7 +380,8 @@
"bindings": {
"escape": "vim::ClearOperators",
"ctrl-c": "vim::ClearOperators",
"ctrl-[": "vim::ClearOperators"
"ctrl-[": "vim::ClearOperators",
"g c": "vim::Comment"
}
},
{
@@ -399,12 +401,17 @@
"b": "vim::Parentheses",
"[": "vim::SquareBrackets",
"]": "vim::SquareBrackets",
"r": "vim::SquareBrackets",
"{": "vim::CurlyBrackets",
"}": "vim::CurlyBrackets",
"shift-b": "vim::CurlyBrackets",
"<": "vim::AngleBrackets",
">": "vim::AngleBrackets",
"a": "vim::Argument"
"a": "vim::Argument",
"i": "vim::IndentObj",
"shift-i": ["vim::IndentObj", { "includeBelow": true }],
"f": "vim::Method",
"c": "vim::Class"
}
},
{
@@ -479,12 +486,61 @@
"<": "vim::CurrentLine"
}
},
{
"context": "vim_operator == eq",
"bindings": {
"=": "vim::CurrentLine"
}
},
{
"context": "vim_operator == gc",
"bindings": {
"c": "vim::CurrentLine"
}
},
{
"context": "vim_mode == literal",
"bindings": {
"ctrl-@": ["vim::Literal", ["ctrl-@", "\u0000"]],
"ctrl-a": ["vim::Literal", ["ctrl-a", "\u0001"]],
"ctrl-b": ["vim::Literal", ["ctrl-b", "\u0002"]],
"ctrl-c": ["vim::Literal", ["ctrl-c", "\u0003"]],
"ctrl-d": ["vim::Literal", ["ctrl-d", "\u0004"]],
"ctrl-e": ["vim::Literal", ["ctrl-e", "\u0005"]],
"ctrl-f": ["vim::Literal", ["ctrl-f", "\u0006"]],
"ctrl-g": ["vim::Literal", ["ctrl-g", "\u0007"]],
"ctrl-h": ["vim::Literal", ["ctrl-h", "\u0008"]],
"ctrl-i": ["vim::Literal", ["ctrl-i", "\u0009"]],
"ctrl-j": ["vim::Literal", ["ctrl-j", "\u000A"]],
"ctrl-k": ["vim::Literal", ["ctrl-k", "\u000B"]],
"ctrl-l": ["vim::Literal", ["ctrl-l", "\u000C"]],
"ctrl-m": ["vim::Literal", ["ctrl-m", "\u000D"]],
"ctrl-n": ["vim::Literal", ["ctrl-n", "\u000E"]],
"ctrl-o": ["vim::Literal", ["ctrl-o", "\u000F"]],
"ctrl-p": ["vim::Literal", ["ctrl-p", "\u0010"]],
"ctrl-q": ["vim::Literal", ["ctrl-q", "\u0011"]],
"ctrl-r": ["vim::Literal", ["ctrl-r", "\u0012"]],
"ctrl-s": ["vim::Literal", ["ctrl-s", "\u0013"]],
"ctrl-t": ["vim::Literal", ["ctrl-t", "\u0014"]],
"ctrl-u": ["vim::Literal", ["ctrl-u", "\u0015"]],
"ctrl-v": ["vim::Literal", ["ctrl-v", "\u0016"]],
"ctrl-w": ["vim::Literal", ["ctrl-w", "\u0017"]],
"ctrl-x": ["vim::Literal", ["ctrl-x", "\u0018"]],
"ctrl-y": ["vim::Literal", ["ctrl-y", "\u0019"]],
"ctrl-z": ["vim::Literal", ["ctrl-z", "\u001A"]],
"ctrl-[": ["vim::Literal", ["ctrl-[", "\u001B"]],
"ctrl-\\": ["vim::Literal", ["ctrl-\\", "\u001C"]],
"ctrl-]": ["vim::Literal", ["ctrl-]", "\u001D"]],
"ctrl-^": ["vim::Literal", ["ctrl-^", "\u001E"]],
"ctrl-_": ["vim::Literal", ["ctrl-_", "\u001F"]],
"escape": ["vim::Literal", ["escape", "\u001B"]],
"enter": ["vim::Literal", ["enter", "\u000D"]],
"tab": ["vim::Literal", ["tab", "\u0009"]],
// zed extensions:
"backspace": ["vim::Literal", ["backspace", "\u0008"]],
"delete": ["vim::Literal", ["delete", "\u007F"]]
}
},
{
"context": "BufferSearchBar && !in_replace",
"bindings": {
@@ -493,7 +549,63 @@
}
},
{
"context": "EmptyPane || SharedScreen",
"context": "ProjectPanel || CollabPanel || OutlinePanel || ChatPanel || VimControl || EmptyPane || SharedScreen || MarkdownPreview || KeyContextView",
"bindings": {
// window related commands (ctrl-w X)
"ctrl-w": null,
"ctrl-w left": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w right": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w up": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w down": ["workspace::ActivatePaneInDirection", "Down"],
"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"],
"ctrl-w shift-left": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-w shift-right": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-w shift-up": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-w shift-down": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-w shift-h": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-w shift-l": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-w shift-k": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-w shift-j": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-w >": ["vim::ResizePane", "Widen"],
"ctrl-w <": ["vim::ResizePane", "Narrow"],
"ctrl-w -": ["vim::ResizePane", "Shorten"],
"ctrl-w +": ["vim::ResizePane", "Lengthen"],
"ctrl-w _": "vim::MaximizePane",
"ctrl-w =": "vim::ResetPaneSizes",
"ctrl-w g t": "pane::ActivateNextItem",
"ctrl-w ctrl-g t": "pane::ActivateNextItem",
"ctrl-w g shift-t": "pane::ActivatePrevItem",
"ctrl-w ctrl-g shift-t": "pane::ActivatePrevItem",
"ctrl-w w": "workspace::ActivateNextPane",
"ctrl-w ctrl-w": "workspace::ActivateNextPane",
"ctrl-w p": "workspace::ActivatePreviousPane",
"ctrl-w ctrl-p": "workspace::ActivatePreviousPane",
"ctrl-w shift-w": "workspace::ActivatePreviousPane",
"ctrl-w ctrl-shift-w": "workspace::ActivatePreviousPane",
"ctrl-w v": "pane::SplitVertical",
"ctrl-w ctrl-v": "pane::SplitVertical",
"ctrl-w s": "pane::SplitHorizontal",
"ctrl-w shift-s": "pane::SplitHorizontal",
"ctrl-w ctrl-s": "pane::SplitHorizontal",
"ctrl-w c": "pane::CloseAllItems",
"ctrl-w ctrl-c": "pane::CloseAllItems",
"ctrl-w q": "pane::CloseAllItems",
"ctrl-w ctrl-q": "pane::CloseAllItems",
"ctrl-w o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w ctrl-o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w n": "workspace::NewFileSplitHorizontal",
"ctrl-w ctrl-n": "workspace::NewFileSplitHorizontal"
}
},
{
"context": "EmptyPane || SharedScreen || MarkdownPreview || KeyContextView || Welcome",
"bindings": {
":": "command_palette::Toggle",
"g /": "pane::DeploySearch"
@@ -521,6 +633,12 @@
"p": "project_panel::Open",
"x": "project_panel::RevealInFileManager",
"s": "project_panel::OpenWithSystem",
"] c": "project_panel::SelectNextGitEntry",
"[ c": "project_panel::SelectPrevGitEntry",
"] d": "project_panel::SelectNextDiagnostic",
"[ d": "project_panel::SelectPrevDiagnostic",
"}": "project_panel::SelectNextDirectory",
"{": "project_panel::SelectPrevDirectory",
"shift-g": "menu::SelectLast",
"g g": "menu::SelectFirst",
"-": "project_panel::SelectParent",

View File

@@ -88,7 +88,6 @@ origin: (f64, f64),
<edit>
<path>src/shapes/rectangle.rs</path>
<description>Update the Rectangle's new function to take an origin parameter</description>
<operation>update</operation>
<old_text>
fn new(width: f64, height: f64) -> Self {
@@ -117,7 +116,6 @@ pub struct Circle {
<edit>
<path>src/shapes/circle.rs</path>
<description>Update the Circle's new function to take an origin parameter</description>
<operation>update</operation>
<old_text>
fn new(radius: f64) -> Self {
@@ -134,7 +132,6 @@ fn new(origin: (f64, f64), radius: f64) -> Self {
<edit>
<path>src/shapes/rectangle.rs</path>
<description>Add an import for the std::fmt module</description>
<operation>insert_before</operation>
<old_text>
struct Rectangle {
@@ -147,7 +144,10 @@ use std::fmt;
<edit>
<path>src/shapes/rectangle.rs</path>
<description>Add a Display implementation for Rectangle</description>
<description>
Add a manual Display implementation for Rectangle.
Currently, this is the same as a derived Display implementation.
</description>
<operation>insert_after</operation>
<old_text>
Rectangle { width, height }
@@ -169,7 +169,6 @@ impl fmt::Display for Rectangle {
<edit>
<path>src/shapes/circle.rs</path>
<description>Add an import for the `std::fmt` module</description>
<operation>insert_before</operation>
<old_text>
struct Circle {
@@ -181,7 +180,6 @@ use std::fmt;
<edit>
<path>src/shapes/circle.rs</path>
<description>Add a Display implementation for Circle</description>
<operation>insert_after</operation>
<old_text>
Circle { radius }

View File

@@ -68,9 +68,17 @@
"ui_font_size": 16,
// How much to fade out unused code.
"unnecessary_code_fade": 0.3,
// The factor to grow the active pane by. Defaults to 1.0
// which gives the same size as all other panes.
"active_pane_magnification": 1.0,
// Active pane styling settings.
"active_pane_modifiers": {
// The factor to grow the active pane by. Defaults to 1.0
// which gives the same size as all other panes.
"magnification": 1.0,
// Inset border size of the active pane, in pixels.
"border_size": 0.0,
// Opacity of the inactive panes. 0 means transparent, 1 means opaque.
// Values are clamped to the [0.0, 1.0] range.
"inactive_opacity": 1.0
},
// The direction that you want to split panes horizontally. Defaults to "up"
"pane_split_direction_horizontal": "up",
// The direction that you want to split panes horizontally. Defaults to "left"
@@ -136,23 +144,23 @@
// 4. Highlight the full line (default):
// "all"
"current_line_highlight": "all",
// The debounce delay before querying highlights from the language
// server based on the current cursor location.
"lsp_highlight_debounce": 75,
// Whether to pop the completions menu while typing in an editor without
// explicitly requesting it.
"show_completions_on_input": true,
// Whether to display inline and alongside documentation for items in the
// completions menu
"show_completion_documentation": true,
// The debounce delay before re-querying the language server for completion
// documentation when not included in original completion list.
"completion_documentation_secondary_query_debounce": 300,
// Show method signatures in the editor, when inside parentheses.
"auto_signature_help": false,
/// Whether to show the signature help after completion or a bracket pair inserted.
/// If `auto_signature_help` is enabled, this setting will be treated as enabled also.
"show_signature_help_after_edits": true,
"show_signature_help_after_edits": false,
// Whether to show wrap guides (vertical rulers) in the editor.
// Setting this to true will show a guide at the 'preferred_line_length' value
// if softwrap is set to 'preferred_line_length', and will show any
// if 'soft_wrap' is set to 'preferred_line_length', and will show any
// additional guides as specified by the 'wrap_guides' setting.
"show_wrap_guides": true,
// Character counts at which to show wrap guides in the editor.
@@ -174,6 +182,8 @@
// bracket, brace, single or double quote characters.
// For example, when you select text and type (, Zed will surround the text with ().
"use_auto_surround": true,
// Whether indentation of pasted content should be adjusted based on the context.
"auto_indent_on_paste": true,
// Controls how the editor handles the autoclosed characters.
// When set to `false`(default), skipping over and auto-removing of the closing characters
// happen only for auto-inserted characters.
@@ -183,6 +193,9 @@
// Controls whether inline completions are shown immediately (true)
// or manually by triggering `editor::ShowInlineCompletion` (false).
"show_inline_completions": true,
// Controls whether inline completions are shown in a given language scope.
// Example: ["string", "comment"]
"inline_completions_disabled_in": [],
// Whether to show tabs and spaces in the editor.
// This setting can take three values:
//
@@ -287,6 +300,8 @@
"scroll_beyond_last_line": "one_page",
// The number of lines to keep above/below the cursor when scrolling.
"vertical_scroll_margin": 3,
// Whether to scroll when clicking near the edge of the visible text area.
"autoscroll_on_clicks": false,
// Scroll sensitivity multiplier. This multiplier is applied
// to both the horizontal and vertical delta values while scrolling.
"scroll_sensitivity": 1.0,
@@ -346,8 +361,6 @@
"git_status": true,
// Amount of indentation for nested items.
"indent_size": 20,
// Whether to show indent guides in the project panel.
"indent_guides": true,
// Whether to reveal it in the project panel automatically,
// when a corresponding project entry becomes active.
// Gitignored entries are never auto revealed.
@@ -371,6 +384,27 @@
/// 5. Never show the scrollbar:
/// "never"
"show": null
},
/// Which files containing diagnostic errors/warnings to mark in the project panel.
/// This setting can take the following three values:
///
/// 1. Do not mark any files:
/// "off"
/// 2. Only mark files with errors:
/// "errors"
/// 3. Mark files with errors and warnings:
/// "all"
"show_diagnostics": "all",
// Settings related to indent guides in the project panel.
"indent_guides": {
// When to show indent guides in the project panel.
// This setting can take two values:
//
// 1. Always show indent guides:
// "always"
// 2. Never show indent guides:
// "never"
"show": "always"
}
},
"outline_panel": {
@@ -394,7 +428,35 @@
"auto_reveal_entries": true,
/// Whether to fold directories automatically
/// when a directory has only one directory inside.
"auto_fold_dirs": true
"auto_fold_dirs": true,
// Settings related to indent guides in the outline panel.
"indent_guides": {
// When to show indent guides in the outline panel.
// This setting can take two values:
//
// 1. Always show indent guides:
// "always"
// 2. Never show indent guides:
// "never"
"show": "always"
},
/// Scrollbar-related settings
"scrollbar": {
/// When to show the scrollbar in the project panel.
/// This setting can take four values:
///
/// 1. null (default): Inherit editor settings
/// 2. Show the scrollbar if there's important information or
/// follow the system's configured behavior (default):
/// "auto"
/// 3. Match the system's configured behavior:
/// "system"
/// 4. Always show the scrollbar:
/// "always"
/// 5. Never show the scrollbar:
/// "never"
"show": null
}
},
"collaboration_panel": {
// Whether to show the collaboration panel button in the status bar.
@@ -412,6 +474,14 @@
// Default width of the chat panel.
"default_width": 240
},
"git_panel": {
// Whether to show the git panel button in the status bar.
"button": true,
// Where to the git panel. Can be 'left' or 'right'.
"dock": "left",
// Default width of the git panel.
"default_width": 360
},
"message_editor": {
// Whether to automatically replace emoji shortcodes with emoji characters.
// For example: typing `:wave:` gets replaced with `👋`.
@@ -438,7 +508,7 @@
"default_width": 640,
// Default height when the assistant is docked to the bottom.
"default_height": 320,
// The default model to use when creating new contexts.
// The default model to use when creating new chats.
"default_model": {
// The provider to use.
"provider": "zed.dev",
@@ -497,13 +567,28 @@
"close_position": "right",
// Whether to show the file icon for a tab.
"file_icons": false,
// Whether to always show the close button on tabs.
"always_show_close_button": false,
// What to do after closing the current tab.
//
// 1. Activate the tab that was open previously (default)
// "History"
// 2. Activate the neighbour tab (prefers the right one, if present)
// "Neighbour"
"activate_on_close": "history"
// "history"
// 2. Activate the right neighbour tab if present
// "neighbour"
// 3. Activate the left neighbour tab if present
// "left_neighbour"
"activate_on_close": "history",
/// Which files containing diagnostic errors/warnings to mark in the tabs.
/// Diagnostics are only shown when file icons are also active.
/// This setting only works when can take the following three values:
///
/// 1. Do not mark any files:
/// "off"
/// 2. Only mark files with errors:
/// "errors"
/// 3. Mark files with errors and warnings:
/// "all"
"show_diagnostics": "off"
},
// Settings related to preview tabs.
"preview_tabs": {
@@ -520,7 +605,23 @@
// Settings related to the file finder.
"file_finder": {
// Whether to show file icons in the file finder.
"file_icons": true
"file_icons": true,
// Determines how much space the file finder can take up in relation to the available window width.
// There are 5 possible width values:
//
// 1. Small: This value is essentially a fixed width.
// "modal_width": "small"
// 2. Medium:
// "modal_width": "medium"
// 3. Large:
// "modal_width": "large"
// 4. Extra Large:
// "modal_width": "xlarge"
// 5. Fullscreen: This value removes any horizontal padding, as it consumes the whole viewport width.
// "modal_width": "full"
//
// Default: small
"modal_max_width": "small"
},
// Whether or not to remove any trailing whitespace from lines of a buffer
// before saving it.
@@ -589,17 +690,23 @@
},
// Add files or globs of files that will be excluded by Zed entirely:
// they will be skipped during FS scan(s), file tree and file search
// will lack the corresponding file entries.
// will lack the corresponding file entries. Overrides `file_scan_inclusions`.
"file_scan_exclusions": [
"**/.git",
"**/.svn",
"**/.hg",
"**/.jj",
"**/CVS",
"**/.DS_Store",
"**/Thumbs.db",
"**/.classpath",
"**/.settings"
],
// Add files or globs of files that will be included by Zed, even when
// ignored by git. This is useful for files that are not tracked by git,
// but are still important to your project. Note that globs that are
// overly broad can slow down Zed's file scanning. Overridden by `file_scan_exclusions`.
"file_scan_inclusions": [".env*"],
// Git gutter behavior configuration.
"git": {
// Control whether the git gutter is shown. May take 2 values:
@@ -615,6 +722,12 @@
// Sets a delay after which the inline blame information is shown.
// Delay is restarted with every cursor movement.
// "delay_ms": 600
//
// Whether or not do display the git commit summary on the same line.
// "show_commit_summary": false
//
// The minimum column number to show the inline blame information at
// "min_column": 0
}
},
// Configuration for how direnv configuration should be loaded. May take 2 values:
@@ -754,8 +867,12 @@
}
},
"toolbar": {
// Whether to display the terminal title in its toolbar.
"title": true
// Whether to display the terminal title in its toolbar's breadcrumbs.
// Only shown if the terminal title is not empty.
//
// The shell running in the terminal needs to be configured to emit the title.
// Example: `echo -e "\e]2;New Title\007";`
"breadcrumbs": true
}
// Set the terminal's font size. If this option is not included,
// the terminal will default to matching the buffer's font size.
@@ -791,15 +908,8 @@
//
"file_types": {
"Plain Text": ["txt"],
"JSON": ["flake.lock"],
"JSONC": [
"**/.zed/**/*.json",
"**/zed/**/*.json",
"**/Zed/**/*.json",
"tsconfig.json",
"pyrightconfig.json"
],
"TOML": ["uv.lock"]
"JSONC": ["**/.zed/**/*.json", "**/zed/**/*.json", "**/Zed/**/*.json", "**/.vscode/**/*.json"],
"Shell Script": [".env.*"]
},
/// By default use a recent system version of node, or install our own.
/// You can override this to use a version of node that is not in $PATH with:
@@ -987,13 +1097,11 @@
"api_url": "https://generativelanguage.googleapis.com"
},
"ollama": {
"api_url": "http://localhost:11434",
"low_speed_timeout_in_seconds": 60
"api_url": "http://localhost:11434"
},
"openai": {
"version": "1",
"api_url": "https://api.openai.com/v1",
"low_speed_timeout_in_seconds": 600
"api_url": "https://api.openai.com/v1"
}
},
// Zed's Prettier integration settings.
@@ -1043,6 +1151,7 @@
"use_system_clipboard": "always",
"use_multiline_find": false,
"use_smartcase_find": false,
"highlight_on_yank_duration": 200,
"custom_digraphs": {}
},
// The server to connect to. If the environment variable
@@ -1100,6 +1209,8 @@
// "W": "workspace::Save"
// }
"command_aliases": {},
// Whether to show user picture in titlebar.
"show_user_picture": true,
// ssh_connections is an array of ssh connections.
// You can configure these from `project: Open Remote` in the command palette.
// Zed's ssh support will pull configuration from your ~/.ssh too.
@@ -1116,15 +1227,6 @@
// }
// ]
"ssh_connections": [],
// Configures the Context Server Protocol binaries
//
// Examples:
// {
// "id": "server-1",
// "executable": "/path",
// "args": ['arg1", "args2"]
// }
"experimental.context_servers": {
"servers": []
}
// Configures context servers for use in the Assistant.
"context_servers": {}
}

View File

@@ -16,6 +16,7 @@
"allow_concurrent_runs": false,
// What to do with the terminal pane and tab, after the command was started:
// * `always` — always show the terminal pane, add and focus the corresponding task's tab in it (default)
// * `no_focus` — always show the terminal pane, add/reuse the task's tab there, but don't focus it
// * `never` — avoid changing current terminal pane focus, but still add/reuse the task's tab there
"reveal": "always",
// What to do with the terminal pane and tab, after the command had finished:

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Andromeda",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#1e2025ff",
"search.match_background": "#11a79366",
"panel.background": "#21242bff",
"panel.focused_border": null,
"panel.focused_border": "#10a793ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#f7f7f84c",
"scrollbar.thumb.hover_background": "#252931ff",

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Atelier",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#19171cff",
"search.match_background": "#576dda66",
"panel.background": "#221f26ff",
"panel.focused_border": null,
"panel.focused_border": "#566ddaff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#efecf44c",
"scrollbar.thumb.hover_background": "#332f38ff",
@@ -431,7 +431,7 @@
"tab.active_background": "#efecf4ff",
"search.match_background": "#586dda66",
"panel.background": "#e6e3ebff",
"panel.focused_border": null,
"panel.focused_border": "#586cdaff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#19171c4c",
"scrollbar.thumb.hover_background": "#cbc8d1ff",

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Ayu",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#0d1016ff",
"search.match_background": "#5ac2fe66",
"panel.background": "#1f2127ff",
"panel.focused_border": null,
"panel.focused_border": "#5ac1feff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#bfbdb64c",
"scrollbar.thumb.hover_background": "#2d2f34ff",
@@ -416,7 +416,7 @@
"tab.active_background": "#fcfcfcff",
"search.match_background": "#3b9ee566",
"panel.background": "#ececedff",
"panel.focused_border": null,
"panel.focused_border": "#3b9ee5ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#5c61664c",
"scrollbar.thumb.hover_background": "#dfe0e1ff",

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Gruvbox",
"author": "Zed Industries",
"themes": [
@@ -55,7 +55,7 @@
"tab.active_background": "#282828ff",
"search.match_background": "#83a59866",
"panel.background": "#3a3735ff",
"panel.focused_border": null,
"panel.focused_border": "#83a598ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#fbf1c74c",
"scrollbar.thumb.hover_background": "#494340ff",
@@ -439,7 +439,7 @@
"tab.active_background": "#1d2021ff",
"search.match_background": "#83a59866",
"panel.background": "#393634ff",
"panel.focused_border": null,
"panel.focused_border": "#83a598ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#fbf1c74c",
"scrollbar.thumb.hover_background": "#494340ff",

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "One",
"author": "Zed Industries",
"themes": [
@@ -27,15 +27,15 @@
"ghost_element.active": "#454a56ff",
"ghost_element.selected": "#454a56ff",
"ghost_element.disabled": "#2e343eff",
"text": "#c8ccd4ff",
"text.muted": "#838994ff",
"text.placeholder": "#696B77ff",
"text.disabled": "#696B77ff",
"text": "#dce0e5ff",
"text.muted": "#a9afbcff",
"text.placeholder": "#878a98ff",
"text.disabled": "#878a98ff",
"text.accent": "#74ade8ff",
"icon": "#c8ccd4ff",
"icon.muted": "#838994ff",
"icon.disabled": "#696B77ff",
"icon.placeholder": "#838994ff",
"icon": "#dce0e5ff",
"icon.muted": "#a9afbcff",
"icon.disabled": "#878a98ff",
"icon.placeholder": "#a9afbcff",
"icon.accent": "#74ade8ff",
"status_bar.background": "#3b414dff",
"title_bar.background": "#3b414dff",
@@ -60,19 +60,19 @@
"editor.active_line.background": "#2f343ebf",
"editor.highlighted_line.background": "#2f343eff",
"editor.line_number": "#c8ccd459",
"editor.active_line_number": "#c8ccd4ff",
"editor.invisible": "#696B77ff",
"editor.active_line_number": "#dce0e5ff",
"editor.invisible": "#878a98ff",
"editor.wrap_guide": "#c8ccd40d",
"editor.active_wrap_guide": "#c8ccd41a",
"editor.document_highlight.read_background": "#74ade81a",
"editor.document_highlight.write_background": "#555a6366",
"terminal.background": "#282c33ff",
"terminal.foreground": "#c8ccd4ff",
"terminal.bright_foreground": "#c8ccd4ff",
"terminal.foreground": "#dce0e5ff",
"terminal.bright_foreground": "#dce0e5ff",
"terminal.dim_foreground": "#282c33ff",
"terminal.ansi.black": "#282c33ff",
"terminal.ansi.bright_black": "#525561ff",
"terminal.ansi.dim_black": "#c8ccd4ff",
"terminal.ansi.dim_black": "#dce0e5ff",
"terminal.ansi.red": "#d07277ff",
"terminal.ansi.bright_red": "#673a3cff",
"terminal.ansi.dim_red": "#eab7b9ff",
@@ -91,8 +91,8 @@
"terminal.ansi.cyan": "#6eb4bfff",
"terminal.ansi.bright_cyan": "#3a565bff",
"terminal.ansi.dim_cyan": "#b9d9dfff",
"terminal.ansi.white": "#c8ccd4ff",
"terminal.ansi.bright_white": "#c8ccd4ff",
"terminal.ansi.white": "#dce0e5ff",
"terminal.ansi.bright_white": "#dce0e5ff",
"terminal.ansi.dim_white": "#575d65ff",
"link_text.hover": "#74ade8ff",
"conflict": "#dec184ff",
@@ -107,14 +107,14 @@
"error": "#d07277ff",
"error.background": "#d072771a",
"error.border": "#4c2b2cff",
"hidden": "#696B77ff",
"hidden.background": "#696B771a",
"hidden": "#878a98ff",
"hidden.background": "#696b771a",
"hidden.border": "#414754ff",
"hint": "#5a6f89ff",
"hint": "#788ca6ff",
"hint.background": "#5a6f891a",
"hint.border": "#293b5bff",
"ignored": "#696B77ff",
"ignored.background": "#696B771a",
"ignored": "#878a98ff",
"ignored.background": "#696b771a",
"ignored.border": "#464b57ff",
"info": "#74ade8ff",
"info.background": "#74ade81a",
@@ -131,7 +131,7 @@
"success": "#a1c181ff",
"success.background": "#a1c1811a",
"success.border": "#38482fff",
"unreachable": "#838994ff",
"unreachable": "#a9afbcff",
"unreachable.background": "#8389941a",
"unreachable.border": "#464b57ff",
"warning": "#dec184ff",
@@ -211,7 +211,7 @@
"font_weight": null
},
"embedded": {
"color": "#c8ccd4ff",
"color": "#dce0e5ff",
"font_style": null,
"font_weight": null
},
@@ -236,7 +236,7 @@
"font_weight": null
},
"hint": {
"color": "#5a6f89ff",
"color": "#788ca6ff",
"font_style": null,
"font_weight": 700
},
@@ -276,7 +276,7 @@
"font_weight": null
},
"preproc": {
"color": "#c8ccd4ff",
"color": "#dce0e5ff",
"font_style": null,
"font_weight": null
},
@@ -361,7 +361,7 @@
"font_weight": null
},
"variable": {
"color": "#c8ccd4ff",
"color": "#dce0e5ff",
"font_style": null,
"font_weight": null
},
@@ -402,15 +402,15 @@
"ghost_element.active": "#cacacaff",
"ghost_element.selected": "#cacacaff",
"ghost_element.disabled": "#ebebecff",
"text": "#383a41ff",
"text.muted": "#7e8087ff",
"text.placeholder": "#a1a1a3ff",
"text.disabled": "#a1a1a3ff",
"text": "#242529ff",
"text.muted": "#58585aff",
"text.placeholder": "#7e8086ff",
"text.disabled": "#7e8086ff",
"text.accent": "#5c78e2ff",
"icon": "#383a41ff",
"icon.muted": "#7e8087ff",
"icon.disabled": "#a1a1a3ff",
"icon.placeholder": "#7e8087ff",
"icon": "#242529ff",
"icon.muted": "#58585aff",
"icon.disabled": "#7e8086ff",
"icon.placeholder": "#58585aff",
"icon.accent": "#5c78e2ff",
"status_bar.background": "#dcdcddff",
"title_bar.background": "#dcdcddff",
@@ -428,26 +428,26 @@
"scrollbar.thumb.border": "#dfdfe0ff",
"scrollbar.track.background": "#00000000",
"scrollbar.track.border": "#eeeeeeff",
"editor.foreground": "#383a41ff",
"editor.foreground": "#242529ff",
"editor.background": "#fafafaff",
"editor.gutter.background": "#fafafaff",
"editor.subheader.background": "#ebebecff",
"editor.active_line.background": "#ebebecbf",
"editor.highlighted_line.background": "#ebebecff",
"editor.line_number": "#383a4159",
"editor.active_line_number": "#383a41ff",
"editor.active_line_number": "#242529ff",
"editor.invisible": "#a3a3a4ff",
"editor.wrap_guide": "#383a410d",
"editor.active_wrap_guide": "#383a411a",
"editor.document_highlight.read_background": "#5c78e21a",
"editor.document_highlight.write_background": "#a3a3a466",
"terminal.background": "#fafafaff",
"terminal.foreground": "#383a41ff",
"terminal.bright_foreground": "#383a41ff",
"terminal.foreground": "#242529ff",
"terminal.bright_foreground": "#242529ff",
"terminal.dim_foreground": "#fafafaff",
"terminal.ansi.black": "#fafafaff",
"terminal.ansi.bright_black": "#aaaaaaff",
"terminal.ansi.dim_black": "#383a41ff",
"terminal.ansi.dim_black": "#242529ff",
"terminal.ansi.red": "#d36151ff",
"terminal.ansi.bright_red": "#f0b0a4ff",
"terminal.ansi.dim_red": "#6f312aff",
@@ -466,11 +466,11 @@
"terminal.ansi.cyan": "#3a82b7ff",
"terminal.ansi.bright_cyan": "#a3bedaff",
"terminal.ansi.dim_cyan": "#254058ff",
"terminal.ansi.white": "#383a41ff",
"terminal.ansi.bright_white": "#383a41ff",
"terminal.ansi.white": "#242529ff",
"terminal.ansi.bright_white": "#242529ff",
"terminal.ansi.dim_white": "#97979aff",
"link_text.hover": "#5c78e2ff",
"conflict": "#dec184ff",
"conflict": "#a48819ff",
"conflict.background": "#faf2e6ff",
"conflict.border": "#f4e7d1ff",
"created": "#669f59ff",
@@ -482,19 +482,19 @@
"error": "#d36151ff",
"error.background": "#fbdfd9ff",
"error.border": "#f6c6bdff",
"hidden": "#a1a1a3ff",
"hidden": "#7e8086ff",
"hidden.background": "#dcdcddff",
"hidden.border": "#d3d3d4ff",
"hint": "#9294beff",
"hint": "#7274a7ff",
"hint.background": "#e2e2faff",
"hint.border": "#cbcdf6ff",
"ignored": "#a1a1a3ff",
"ignored": "#7e8086ff",
"ignored.background": "#dcdcddff",
"ignored.border": "#c9c9caff",
"info": "#5c78e2ff",
"info.background": "#e2e2faff",
"info.border": "#cbcdf6ff",
"modified": "#a47a23ff",
"modified": "#a48819ff",
"modified.background": "#faf2e6ff",
"modified.border": "#f4e7d1ff",
"predictive": "#9b9ec6ff",
@@ -506,10 +506,10 @@
"success": "#669f59ff",
"success.background": "#dfeadbff",
"success.border": "#c8dcc1ff",
"unreachable": "#7e8087ff",
"unreachable": "#58585aff",
"unreachable.background": "#dcdcddff",
"unreachable.border": "#c9c9caff",
"warning": "#dec184ff",
"warning": "#a48819ff",
"warning.background": "#faf2e6ff",
"warning.border": "#f4e7d1ff",
"players": [
@@ -544,7 +544,7 @@
"selection": "#d361513d"
},
{
"cursor": "#dec184ff",
"cursor": "#a48819ff",
"background": "#dec184ff",
"selection": "#dec1843d"
},
@@ -586,7 +586,7 @@
"font_weight": null
},
"embedded": {
"color": "#383a41ff",
"color": "#242529ff",
"font_style": null,
"font_weight": null
},
@@ -611,7 +611,7 @@
"font_weight": null
},
"hint": {
"color": "#9294beff",
"color": "#7274a7ff",
"font_style": null,
"font_weight": 700
},
@@ -651,12 +651,12 @@
"font_weight": null
},
"preproc": {
"color": "#383a41ff",
"color": "#242529ff",
"font_style": null,
"font_weight": null
},
"primary": {
"color": "#383a41ff",
"color": "#242529ff",
"font_style": null,
"font_weight": null
},
@@ -666,7 +666,7 @@
"font_weight": null
},
"punctuation": {
"color": "#383a41ff",
"color": "#242529ff",
"font_style": null,
"font_weight": null
},
@@ -736,7 +736,7 @@
"font_weight": null
},
"variable": {
"color": "#383a41ff",
"color": "#242529ff",
"font_style": null,
"font_weight": null
},

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Rosé Pine",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#191724ff",
"search.match_background": "#57949f66",
"panel.background": "#1c1b2aff",
"panel.focused_border": null,
"panel.focused_border": "#9bced6ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#e0def44c",
"scrollbar.thumb.hover_background": "#232132ff",
@@ -426,7 +426,7 @@
"tab.active_background": "#faf4edff",
"search.match_background": "#9cced766",
"panel.background": "#fef9f2ff",
"panel.focused_border": null,
"panel.focused_border": "#57949fff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#5752794c",
"scrollbar.thumb.hover_background": "#e5e0dfff",
@@ -806,7 +806,7 @@
"tab.active_background": "#232136ff",
"search.match_background": "#9cced766",
"panel.background": "#28253cff",
"panel.focused_border": null,
"panel.focused_border": "#9bced6ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#e0def44c",
"scrollbar.thumb.hover_background": "#322f48ff",

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Sandcastle",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#282c33ff",
"search.match_background": "#528b8b66",
"panel.background": "#2b3038ff",
"panel.focused_border": null,
"panel.focused_border": "#518b8bff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#fdf4c14c",
"scrollbar.thumb.hover_background": "#313741ff",

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Solarized",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#002a35ff",
"search.match_background": "#288bd166",
"panel.background": "#04313bff",
"panel.focused_border": null,
"panel.focused_border": "#278ad1ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#fdf6e34c",
"scrollbar.thumb.hover_background": "#053541ff",
@@ -416,7 +416,7 @@
"tab.active_background": "#fdf6e3ff",
"search.match_background": "#298bd166",
"panel.background": "#f3eddaff",
"panel.focused_border": null,
"panel.focused_border": "#288bd1ff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#002a354c",
"scrollbar.thumb.hover_background": "#dcdacbff",
@@ -519,8 +519,8 @@
"selection": "#d337813d"
},
{
"cursor": "#cb4b17ff",
"background": "#cb4b17ff",
"cursor": "#cb4b16ff",
"background": "#cb4b16ff",
"selection": "#cb4b173d"
},
{
@@ -596,7 +596,7 @@
"font_weight": 700
},
"enum": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},
@@ -621,7 +621,7 @@
"font_weight": null
},
"link_text": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": "italic",
"font_weight": null
},
@@ -636,7 +636,7 @@
"font_weight": null
},
"operator": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},
@@ -686,7 +686,7 @@
"font_weight": null
},
"string": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},
@@ -696,17 +696,17 @@
"font_weight": null
},
"string.regex": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},
"string.special": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},
"string.special.symbol": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},
@@ -716,7 +716,7 @@
"font_weight": null
},
"text.literal": {
"color": "#cb4b17ff",
"color": "#cb4b16ff",
"font_style": null,
"font_weight": null
},

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"$schema": "https://zed.dev/schema/themes/v0.2.0.json",
"name": "Summercamp",
"author": "Zed Industries",
"themes": [
@@ -46,7 +46,7 @@
"tab.active_background": "#1b1810ff",
"search.match_background": "#499bef66",
"panel.background": "#231f16ff",
"panel.focused_border": null,
"panel.focused_border": "#499befff",
"pane.focused_border": null,
"scrollbar.thumb.background": "#f8f5de4c",
"scrollbar.thumb.hover_background": "#29251bff",

View File

@@ -16,13 +16,15 @@ doctest = false
anyhow.workspace = true
auto_update.workspace = true
editor.workspace = true
extension.workspace = true
extension_host.workspace = true
futures.workspace = true
gpui.workspace = true
language.workspace = true
lsp.workspace = true
project.workspace = true
smallvec.workspace = true
ui.workspace = true
util.workspace = true
workspace.workspace = true
[dev-dependencies]

View File

@@ -1,19 +1,19 @@
use auto_update::{AutoUpdateStatus, AutoUpdater, DismissErrorMessage};
use editor::Editor;
use extension::ExtensionStore;
use extension_host::ExtensionStore;
use futures::StreamExt;
use gpui::{
actions, percentage, Animation, AnimationExt as _, AppContext, CursorStyle, EventEmitter,
InteractiveElement as _, Model, ParentElement as _, Render, SharedString,
StatefulInteractiveElement, Styled, Transformation, View, ViewContext, VisualContext as _,
};
use language::{
LanguageRegistry, LanguageServerBinaryStatus, LanguageServerId, LanguageServerName,
};
use language::{LanguageRegistry, LanguageServerBinaryStatus, LanguageServerId};
use lsp::LanguageServerName;
use project::{EnvironmentErrorMessage, LanguageServerProgress, Project, WorktreeId};
use smallvec::SmallVec;
use std::{cmp::Reverse, fmt::Write, sync::Arc, time::Duration};
use ui::{prelude::*, ButtonLike, ContextMenu, PopoverMenu, PopoverMenuHandle};
use ui::{prelude::*, ButtonLike, ContextMenu, PopoverMenu, PopoverMenuHandle, Tooltip};
use util::truncate_and_trailoff;
use workspace::{item::ItemHandle, StatusItemView, Workspace};
actions!(activity_indicator, [ShowErrorMessage]);
@@ -351,7 +351,10 @@ impl ActivityIndicator {
.into_any_element(),
),
message: format!("Formatting failed: {}. Click to see logs.", failure),
on_click: Some(Arc::new(|_, cx| {
on_click: Some(Arc::new(|indicator, cx| {
indicator.project.update(cx, |project, cx| {
project.reset_last_formatting_failure(cx);
});
cx.dispatch_action(Box::new(workspace::OpenLog));
})),
});
@@ -446,6 +449,8 @@ impl ActivityIndicator {
impl EventEmitter<Event> for ActivityIndicator {}
const MAX_MESSAGE_LEN: usize = 50;
impl Render for ActivityIndicator {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
let result = h_flex()
@@ -456,6 +461,7 @@ impl Render for ActivityIndicator {
return result;
};
let this = cx.view().downgrade();
let truncate_content = content.message.len() > MAX_MESSAGE_LEN;
result.gap_2().child(
PopoverMenu::new("activity-indicator-popover")
.trigger(
@@ -464,7 +470,21 @@ impl Render for ActivityIndicator {
.id("activity-indicator-status")
.gap_2()
.children(content.icon)
.child(Label::new(content.message).size(LabelSize::Small))
.map(|button| {
if truncate_content {
button
.child(
Label::new(truncate_and_trailoff(
&content.message,
MAX_MESSAGE_LEN,
))
.size(LabelSize::Small),
)
.tooltip(move |cx| Tooltip::text(&content.message, cx))
} else {
button.child(Label::new(content.message).size(LabelSize::Small))
}
})
.when_some(content.on_click, |this, handler| {
this.on_click(cx.listener(move |this, _, cx| {
handler(this, cx);

View File

@@ -1,13 +1,12 @@
mod supported_countries;
use std::time::Duration;
use std::{pin::Pin, str::FromStr};
use anyhow::{anyhow, Context, Result};
use chrono::{DateTime, Utc};
use futures::{io::BufReader, stream::BoxStream, AsyncBufReadExt, AsyncReadExt, Stream, StreamExt};
use http_client::http::{HeaderMap, HeaderValue};
use http_client::{AsyncBody, HttpClient, HttpRequestExt, Method, Request as HttpRequest};
use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest};
use serde::{Deserialize, Serialize};
use strum::{EnumIter, EnumString};
use thiserror::Error;
@@ -161,10 +160,7 @@ pub async fn complete(
.method(Method::POST)
.uri(uri)
.header("Anthropic-Version", "2023-06-01")
.header(
"Anthropic-Beta",
"tools-2024-04-04,prompt-caching-2024-07-31,max-tokens-3-5-sonnet-2024-07-15",
)
.header("Anthropic-Beta", "prompt-caching-2024-07-31")
.header("X-Api-Key", api_key)
.header("Content-Type", "application/json");
@@ -210,9 +206,8 @@ pub async fn stream_completion(
api_url: &str,
api_key: &str,
request: Request,
low_speed_timeout: Option<Duration>,
) -> Result<BoxStream<'static, Result<Event, AnthropicError>>, AnthropicError> {
stream_completion_with_rate_limit_info(client, api_url, api_key, request, low_speed_timeout)
stream_completion_with_rate_limit_info(client, api_url, api_key, request)
.await
.map(|output| output.0)
}
@@ -264,7 +259,6 @@ pub async fn stream_completion_with_rate_limit_info(
api_url: &str,
api_key: &str,
request: Request,
low_speed_timeout: Option<Duration>,
) -> Result<
(
BoxStream<'static, Result<Event, AnthropicError>>,
@@ -277,7 +271,7 @@ pub async fn stream_completion_with_rate_limit_info(
stream: true,
};
let uri = format!("{api_url}/v1/messages");
let mut request_builder = HttpRequest::builder()
let request_builder = HttpRequest::builder()
.method(Method::POST)
.uri(uri)
.header("Anthropic-Version", "2023-06-01")
@@ -287,9 +281,6 @@ pub async fn stream_completion_with_rate_limit_info(
)
.header("X-Api-Key", api_key)
.header("Content-Type", "application/json");
if let Some(low_speed_timeout) = low_speed_timeout {
request_builder = request_builder.read_timeout(low_speed_timeout);
}
let serialized_request =
serde_json::to_string(&request).context("failed to serialize request")?;
let request = request_builder

View File

@@ -33,7 +33,7 @@ client.workspace = true
clock.workspace = true
collections.workspace = true
command_palette_hooks.workspace = true
context_servers.workspace = true
context_server.workspace = true
db.workspace = true
editor.workspace = true
feature_flags.workspace = true
@@ -50,6 +50,8 @@ indexed_docs.workspace = true
indoc.workspace = true
language.workspace = true
language_model.workspace = true
language_model_selector.workspace = true
language_models.workspace = true
log.workspace = true
lsp.workspace = true
markdown.workspace = true

View File

@@ -5,60 +5,58 @@ pub mod assistant_settings;
mod context;
pub mod context_store;
mod inline_assistant;
mod model_selector;
mod patch;
mod prompt_library;
mod prompts;
mod slash_command;
pub(crate) mod slash_command_picker;
pub mod slash_command_settings;
mod slash_command_working_set;
mod streaming_diff;
mod terminal_inline_assistant;
mod tools;
use crate::slash_command::project_command::ProjectSlashCommandFeatureFlag;
pub use crate::slash_command_working_set::{SlashCommandId, SlashCommandWorkingSet};
pub use assistant_panel::{AssistantPanel, AssistantPanelEvent};
use assistant_settings::AssistantSettings;
use assistant_slash_command::SlashCommandRegistry;
use assistant_tool::ToolRegistry;
use client::{proto, Client};
use command_palette_hooks::CommandPaletteFilter;
pub use context::*;
use context_servers::ContextServerRegistry;
pub use context_store::*;
use feature_flags::FeatureFlagAppExt;
use fs::Fs;
use gpui::impl_actions;
use gpui::{actions, AppContext, Global, SharedString, UpdateGlobal};
use gpui::{impl_actions, Context as _};
use indexed_docs::IndexedDocsRegistry;
pub(crate) use inline_assistant::*;
use language_model::{
LanguageModelId, LanguageModelProviderId, LanguageModelRegistry, LanguageModelResponseMessage,
};
pub(crate) use model_selector::*;
pub use patch::*;
pub use prompts::PromptBuilder;
use prompts::PromptLoadingParams;
use semantic_index::{CloudEmbeddingProvider, SemanticDb};
use serde::{Deserialize, Serialize};
use settings::{update_settings_file, Settings, SettingsStore};
use slash_command::workflow_command::WorkflowSlashCommand;
use slash_command::search_command::SearchSlashCommandFeatureFlag;
use slash_command::{
auto_command, cargo_workspace_command, context_server_command, default_command, delta_command,
diagnostics_command, docs_command, fetch_command, file_command, now_command, project_command,
prompt_command, search_command, symbols_command, tab_command, terminal_command,
workflow_command,
auto_command, cargo_workspace_command, default_command, delta_command, diagnostics_command,
docs_command, fetch_command, file_command, now_command, project_command, prompt_command,
search_command, selection_command, symbols_command, tab_command, terminal_command,
};
use std::path::PathBuf;
use std::sync::Arc;
pub(crate) use streaming_diff::*;
use util::ResultExt;
use crate::slash_command::streaming_example_command;
use crate::slash_command_settings::SlashCommandSettings;
actions!(
assistant,
[
Assist,
Edit,
Split,
CopyCode,
CycleMessageRole,
@@ -214,6 +212,17 @@ pub fn init(
cx.spawn(|mut cx| {
let client = client.clone();
async move {
let is_search_slash_command_enabled = cx
.update(|cx| cx.wait_for_flag::<SearchSlashCommandFeatureFlag>())?
.await;
let is_project_slash_command_enabled = cx
.update(|cx| cx.wait_for_flag::<ProjectSlashCommandFeatureFlag>())?
.await;
if !is_search_slash_command_enabled && !is_project_slash_command_enabled {
return Ok(());
}
let embedding_provider = CloudEmbeddingProvider::new(client.clone());
let semantic_index = SemanticDb::new(
paths::embeddings_dir().join("semantic-index-db.0.mdb"),
@@ -233,7 +242,7 @@ pub fn init(
assistant_slash_command::init(cx);
assistant_tool::init(cx);
assistant_panel::init(cx);
context_servers::init(cx);
context_server::init(cx);
let prompt_builder = prompts::PromptBuilder::new(Some(PromptLoadingParams {
fs: fs.clone(),
@@ -246,7 +255,6 @@ pub fn init(
.map(Arc::new)
.unwrap_or_else(|| Arc::new(prompts::PromptBuilder::new(None).unwrap()));
register_slash_commands(Some(prompt_builder.clone()), cx);
register_tools(cx);
inline_assistant::init(
fs.clone(),
prompt_builder.clone(),
@@ -259,7 +267,7 @@ pub fn init(
client.telemetry().clone(),
cx,
);
IndexedDocsRegistry::init_global(cx);
indexed_docs::init(cx);
CommandPaletteFilter::update_global(cx, |filter, _cx| {
filter.hide_namespace(Assistant::NAMESPACE);
@@ -277,69 +285,9 @@ pub fn init(
})
.detach();
register_context_server_handlers(cx);
prompt_builder
}
fn register_context_server_handlers(cx: &mut AppContext) {
cx.subscribe(
&context_servers::manager::ContextServerManager::global(cx),
|manager, event, cx| match event {
context_servers::manager::Event::ServerStarted { server_id } => {
cx.update_model(
&manager,
|manager: &mut context_servers::manager::ContextServerManager, cx| {
let slash_command_registry = SlashCommandRegistry::global(cx);
let context_server_registry = ContextServerRegistry::global(cx);
if let Some(server) = manager.get_server(server_id) {
cx.spawn(|_, _| async move {
let Some(protocol) = server.client.read().clone() else {
return;
};
if let Some(prompts) = protocol.list_prompts().await.log_err() {
for prompt in prompts
.into_iter()
.filter(context_server_command::acceptable_prompt)
{
log::info!(
"registering context server command: {:?}",
prompt.name
);
context_server_registry.register_command(
server.id.clone(),
prompt.name.as_str(),
);
slash_command_registry.register_command(
context_server_command::ContextServerSlashCommand::new(
&server, prompt,
),
true,
);
}
}
})
.detach();
}
},
);
}
context_servers::manager::Event::ServerStopped { server_id } => {
let slash_command_registry = SlashCommandRegistry::global(cx);
let context_server_registry = ContextServerRegistry::global(cx);
if let Some(commands) = context_server_registry.get_commands(server_id) {
for command_name in commands {
slash_command_registry.unregister_command_by_name(&command_name);
context_server_registry.unregister_command(&server_id, &command_name);
}
}
}
},
)
.detach();
}
fn init_language_model_settings(cx: &mut AppContext) {
update_active_language_model_from_settings(cx);
@@ -389,30 +337,14 @@ fn register_slash_commands(prompt_builder: Option<Arc<PromptBuilder>>, cx: &mut
slash_command_registry
.register_command(cargo_workspace_command::CargoWorkspaceSlashCommand, true);
slash_command_registry.register_command(prompt_command::PromptSlashCommand, true);
slash_command_registry.register_command(selection_command::SelectionCommand, true);
slash_command_registry.register_command(default_command::DefaultSlashCommand, false);
slash_command_registry.register_command(terminal_command::TerminalSlashCommand, true);
slash_command_registry.register_command(now_command::NowSlashCommand, false);
slash_command_registry.register_command(diagnostics_command::DiagnosticsSlashCommand, true);
slash_command_registry.register_command(fetch_command::FetchSlashCommand, false);
slash_command_registry.register_command(fetch_command::FetchSlashCommand, false);
slash_command_registry.register_command(fetch_command::FetchSlashCommand, true);
if let Some(prompt_builder) = prompt_builder {
cx.observe_global::<SettingsStore>({
let slash_command_registry = slash_command_registry.clone();
let prompt_builder = prompt_builder.clone();
move |cx| {
if AssistantSettings::get_global(cx).are_live_diffs_enabled(cx) {
slash_command_registry.register_command(
workflow_command::WorkflowSlashCommand::new(prompt_builder.clone()),
true,
);
} else {
slash_command_registry.unregister_command_by_name(WorkflowSlashCommand::NAME);
}
}
})
.detach();
cx.observe_flag::<project_command::ProjectSlashCommandFeatureFlag, _>({
let slash_command_registry = slash_command_registry.clone();
move |is_enabled, _cx| {
@@ -438,6 +370,19 @@ fn register_slash_commands(prompt_builder: Option<Arc<PromptBuilder>>, cx: &mut
})
.detach();
cx.observe_flag::<streaming_example_command::StreamingExampleSlashCommandFeatureFlag, _>({
let slash_command_registry = slash_command_registry.clone();
move |is_enabled, _cx| {
if is_enabled {
slash_command_registry.register_command(
streaming_example_command::StreamingExampleSlashCommand,
false,
);
}
}
})
.detach();
update_slash_commands_from_settings(cx);
cx.observe_global::<SettingsStore>(update_slash_commands_from_settings)
.detach();
@@ -472,11 +417,6 @@ fn update_slash_commands_from_settings(cx: &mut AppContext) {
}
}
fn register_tools(cx: &mut AppContext) {
let tool_registry = ToolRegistry::global(cx);
tool_registry.register_tool(tools::now_tool::NowTool);
}
pub fn humanize_token_count(count: usize) -> String {
match count {
0..=999 => count.to_string(),

File diff suppressed because it is too large Load Diff

View File

@@ -5,13 +5,12 @@ use anthropic::Model as AnthropicModel;
use feature_flags::FeatureFlagAppExt;
use fs::Fs;
use gpui::{AppContext, Pixels};
use language_model::provider::open_ai;
use language_model::settings::{
AnthropicSettingsContent, AnthropicSettingsContentV1, OllamaSettingsContent,
OpenAiSettingsContent, OpenAiSettingsContentV1, VersionedAnthropicSettingsContent,
VersionedOpenAiSettingsContent,
use language_model::{CloudModel, LanguageModel};
use language_models::{
provider::open_ai, AllLanguageModelSettings, AnthropicSettingsContent,
AnthropicSettingsContentV1, OllamaSettingsContent, OpenAiSettingsContent,
OpenAiSettingsContentV1, VersionedAnthropicSettingsContent, VersionedOpenAiSettingsContent,
};
use language_model::{settings::AllLanguageModelSettings, CloudModel, LanguageModel};
use ollama::Model as OllamaModel;
use schemars::{schema::Schema, JsonSchema};
use serde::{Deserialize, Serialize};
@@ -35,20 +34,17 @@ pub enum AssistantProviderContentV1 {
OpenAi {
default_model: Option<OpenAiModel>,
api_url: Option<String>,
low_speed_timeout_in_seconds: Option<u64>,
available_models: Option<Vec<OpenAiModel>>,
},
#[serde(rename = "anthropic")]
Anthropic {
default_model: Option<AnthropicModel>,
api_url: Option<String>,
low_speed_timeout_in_seconds: Option<u64>,
},
#[serde(rename = "ollama")]
Ollama {
default_model: Option<OllamaModel>,
api_url: Option<String>,
low_speed_timeout_in_seconds: Option<u64>,
},
}
@@ -115,47 +111,41 @@ impl AssistantSettingsContent {
if let VersionedAssistantSettingsContent::V1(settings) = settings {
if let Some(provider) = settings.provider.clone() {
match provider {
AssistantProviderContentV1::Anthropic {
api_url,
low_speed_timeout_in_seconds,
..
} => update_settings_file::<AllLanguageModelSettings>(
fs,
cx,
move |content, _| {
if content.anthropic.is_none() {
content.anthropic = Some(AnthropicSettingsContent::Versioned(
VersionedAnthropicSettingsContent::V1(
AnthropicSettingsContentV1 {
api_url,
low_speed_timeout_in_seconds,
available_models: None,
},
),
));
}
},
),
AssistantProviderContentV1::Ollama {
api_url,
low_speed_timeout_in_seconds,
..
} => update_settings_file::<AllLanguageModelSettings>(
fs,
cx,
move |content, _| {
if content.ollama.is_none() {
content.ollama = Some(OllamaSettingsContent {
api_url,
low_speed_timeout_in_seconds,
available_models: None,
});
}
},
),
AssistantProviderContentV1::Anthropic { api_url, .. } => {
update_settings_file::<AllLanguageModelSettings>(
fs,
cx,
move |content, _| {
if content.anthropic.is_none() {
content.anthropic =
Some(AnthropicSettingsContent::Versioned(
VersionedAnthropicSettingsContent::V1(
AnthropicSettingsContentV1 {
api_url,
available_models: None,
},
),
));
}
},
)
}
AssistantProviderContentV1::Ollama { api_url, .. } => {
update_settings_file::<AllLanguageModelSettings>(
fs,
cx,
move |content, _| {
if content.ollama.is_none() {
content.ollama = Some(OllamaSettingsContent {
api_url,
available_models: None,
});
}
},
)
}
AssistantProviderContentV1::OpenAi {
api_url,
low_speed_timeout_in_seconds,
available_models,
..
} => update_settings_file::<AllLanguageModelSettings>(
@@ -188,7 +178,6 @@ impl AssistantSettingsContent {
VersionedOpenAiSettingsContent::V1(
OpenAiSettingsContentV1 {
api_url,
low_speed_timeout_in_seconds,
available_models,
},
),
@@ -298,54 +287,41 @@ impl AssistantSettingsContent {
log::warn!("attempted to set zed.dev model on outdated settings");
}
"anthropic" => {
let (api_url, low_speed_timeout_in_seconds) = match &settings.provider {
Some(AssistantProviderContentV1::Anthropic {
api_url,
low_speed_timeout_in_seconds,
..
}) => (api_url.clone(), *low_speed_timeout_in_seconds),
_ => (None, None),
let api_url = match &settings.provider {
Some(AssistantProviderContentV1::Anthropic { api_url, .. }) => {
api_url.clone()
}
_ => None,
};
settings.provider = Some(AssistantProviderContentV1::Anthropic {
default_model: AnthropicModel::from_id(&model).ok(),
api_url,
low_speed_timeout_in_seconds,
});
}
"ollama" => {
let (api_url, low_speed_timeout_in_seconds) = match &settings.provider {
Some(AssistantProviderContentV1::Ollama {
api_url,
low_speed_timeout_in_seconds,
..
}) => (api_url.clone(), *low_speed_timeout_in_seconds),
_ => (None, None),
let api_url = match &settings.provider {
Some(AssistantProviderContentV1::Ollama { api_url, .. }) => {
api_url.clone()
}
_ => None,
};
settings.provider = Some(AssistantProviderContentV1::Ollama {
default_model: Some(ollama::Model::new(&model, None, None)),
api_url,
low_speed_timeout_in_seconds,
});
}
"openai" => {
let (api_url, low_speed_timeout_in_seconds, available_models) =
match &settings.provider {
Some(AssistantProviderContentV1::OpenAi {
api_url,
low_speed_timeout_in_seconds,
available_models,
..
}) => (
api_url.clone(),
*low_speed_timeout_in_seconds,
available_models.clone(),
),
_ => (None, None, None),
};
let (api_url, available_models) = match &settings.provider {
Some(AssistantProviderContentV1::OpenAi {
api_url,
available_models,
..
}) => (api_url.clone(), available_models.clone()),
_ => (None, None),
};
settings.provider = Some(AssistantProviderContentV1::OpenAi {
default_model: OpenAiModel::from_id(&model).ok(),
api_url,
low_speed_timeout_in_seconds,
available_models,
});
}
@@ -410,7 +386,7 @@ pub struct AssistantSettingsContentV2 {
///
/// Default: 320
default_height: Option<f32>,
/// The default model to use when creating new contexts.
/// The default model to use when creating new chats.
default_model: Option<LanguageModelSelection>,
/// Additional models with which to generate alternatives when performing inline assists.
inline_alternatives: Option<Vec<LanguageModelSelection>>,
@@ -498,11 +474,11 @@ pub struct LegacyAssistantSettingsContent {
///
/// Default: 320
pub default_height: Option<f32>,
/// The default OpenAI model to use when creating new contexts.
/// The default OpenAI model to use when creating new chats.
///
/// Default: gpt-4-1106-preview
pub default_open_ai_model: Option<OpenAiModel>,
/// OpenAI API base URL to use when creating new contexts.
/// OpenAI API base URL to use when creating new chats.
///
/// Default: https://api.openai.com/v1
pub openai_api_url: Option<String>,

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,23 @@
use super::{AssistantEdit, MessageCacheMetadata};
use crate::slash_command_working_set::SlashCommandWorkingSet;
use crate::{
assistant_panel, prompt_library, slash_command::file_command, AssistantEditKind, CacheStatus,
Context, ContextEvent, ContextId, ContextOperation, MessageId, MessageStatus, PromptBuilder,
Context, ContextEvent, ContextId, ContextOperation, InvokedSlashCommandId, MessageId,
MessageStatus, PromptBuilder,
};
use anyhow::Result;
use assistant_slash_command::{
ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection,
SlashCommandRegistry, SlashCommandResult,
ArgumentCompletion, SlashCommand, SlashCommandContent, SlashCommandEvent, SlashCommandOutput,
SlashCommandOutputSection, SlashCommandRegistry, SlashCommandResult,
};
use collections::HashSet;
use assistant_tool::ToolWorkingSet;
use collections::{HashMap, HashSet};
use fs::FakeFs;
use gpui::{AppContext, Model, SharedString, Task, TestAppContext, WeakView};
use futures::{
channel::mpsc,
stream::{self, StreamExt},
};
use gpui::{prelude::*, AppContext, Model, SharedString, Task, TestAppContext, WeakView};
use language::{Buffer, BufferSnapshot, LanguageRegistry, LspAdapterDelegate};
use language_model::{LanguageModelCacheConfiguration, LanguageModelRegistry, Role};
use parking_lot::Mutex;
@@ -27,8 +34,8 @@ use std::{
rc::Rc,
sync::{atomic::AtomicBool, Arc},
};
use text::{network::Network, OffsetRangeExt as _, ReplicaId};
use ui::{Context as _, WindowContext};
use text::{network::Network, OffsetRangeExt as _, ReplicaId, ToOffset};
use ui::{IconName, WindowContext};
use unindent::Unindent;
use util::{
test::{generate_marked_text, marked_text_ranges},
@@ -44,8 +51,17 @@ fn test_inserting_and_removing_messages(cx: &mut AppContext) {
assistant_panel::init(cx);
let registry = Arc::new(LanguageRegistry::test(cx.background_executor().clone()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());
let context =
cx.new_model(|cx| Context::local(registry, None, None, prompt_builder.clone(), cx));
let context = cx.new_model(|cx| {
Context::local(
registry,
None,
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
let buffer = context.read(cx).buffer.clone();
let message_1 = context.read(cx).message_anchors[0].clone();
@@ -177,8 +193,17 @@ fn test_message_splitting(cx: &mut AppContext) {
let registry = Arc::new(LanguageRegistry::test(cx.background_executor().clone()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());
let context =
cx.new_model(|cx| Context::local(registry, None, None, prompt_builder.clone(), cx));
let context = cx.new_model(|cx| {
Context::local(
registry.clone(),
None,
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
let buffer = context.read(cx).buffer.clone();
let message_1 = context.read(cx).message_anchors[0].clone();
@@ -272,8 +297,17 @@ fn test_messages_for_offsets(cx: &mut AppContext) {
assistant_panel::init(cx);
let registry = Arc::new(LanguageRegistry::test(cx.background_executor().clone()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());
let context =
cx.new_model(|cx| Context::local(registry, None, None, prompt_builder.clone(), cx));
let context = cx.new_model(|cx| {
Context::local(
registry,
None,
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
let buffer = context.read(cx).buffer.clone();
let message_1 = context.read(cx).message_anchors[0].clone();
@@ -378,23 +412,53 @@ async fn test_slash_commands(cx: &mut TestAppContext) {
let registry = Arc::new(LanguageRegistry::test(cx.executor()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());
let context =
cx.new_model(|cx| Context::local(registry.clone(), None, None, prompt_builder.clone(), cx));
let context = cx.new_model(|cx| {
Context::local(
registry.clone(),
None,
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
let output_ranges = Rc::new(RefCell::new(HashSet::default()));
#[derive(Default)]
struct ContextRanges {
parsed_commands: HashSet<Range<language::Anchor>>,
command_outputs: HashMap<InvokedSlashCommandId, Range<language::Anchor>>,
output_sections: HashSet<Range<language::Anchor>>,
}
let context_ranges = Rc::new(RefCell::new(ContextRanges::default()));
context.update(cx, |_, cx| {
cx.subscribe(&context, {
let ranges = output_ranges.clone();
move |_, _, event, _| match event {
ContextEvent::PendingSlashCommandsUpdated { removed, updated } => {
for range in removed {
ranges.borrow_mut().remove(range);
let context_ranges = context_ranges.clone();
move |context, _, event, _| {
let mut context_ranges = context_ranges.borrow_mut();
match event {
ContextEvent::InvokedSlashCommandChanged { command_id } => {
let command = context.invoked_slash_command(command_id).unwrap();
context_ranges
.command_outputs
.insert(*command_id, command.range.clone());
}
for command in updated {
ranges.borrow_mut().insert(command.source_range.clone());
ContextEvent::ParsedSlashCommandsUpdated { removed, updated } => {
for range in removed {
context_ranges.parsed_commands.remove(range);
}
for command in updated {
context_ranges
.parsed_commands
.insert(command.source_range.clone());
}
}
ContextEvent::SlashCommandOutputSectionAdded { section } => {
context_ranges.output_sections.insert(section.range.clone());
}
_ => {}
}
_ => {}
}
})
.detach();
@@ -406,14 +470,12 @@ async fn test_slash_commands(cx: &mut TestAppContext) {
buffer.update(cx, |buffer, cx| {
buffer.edit([(0..0, "/file src/lib.rs")], None, cx);
});
assert_text_and_output_ranges(
assert_text_and_context_ranges(
&buffer,
&output_ranges.borrow(),
"
«/file src/lib.rs»
"
.unindent()
.trim_end(),
&context_ranges,
&"
«/file src/lib.rs»"
.unindent(),
cx,
);
@@ -422,14 +484,12 @@ async fn test_slash_commands(cx: &mut TestAppContext) {
let edit_offset = buffer.text().find("lib.rs").unwrap();
buffer.edit([(edit_offset..edit_offset + "lib".len(), "main")], None, cx);
});
assert_text_and_output_ranges(
assert_text_and_context_ranges(
&buffer,
&output_ranges.borrow(),
"
«/file src/main.rs»
"
.unindent()
.trim_end(),
&context_ranges,
&"
«/file src/main.rs»"
.unindent(),
cx,
);
@@ -442,36 +502,180 @@ async fn test_slash_commands(cx: &mut TestAppContext) {
cx,
);
});
assert_text_and_output_ranges(
assert_text_and_context_ranges(
&buffer,
&output_ranges.borrow(),
&context_ranges,
&"
/unknown src/main.rs"
.unindent(),
cx,
);
// Undoing the insertion of an non-existent slash command resorts the previous one.
buffer.update(cx, |buffer, cx| buffer.undo(cx));
assert_text_and_context_ranges(
&buffer,
&context_ranges,
&"
«/file src/main.rs»"
.unindent(),
cx,
);
let (command_output_tx, command_output_rx) = mpsc::unbounded();
context.update(cx, |context, cx| {
let command_source_range = context.parsed_slash_commands[0].source_range.clone();
context.insert_command_output(
command_source_range,
"file",
Task::ready(Ok(command_output_rx.boxed())),
true,
cx,
);
});
assert_text_and_context_ranges(
&buffer,
&context_ranges,
&"
⟦«/file src/main.rs»
…⟧
"
/unknown src/main.rs
.unindent(),
cx,
);
command_output_tx
.unbounded_send(Ok(SlashCommandEvent::StartSection {
icon: IconName::Ai,
label: "src/main.rs".into(),
metadata: None,
}))
.unwrap();
command_output_tx
.unbounded_send(Ok(SlashCommandEvent::Content("src/main.rs".into())))
.unwrap();
cx.run_until_parked();
assert_text_and_context_ranges(
&buffer,
&context_ranges,
&"
⟦«/file src/main.rs»
src/main.rs…⟧
"
.unindent()
.trim_end(),
.unindent(),
cx,
);
command_output_tx
.unbounded_send(Ok(SlashCommandEvent::Content("\nfn main() {}".into())))
.unwrap();
cx.run_until_parked();
assert_text_and_context_ranges(
&buffer,
&context_ranges,
&"
⟦«/file src/main.rs»
src/main.rs
fn main() {}…⟧
"
.unindent(),
cx,
);
command_output_tx
.unbounded_send(Ok(SlashCommandEvent::EndSection))
.unwrap();
cx.run_until_parked();
assert_text_and_context_ranges(
&buffer,
&context_ranges,
&"
⟦«/file src/main.rs»
⟪src/main.rs
fn main() {}⟫…⟧
"
.unindent(),
cx,
);
drop(command_output_tx);
cx.run_until_parked();
assert_text_and_context_ranges(
&buffer,
&context_ranges,
&"
⟦⟪src/main.rs
fn main() {}⟫⟧
"
.unindent(),
cx,
);
#[track_caller]
fn assert_text_and_output_ranges(
fn assert_text_and_context_ranges(
buffer: &Model<Buffer>,
ranges: &HashSet<Range<language::Anchor>>,
ranges: &RefCell<ContextRanges>,
expected_marked_text: &str,
cx: &mut TestAppContext,
) {
let (expected_text, expected_ranges) = marked_text_ranges(expected_marked_text, false);
let (actual_text, actual_ranges) = buffer.update(cx, |buffer, _| {
let mut ranges = ranges
.iter()
.map(|range| range.to_offset(buffer))
.collect::<Vec<_>>();
ranges.sort_by_key(|a| a.start);
(buffer.text(), ranges)
let mut actual_marked_text = String::new();
buffer.update(cx, |buffer, _| {
struct Endpoint {
offset: usize,
marker: char,
}
let ranges = ranges.borrow();
let mut endpoints = Vec::new();
for range in ranges.command_outputs.values() {
endpoints.push(Endpoint {
offset: range.start.to_offset(buffer),
marker: '',
});
}
for range in ranges.parsed_commands.iter() {
endpoints.push(Endpoint {
offset: range.start.to_offset(buffer),
marker: '«',
});
}
for range in ranges.output_sections.iter() {
endpoints.push(Endpoint {
offset: range.start.to_offset(buffer),
marker: '',
});
}
for range in ranges.output_sections.iter() {
endpoints.push(Endpoint {
offset: range.end.to_offset(buffer),
marker: '',
});
}
for range in ranges.parsed_commands.iter() {
endpoints.push(Endpoint {
offset: range.end.to_offset(buffer),
marker: '»',
});
}
for range in ranges.command_outputs.values() {
endpoints.push(Endpoint {
offset: range.end.to_offset(buffer),
marker: '',
});
}
endpoints.sort_by_key(|endpoint| endpoint.offset);
let mut offset = 0;
for endpoint in endpoints {
actual_marked_text.extend(buffer.text_for_range(offset..endpoint.offset));
actual_marked_text.push(endpoint.marker);
offset = endpoint.offset;
}
actual_marked_text.extend(buffer.text_for_range(offset..buffer.len()));
});
assert_eq!(actual_text, expected_text);
assert_eq!(actual_ranges, expected_ranges);
assert_eq!(actual_marked_text, expected_marked_text);
}
}
@@ -505,6 +709,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
Some(project),
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
@@ -636,7 +842,7 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
kind: AssistantEditKind::InsertAfter {
old_text: "fn one".into(),
new_text: "fn two() {}".into(),
description: "add a `two` function".into(),
description: Some("add a `two` function".into()),
},
}]],
cx,
@@ -690,7 +896,7 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
kind: AssistantEditKind::InsertAfter {
old_text: "fn zero".into(),
new_text: "fn two() {}".into(),
description: "add a `two` function".into(),
description: Some("add a `two` function".into()),
},
}]],
cx,
@@ -754,7 +960,7 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
kind: AssistantEditKind::InsertAfter {
old_text: "fn zero".into(),
new_text: "fn two() {}".into(),
description: "add a `two` function".into(),
description: Some("add a `two` function".into()),
},
}]],
cx,
@@ -768,6 +974,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
Default::default(),
registry.clone(),
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
None,
None,
cx,
@@ -798,7 +1006,7 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
kind: AssistantEditKind::InsertAfter {
old_text: "fn zero".into(),
new_text: "fn two() {}".into(),
description: "add a `two` function".into(),
description: Some("add a `two` function".into()),
},
}]],
cx,
@@ -876,8 +1084,17 @@ async fn test_serialization(cx: &mut TestAppContext) {
cx.update(assistant_panel::init);
let registry = Arc::new(LanguageRegistry::test(cx.executor()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());
let context =
cx.new_model(|cx| Context::local(registry.clone(), None, None, prompt_builder.clone(), cx));
let context = cx.new_model(|cx| {
Context::local(
registry.clone(),
None,
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
let buffer = context.read_with(cx, |context, _| context.buffer.clone());
let message_0 = context.read_with(cx, |context, _| context.message_anchors[0].id);
let message_1 = context.update(cx, |context, cx| {
@@ -917,6 +1134,8 @@ async fn test_serialization(cx: &mut TestAppContext) {
Default::default(),
registry.clone(),
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
None,
None,
cx,
@@ -975,6 +1194,8 @@ async fn test_random_context_collaboration(cx: &mut TestAppContext, mut rng: Std
language::Capability::ReadWrite,
registry.clone(),
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
None,
None,
cx,
@@ -1063,44 +1284,57 @@ async fn test_random_context_collaboration(cx: &mut TestAppContext, mut rng: Std
offset + 1..offset + 1 + command_text.len()
});
let output_len = rng.gen_range(1..=10);
let output_text = RandomCharIter::new(&mut rng)
.filter(|c| *c != '\r')
.take(output_len)
.take(10)
.collect::<String>();
let mut events = vec![Ok(SlashCommandEvent::StartMessage {
role: Role::User,
merge_same_roles: true,
})];
let num_sections = rng.gen_range(0..=3);
let mut sections = Vec::with_capacity(num_sections);
let mut section_start = 0;
for _ in 0..num_sections {
let section_start = rng.gen_range(0..output_len);
let section_end = rng.gen_range(section_start..=output_len);
sections.push(SlashCommandOutputSection {
range: section_start..section_end,
icon: ui::IconName::Ai,
let mut section_end = rng.gen_range(section_start..=output_text.len());
while !output_text.is_char_boundary(section_end) {
section_end += 1;
}
events.push(Ok(SlashCommandEvent::StartSection {
icon: IconName::Ai,
label: "section".into(),
metadata: None,
});
}));
events.push(Ok(SlashCommandEvent::Content(SlashCommandContent::Text {
text: output_text[section_start..section_end].to_string(),
run_commands_in_text: false,
})));
events.push(Ok(SlashCommandEvent::EndSection));
section_start = section_end;
}
if section_start < output_text.len() {
events.push(Ok(SlashCommandEvent::Content(SlashCommandContent::Text {
text: output_text[section_start..].to_string(),
run_commands_in_text: false,
})));
}
log::info!(
"Context {}: insert slash command output at {:?} with {:?}",
"Context {}: insert slash command output at {:?} with {:?} events",
context_index,
command_range,
sections
events.len()
);
let command_range = context.buffer.read(cx).anchor_after(command_range.start)
..context.buffer.read(cx).anchor_after(command_range.end);
context.insert_command_output(
command_range,
Task::ready(Ok(SlashCommandOutput {
text: output_text,
sections,
run_commands_in_text: false,
}
.to_event_stream())),
"/command",
Task::ready(Ok(stream::iter(events).boxed())),
true,
false,
cx,
);
});
@@ -1178,7 +1412,7 @@ async fn test_random_context_collaboration(cx: &mut TestAppContext, mut rng: Std
let first_context = contexts[0].read(cx);
for context in &contexts[1..] {
let context = context.read(cx);
assert!(context.pending_ops.is_empty());
assert!(context.pending_ops.is_empty(), "pending ops: {:?}", context.pending_ops);
assert_eq!(
context.buffer.read(cx).text(),
first_context.buffer.read(cx).text(),
@@ -1215,8 +1449,17 @@ fn test_mark_cache_anchors(cx: &mut AppContext) {
assistant_panel::init(cx);
let registry = Arc::new(LanguageRegistry::test(cx.background_executor().clone()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());
let context =
cx.new_model(|cx| Context::local(registry, None, None, prompt_builder.clone(), cx));
let context = cx.new_model(|cx| {
Context::local(
registry,
None,
None,
prompt_builder.clone(),
Arc::new(SlashCommandWorkingSet::default()),
Arc::new(ToolWorkingSet::default()),
cx,
)
});
let buffer = context.read(cx).buffer.clone();
// Create a test cache configuration

View File

@@ -1,10 +1,16 @@
use crate::slash_command::context_server_command;
use crate::SlashCommandId;
use crate::{
prompts::PromptBuilder, Context, ContextEvent, ContextId, ContextOperation, ContextVersion,
SavedContext, SavedContextMetadata,
prompts::PromptBuilder, slash_command_working_set::SlashCommandWorkingSet, Context,
ContextEvent, ContextId, ContextOperation, ContextVersion, SavedContext, SavedContextMetadata,
};
use anyhow::{anyhow, Context as _, Result};
use assistant_tool::{ToolId, ToolWorkingSet};
use client::{proto, telemetry::Telemetry, Client, TypedEnvelope};
use clock::ReplicaId;
use collections::HashMap;
use context_server::manager::ContextServerManager;
use context_server::{ContextServerFactoryRegistry, ContextServerTool};
use fs::Fs;
use futures::StreamExt;
use fuzzy::StringMatchCandidate;
@@ -43,9 +49,14 @@ pub struct RemoteContextMetadata {
pub struct ContextStore {
contexts: Vec<ContextHandle>,
contexts_metadata: Vec<SavedContextMetadata>,
context_server_manager: Model<ContextServerManager>,
context_server_slash_command_ids: HashMap<Arc<str>, Vec<SlashCommandId>>,
context_server_tool_ids: HashMap<Arc<str>, Vec<ToolId>>,
host_contexts: Vec<RemoteContextMetadata>,
fs: Arc<dyn Fs>,
languages: Arc<LanguageRegistry>,
slash_commands: Arc<SlashCommandWorkingSet>,
tools: Arc<ToolWorkingSet>,
telemetry: Arc<Telemetry>,
_watch_updates: Task<Option<()>>,
client: Arc<Client>,
@@ -87,6 +98,8 @@ impl ContextStore {
pub fn new(
project: Model<Project>,
prompt_builder: Arc<PromptBuilder>,
slash_commands: Arc<SlashCommandWorkingSet>,
tools: Arc<ToolWorkingSet>,
cx: &mut AppContext,
) -> Task<Result<Model<Self>>> {
let fs = project.read(cx).fs().clone();
@@ -97,12 +110,22 @@ impl ContextStore {
let (mut events, _) = fs.watch(contexts_dir(), CONTEXT_WATCH_DURATION).await;
let this = cx.new_model(|cx: &mut ModelContext<Self>| {
let context_server_factory_registry =
ContextServerFactoryRegistry::default_global(cx);
let context_server_manager = cx.new_model(|cx| {
ContextServerManager::new(context_server_factory_registry, project.clone(), cx)
});
let mut this = Self {
contexts: Vec::new(),
contexts_metadata: Vec::new(),
context_server_manager,
context_server_slash_command_ids: HashMap::default(),
context_server_tool_ids: HashMap::default(),
host_contexts: Vec::new(),
fs,
languages,
slash_commands,
tools,
telemetry,
_watch_updates: cx.spawn(|this, mut cx| {
async move {
@@ -125,13 +148,15 @@ impl ContextStore {
project: project.clone(),
prompt_builder,
};
this.handle_project_changed(project, cx);
this.handle_project_changed(project.clone(), cx);
this.synchronize_contexts(cx);
this.register_context_server_handlers(cx);
this
})?;
this.update(&mut cx, |this, cx| this.reload(cx))?
.await
.log_err();
Ok(this)
})
}
@@ -342,6 +367,8 @@ impl ContextStore {
Some(self.project.clone()),
Some(self.telemetry.clone()),
self.prompt_builder.clone(),
self.slash_commands.clone(),
self.tools.clone(),
cx,
)
});
@@ -364,6 +391,8 @@ impl ContextStore {
let project = self.project.clone();
let telemetry = self.telemetry.clone();
let prompt_builder = self.prompt_builder.clone();
let slash_commands = self.slash_commands.clone();
let tools = self.tools.clone();
let request = self.client.request(proto::CreateContext { project_id });
cx.spawn(|this, mut cx| async move {
let response = request.await?;
@@ -376,6 +405,8 @@ impl ContextStore {
capability,
language_registry,
prompt_builder,
slash_commands,
tools,
Some(project),
Some(telemetry),
cx,
@@ -425,6 +456,8 @@ impl ContextStore {
}
});
let prompt_builder = self.prompt_builder.clone();
let slash_commands = self.slash_commands.clone();
let tools = self.tools.clone();
cx.spawn(|this, mut cx| async move {
let saved_context = load.await?;
@@ -434,6 +467,8 @@ impl ContextStore {
path.clone(),
languages,
prompt_builder,
slash_commands,
tools,
Some(project),
Some(telemetry),
cx,
@@ -500,6 +535,8 @@ impl ContextStore {
context_id: context_id.to_proto(),
});
let prompt_builder = self.prompt_builder.clone();
let slash_commands = self.slash_commands.clone();
let tools = self.tools.clone();
cx.spawn(|this, mut cx| async move {
let response = request.await?;
let context_proto = response.context.context("invalid context")?;
@@ -510,6 +547,8 @@ impl ContextStore {
capability,
language_registry,
prompt_builder,
slash_commands,
tools,
Some(project),
Some(telemetry),
cx,
@@ -732,7 +771,7 @@ impl ContextStore {
contexts.push(SavedContextMetadata {
title: title.to_string(),
path,
mtime: metadata.mtime.into(),
mtime: metadata.mtime.timestamp_for_user().into(),
});
}
}
@@ -745,4 +784,114 @@ impl ContextStore {
})
})
}
pub fn restart_context_servers(&mut self, cx: &mut ModelContext<Self>) {
cx.update_model(
&self.context_server_manager,
|context_server_manager, cx| {
for server in context_server_manager.servers() {
context_server_manager
.restart_server(&server.id(), cx)
.detach_and_log_err(cx);
}
},
);
}
fn register_context_server_handlers(&self, cx: &mut ModelContext<Self>) {
cx.subscribe(
&self.context_server_manager.clone(),
Self::handle_context_server_event,
)
.detach();
}
fn handle_context_server_event(
&mut self,
context_server_manager: Model<ContextServerManager>,
event: &context_server::manager::Event,
cx: &mut ModelContext<Self>,
) {
let slash_command_working_set = self.slash_commands.clone();
let tool_working_set = self.tools.clone();
match event {
context_server::manager::Event::ServerStarted { server_id } => {
if let Some(server) = context_server_manager.read(cx).get_server(server_id) {
let context_server_manager = context_server_manager.clone();
cx.spawn({
let server = server.clone();
let server_id = server_id.clone();
|this, mut cx| async move {
let Some(protocol) = server.client() else {
return;
};
if protocol.capable(context_server::protocol::ServerCapability::Prompts) {
if let Some(prompts) = protocol.list_prompts().await.log_err() {
let slash_command_ids = prompts
.into_iter()
.filter(context_server_command::acceptable_prompt)
.map(|prompt| {
log::info!(
"registering context server command: {:?}",
prompt.name
);
slash_command_working_set.insert(Arc::new(
context_server_command::ContextServerSlashCommand::new(
context_server_manager.clone(),
&server,
prompt,
),
))
})
.collect::<Vec<_>>();
this.update(&mut cx, |this, _cx| {
this.context_server_slash_command_ids
.insert(server_id.clone(), slash_command_ids);
})
.log_err();
}
}
if protocol.capable(context_server::protocol::ServerCapability::Tools) {
if let Some(tools) = protocol.list_tools().await.log_err() {
let tool_ids = tools.tools.into_iter().map(|tool| {
log::info!("registering context server tool: {:?}", tool.name);
tool_working_set.insert(
Arc::new(ContextServerTool::new(
context_server_manager.clone(),
server.id(),
tool,
)),
)
}).collect::<Vec<_>>();
this.update(&mut cx, |this, _cx| {
this.context_server_tool_ids
.insert(server_id, tool_ids);
})
.log_err();
}
}
}
})
.detach();
}
}
context_server::manager::Event::ServerStopped { server_id } => {
if let Some(slash_command_ids) =
self.context_server_slash_command_ids.remove(server_id)
{
slash_command_working_set.remove(&slash_command_ids);
}
if let Some(tool_ids) = self.context_server_tool_ids.remove(server_id) {
tool_working_set.remove(&tool_ids);
}
}
}
}
}

View File

@@ -1,7 +1,7 @@
use crate::{
assistant_settings::AssistantSettings, humanize_token_count, prompts::PromptBuilder,
AssistantPanel, AssistantPanelEvent, CharOperation, CycleNextInlineAssist,
CyclePreviousInlineAssist, LineDiff, LineOperation, ModelSelector, StreamingDiff,
CyclePreviousInlineAssist, LineDiff, LineOperation, RequestType, StreamingDiff,
};
use anyhow::{anyhow, Context as _, Result};
use client::{telemetry::Telemetry, ErrorExt};
@@ -9,7 +9,7 @@ use collections::{hash_map, HashMap, HashSet, VecDeque};
use editor::{
actions::{MoveDown, MoveUp, SelectAll},
display_map::{
BlockContext, BlockDisposition, BlockProperties, BlockStyle, CustomBlockId, RenderBlock,
BlockContext, BlockPlacement, BlockProperties, BlockStyle, CustomBlockId, RenderBlock,
ToDisplayPoint,
},
Anchor, AnchorRangeExt, CodeActionProvider, Editor, EditorElement, EditorEvent, EditorMode,
@@ -21,24 +21,25 @@ use fs::Fs;
use futures::{
channel::mpsc,
future::{BoxFuture, LocalBoxFuture},
join,
stream::{self, BoxStream},
SinkExt, Stream, StreamExt,
join, SinkExt, Stream, StreamExt,
};
use gpui::{
anchored, deferred, point, AnyElement, AppContext, ClickEvent, EventEmitter, FocusHandle,
FocusableView, FontWeight, Global, HighlightStyle, Model, ModelContext, Subscription, Task,
TextStyle, UpdateGlobal, View, ViewContext, WeakView, WindowContext,
anchored, deferred, point, AnyElement, AppContext, ClickEvent, CursorStyle, EventEmitter,
FocusHandle, FocusableView, FontWeight, Global, HighlightStyle, Model, ModelContext,
Subscription, Task, TextStyle, UpdateGlobal, View, ViewContext, WeakView, WindowContext,
};
use language::{Buffer, IndentKind, Point, Selection, TransactionId};
use language_model::{
LanguageModel, LanguageModelRegistry, LanguageModelRequest, LanguageModelRequestMessage, Role,
LanguageModel, LanguageModelRegistry, LanguageModelRequest, LanguageModelRequestMessage,
LanguageModelTextStream, Role,
};
use language_model_selector::{LanguageModelSelector, LanguageModelSelectorPopoverMenu};
use language_models::report_assistant_event;
use multi_buffer::MultiBufferRow;
use parking_lot::Mutex;
use project::{CodeAction, ProjectTransaction};
use rope::Rope;
use settings::{Settings, SettingsStore};
use settings::{update_settings_file, Settings, SettingsStore};
use smol::future::FutureExt;
use std::{
cmp,
@@ -54,7 +55,9 @@ use telemetry_events::{AssistantEvent, AssistantKind, AssistantPhase};
use terminal_view::terminal_panel::TerminalPanel;
use text::{OffsetRangeExt, ToPoint as _};
use theme::ThemeSettings;
use ui::{prelude::*, CheckboxWithLabel, IconButtonShape, Popover, Tooltip};
use ui::{
prelude::*, text_for_action, CheckboxWithLabel, IconButtonShape, KeyBinding, Popover, Tooltip,
};
use util::{RangeExt, ResultExt};
use workspace::{notifications::NotificationId, ItemHandle, Toast, Workspace};
@@ -85,7 +88,7 @@ pub struct InlineAssistant {
confirmed_assists: HashMap<InlineAssistId, Model<CodegenAlternative>>,
prompt_history: VecDeque<String>,
prompt_builder: Arc<PromptBuilder>,
telemetry: Option<Arc<Telemetry>>,
telemetry: Arc<Telemetry>,
fs: Arc<dyn Fs>,
}
@@ -106,7 +109,7 @@ impl InlineAssistant {
confirmed_assists: HashMap::default(),
prompt_history: VecDeque::default(),
prompt_builder,
telemetry: Some(telemetry),
telemetry,
fs,
}
}
@@ -189,11 +192,16 @@ impl InlineAssistant {
initial_prompt: Option<String>,
cx: &mut WindowContext,
) {
let snapshot = editor.read(cx).buffer().read(cx).snapshot(cx);
let (snapshot, initial_selections) = editor.update(cx, |editor, cx| {
(
editor.buffer().read(cx).snapshot(cx),
editor.selections.all::<Point>(cx),
)
});
let mut selections = Vec::<Selection<Point>>::new();
let mut newest_selection = None;
for mut selection in editor.read(cx).selections.all::<Point>(cx) {
for mut selection in initial_selections {
if selection.end > selection.start {
selection.start.column = 0;
// If the selection ends at the start of the line, we don't want to include it.
@@ -236,19 +244,18 @@ impl InlineAssistant {
};
codegen_ranges.push(start..end);
if let Some(telemetry) = self.telemetry.as_ref() {
if let Some(model) = LanguageModelRegistry::read_global(cx).active_model() {
telemetry.report_assistant_event(AssistantEvent {
conversation_id: None,
kind: AssistantKind::Inline,
phase: AssistantPhase::Invoked,
model: model.telemetry_id(),
model_provider: model.provider_id().to_string(),
response_latency: None,
error_message: None,
language_name: buffer.language().map(|language| language.name().to_proto()),
});
}
if let Some(model) = LanguageModelRegistry::read_global(cx).active_model() {
self.telemetry.report_assistant_event(AssistantEvent {
conversation_id: None,
kind: AssistantKind::Inline,
phase: AssistantPhase::Invoked,
message_id: None,
model: model.telemetry_id(),
model_provider: model.provider_id().to_string(),
response_latency: None,
error_message: None,
language_name: buffer.language().map(|language| language.name().to_proto()),
});
}
}
@@ -446,17 +453,16 @@ impl InlineAssistant {
let assist_blocks = vec![
BlockProperties {
style: BlockStyle::Sticky,
position: range.start,
placement: BlockPlacement::Above(range.start),
height: prompt_editor_height,
render: build_assist_editor_renderer(prompt_editor),
disposition: BlockDisposition::Above,
priority: 0,
},
BlockProperties {
style: BlockStyle::Sticky,
position: range.end,
placement: BlockPlacement::Below(range.end),
height: 0,
render: Box::new(|cx| {
render: Arc::new(|cx| {
v_flex()
.h_full()
.w_full()
@@ -464,7 +470,6 @@ impl InlineAssistant {
.border_color(cx.theme().status().info_border)
.into_any_element()
}),
disposition: BlockDisposition::Below,
priority: 0,
},
];
@@ -568,10 +573,13 @@ impl InlineAssistant {
return;
};
let editor = editor.read(cx);
if editor.selections.count() == 1 {
let selection = editor.selections.newest::<usize>(cx);
let buffer = editor.buffer().read(cx).snapshot(cx);
if editor.read(cx).selections.count() == 1 {
let (selection, buffer) = editor.update(cx, |editor, cx| {
(
editor.selections.newest::<usize>(cx),
editor.buffer().read(cx).snapshot(cx),
)
});
for assist_id in &editor_assists.assist_ids {
let assist = &self.assists[assist_id];
let assist_range = assist.range.to_offset(&buffer);
@@ -596,10 +604,13 @@ impl InlineAssistant {
return;
};
let editor = editor.read(cx);
if editor.selections.count() == 1 {
let selection = editor.selections.newest::<usize>(cx);
let buffer = editor.buffer().read(cx).snapshot(cx);
if editor.read(cx).selections.count() == 1 {
let (selection, buffer) = editor.update(cx, |editor, cx| {
(
editor.selections.newest::<usize>(cx),
editor.buffer().read(cx).snapshot(cx),
)
});
let mut closest_assist_fallback = None;
for assist_id in &editor_assists.assist_ids {
let assist = &self.assists[assist_id];
@@ -745,33 +756,6 @@ impl InlineAssistant {
pub fn finish_assist(&mut self, assist_id: InlineAssistId, undo: bool, cx: &mut WindowContext) {
if let Some(assist) = self.assists.get(&assist_id) {
if let Some(telemetry) = self.telemetry.as_ref() {
if let Some(model) = LanguageModelRegistry::read_global(cx).active_model() {
let language_name = assist.editor.upgrade().and_then(|editor| {
let multibuffer = editor.read(cx).buffer().read(cx);
let ranges = multibuffer.range_to_buffer_ranges(assist.range.clone(), cx);
ranges
.first()
.and_then(|(buffer, _, _)| buffer.read(cx).language())
.map(|language| language.name())
});
telemetry.report_assistant_event(AssistantEvent {
conversation_id: None,
kind: AssistantKind::Inline,
phase: if undo {
AssistantPhase::Rejected
} else {
AssistantPhase::Accepted
},
model: model.telemetry_id(),
model_provider: model.provider_id().to_string(),
response_latency: None,
error_message: None,
language_name: language_name.map(|name| name.to_proto()),
});
}
}
let assist_group_id = assist.group_id;
if self.assist_groups[&assist_group_id].linked {
for assist_id in self.unlink_assist_group(assist_group_id, cx) {
@@ -806,12 +790,45 @@ impl InlineAssistant {
}
}
let active_alternative = assist.codegen.read(cx).active_alternative().clone();
let message_id = active_alternative.read(cx).message_id.clone();
if let Some(model) = LanguageModelRegistry::read_global(cx).active_model() {
let language_name = assist.editor.upgrade().and_then(|editor| {
let multibuffer = editor.read(cx).buffer().read(cx);
let ranges = multibuffer.range_to_buffer_ranges(assist.range.clone(), cx);
ranges
.first()
.and_then(|(buffer, _, _)| buffer.read(cx).language())
.map(|language| language.name())
});
report_assistant_event(
AssistantEvent {
conversation_id: None,
kind: AssistantKind::Inline,
message_id,
phase: if undo {
AssistantPhase::Rejected
} else {
AssistantPhase::Accepted
},
model: model.telemetry_id(),
model_provider: model.provider_id().to_string(),
response_latency: None,
error_message: None,
language_name: language_name.map(|name| name.to_proto()),
},
Some(self.telemetry.clone()),
cx.http_client(),
model.api_key(cx),
cx.background_executor(),
);
}
if undo {
assist.codegen.update(cx, |codegen, cx| codegen.undo(cx));
} else {
let confirmed_alternative = assist.codegen.read(cx).active_alternative().clone();
self.confirmed_assists
.insert(assist_id, confirmed_alternative);
self.confirmed_assists.insert(assist_id, active_alternative);
}
}
}
@@ -1179,11 +1196,12 @@ impl InlineAssistant {
let height =
deleted_lines_editor.update(cx, |editor, cx| editor.max_point(cx).row().0 + 1);
new_blocks.push(BlockProperties {
position: new_row,
placement: BlockPlacement::Above(new_row),
height,
style: BlockStyle::Flex,
render: Box::new(move |cx| {
render: Arc::new(move |cx| {
div()
.block_mouse_down()
.bg(cx.theme().status().deleted_background)
.size_full()
.h(height as f32 * cx.line_height())
@@ -1191,7 +1209,6 @@ impl InlineAssistant {
.child(deleted_lines_editor.clone())
.into_any_element()
}),
disposition: BlockDisposition::Above,
priority: 0,
});
}
@@ -1303,7 +1320,7 @@ impl InlineAssistGroup {
fn build_assist_editor_renderer(editor: &View<PromptEditor>) -> RenderBlock {
let editor = editor.clone();
Box::new(move |cx: &mut BlockContext| {
Arc::new(move |cx: &mut BlockContext| {
*editor.read(cx).gutter_dimensions.lock() = *cx.gutter_dimensions;
editor.clone().into_any_element()
})
@@ -1341,8 +1358,8 @@ enum PromptEditorEvent {
struct PromptEditor {
id: InlineAssistId,
fs: Arc<dyn Fs>,
editor: View<Editor>,
language_model_selector: View<LanguageModelSelector>,
edited_since_done: bool,
gutter_dimensions: Arc<Mutex<GutterDimensions>>,
prompt_history: VecDeque<String>,
@@ -1466,6 +1483,8 @@ impl Render for PromptEditor {
h_flex()
.key_context("PromptEditor")
.bg(cx.theme().colors().editor_background)
.block_mouse_down()
.cursor(CursorStyle::Arrow)
.border_y_1()
.border_color(cx.theme().status().info_border)
.size_full()
@@ -1481,34 +1500,27 @@ impl Render for PromptEditor {
.w(gutter_dimensions.full_width() + (gutter_dimensions.margin / 2.0))
.justify_center()
.gap_2()
.child(
ModelSelector::new(
self.fs.clone(),
IconButton::new("context", IconName::SettingsAlt)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
.icon_color(Color::Muted)
.tooltip(move |cx| {
Tooltip::with_meta(
format!(
"Using {}",
LanguageModelRegistry::read_global(cx)
.active_model()
.map(|model| model.name().0)
.unwrap_or_else(|| "No model selected".into()),
),
None,
"Change Model",
cx,
)
}),
)
.with_info_text(
"Inline edits use context\n\
from the currently selected\n\
assistant panel tab.",
),
)
.child(LanguageModelSelectorPopoverMenu::new(
self.language_model_selector.clone(),
IconButton::new("context", IconName::SettingsAlt)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
.icon_color(Color::Muted)
.tooltip(move |cx| {
Tooltip::with_meta(
format!(
"Using {}",
LanguageModelRegistry::read_global(cx)
.active_model()
.map(|model| model.name().0)
.unwrap_or_else(|| "No model selected".into()),
),
None,
"Change Model",
cx,
)
}),
))
.map(|el| {
let CodegenStatus::Error(error) = self.codegen.read(cx).status(cx) else {
return el;
@@ -1522,7 +1534,7 @@ impl Render for PromptEditor {
v_flex()
.child(
IconButton::new("rate-limit-error", IconName::XCircle)
.selected(self.show_rate_limit_notice)
.toggle_state(self.show_rate_limit_notice)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
.on_click(cx.listener(Self::toggle_rate_limit_notice)),
@@ -1599,7 +1611,7 @@ impl PromptEditor {
// always show the cursor (even when it isn't focused) because
// typing in one will make what you typed appear in all of them.
editor.set_show_cursor_when_unfocused(true, cx);
editor.set_placeholder_text("Add a prompt…", cx);
editor.set_placeholder_text(Self::placeholder_text(codegen.read(cx), cx), cx);
editor
});
@@ -1614,6 +1626,19 @@ impl PromptEditor {
let mut this = Self {
id,
editor: prompt_editor,
language_model_selector: cx.new_view(|cx| {
let fs = fs.clone();
LanguageModelSelector::new(
move |model, cx| {
update_settings_file::<AssistantSettings>(
fs.clone(),
cx,
move |settings, _| settings.set_model(model.clone()),
);
},
cx,
)
}),
edited_since_done: false,
gutter_dimensions,
prompt_history,
@@ -1622,7 +1647,6 @@ impl PromptEditor {
_codegen_subscription: cx.observe(&codegen, Self::handle_codegen_changed),
editor_subscriptions: Vec::new(),
codegen,
fs,
pending_token_count: Task::ready(Ok(())),
token_counts: None,
_token_count_subscriptions: token_count_subscriptions,
@@ -1656,6 +1680,7 @@ impl PromptEditor {
self.editor = cx.new_view(|cx| {
let mut editor = Editor::auto_height(Self::MAX_LINES as usize, cx);
editor.set_soft_wrap_mode(language::language_settings::SoftWrap::EditorWidth, cx);
editor.set_placeholder_text(Self::placeholder_text(self.codegen.read(cx), cx), cx);
editor.set_placeholder_text("Add a prompt…", cx);
editor.set_text(prompt, cx);
if focus {
@@ -1666,6 +1691,20 @@ impl PromptEditor {
self.subscribe_to_editor(cx);
}
fn placeholder_text(codegen: &Codegen, cx: &WindowContext) -> String {
let context_keybinding = text_for_action(&crate::ToggleFocus, cx)
.map(|keybinding| format!("{keybinding} for context"))
.unwrap_or_default();
let action = if codegen.is_insertion {
"Generate"
} else {
"Transform"
};
format!("{action}{context_keybinding} • ↓↑ for history")
}
fn prompt(&self, cx: &AppContext) -> String {
self.editor.read(cx).text(cx)
}
@@ -1728,6 +1767,20 @@ impl PromptEditor {
) {
match event {
EditorEvent::Edited { .. } => {
if let Some(workspace) = cx.window_handle().downcast::<Workspace>() {
workspace
.update(cx, |workspace, cx| {
let is_via_ssh = workspace
.project()
.update(cx, |project, _| project.is_via_ssh());
workspace
.client()
.telemetry()
.log_edit_event("inline assist", is_via_ssh);
})
.log_err();
}
let prompt = self.editor.read(cx).text(cx);
if self
.prompt_history_ix
@@ -1870,21 +1923,58 @@ impl PromptEditor {
let codegen = self.codegen.read(cx);
let disabled = matches!(codegen.status(cx), CodegenStatus::Idle);
let model_registry = LanguageModelRegistry::read_global(cx);
let default_model = model_registry.active_model();
let alternative_models = model_registry.inline_alternative_models();
let get_model_name = |index: usize| -> String {
let name = |model: &Arc<dyn LanguageModel>| model.name().0.to_string();
match index {
0 => default_model.as_ref().map_or_else(String::new, name),
index if index <= alternative_models.len() => alternative_models
.get(index - 1)
.map_or_else(String::new, name),
_ => String::new(),
}
};
let total_models = alternative_models.len() + 1;
if total_models <= 1 {
return div().into_any_element();
}
let current_index = codegen.active_alternative;
let prev_index = (current_index + total_models - 1) % total_models;
let next_index = (current_index + 1) % total_models;
let prev_model_name = get_model_name(prev_index);
let next_model_name = get_model_name(next_index);
h_flex()
.child(
IconButton::new("previous", IconName::ChevronLeft)
.icon_color(Color::Muted)
.disabled(disabled)
.disabled(disabled || current_index == 0)
.shape(IconButtonShape::Square)
.tooltip({
let focus_handle = self.editor.focus_handle(cx);
move |cx| {
Tooltip::for_action_in(
"Previous Alternative",
&CyclePreviousInlineAssist,
&focus_handle,
cx,
)
cx.new_view(|cx| {
let mut tooltip = Tooltip::new("Previous Alternative").key_binding(
KeyBinding::for_action_in(
&CyclePreviousInlineAssist,
&focus_handle,
cx,
),
);
if !disabled && current_index != 0 {
tooltip = tooltip.meta(prev_model_name.clone());
}
tooltip
})
.into()
}
})
.on_click(cx.listener(|this, _, cx| {
@@ -1908,17 +1998,25 @@ impl PromptEditor {
.child(
IconButton::new("next", IconName::ChevronRight)
.icon_color(Color::Muted)
.disabled(disabled)
.disabled(disabled || current_index == total_models - 1)
.shape(IconButtonShape::Square)
.tooltip({
let focus_handle = self.editor.focus_handle(cx);
move |cx| {
Tooltip::for_action_in(
"Next Alternative",
&CycleNextInlineAssist,
&focus_handle,
cx,
)
cx.new_view(|cx| {
let mut tooltip = Tooltip::new("Next Alternative").key_binding(
KeyBinding::for_action_in(
&CycleNextInlineAssist,
&focus_handle,
cx,
),
);
if !disabled && current_index != total_models - 1 {
tooltip = tooltip.meta(next_model_name.clone());
}
tooltip
})
.into()
}
})
.on_click(cx.listener(|this, _, cx| {
@@ -2035,15 +2133,15 @@ impl PromptEditor {
"dont-show-again",
Label::new("Don't show again"),
if dismissed_rate_limit_notice() {
ui::Selection::Selected
ui::ToggleState::Selected
} else {
ui::Selection::Unselected
ui::ToggleState::Unselected
},
|selection, cx| {
let is_dismissed = match selection {
ui::Selection::Unselected => false,
ui::Selection::Indeterminate => return,
ui::Selection::Selected => true,
ui::ToggleState::Unselected => false,
ui::ToggleState::Indeterminate => return,
ui::ToggleState::Selected => true,
};
set_rate_limit_notice_dismissed(is_dismissed, cx)
@@ -2222,7 +2320,7 @@ impl InlineAssist {
.read(cx)
.active_context(cx)?
.read(cx)
.to_completion_request(cx),
.to_completion_request(RequestType::Chat, cx),
)
} else {
None
@@ -2261,8 +2359,9 @@ pub struct Codegen {
buffer: Model<MultiBuffer>,
range: Range<Anchor>,
initial_transaction_id: Option<TransactionId>,
telemetry: Option<Arc<Telemetry>>,
telemetry: Arc<Telemetry>,
builder: Arc<PromptBuilder>,
is_insertion: bool,
}
impl Codegen {
@@ -2270,7 +2369,7 @@ impl Codegen {
buffer: Model<MultiBuffer>,
range: Range<Anchor>,
initial_transaction_id: Option<TransactionId>,
telemetry: Option<Arc<Telemetry>>,
telemetry: Arc<Telemetry>,
builder: Arc<PromptBuilder>,
cx: &mut ModelContext<Self>,
) -> Self {
@@ -2279,12 +2378,13 @@ impl Codegen {
buffer.clone(),
range.clone(),
false,
telemetry.clone(),
Some(telemetry.clone()),
builder.clone(),
cx,
)
});
let mut this = Self {
is_insertion: range.to_offset(&buffer.read(cx).snapshot(cx)).is_empty(),
alternatives: vec![codegen],
active_alternative: 0,
seen_alternatives: HashSet::default(),
@@ -2369,7 +2469,7 @@ impl Codegen {
self.buffer.clone(),
self.range.clone(),
false,
self.telemetry.clone(),
Some(self.telemetry.clone()),
self.builder.clone(),
cx,
)
@@ -2472,6 +2572,8 @@ pub struct CodegenAlternative {
line_operations: Vec<LineOperation>,
request: Option<LanguageModelRequest>,
elapsed_time: Option<f64>,
completion: Option<String>,
message_id: Option<String>,
}
enum CodegenStatus {
@@ -2530,6 +2632,7 @@ impl CodegenAlternative {
buffer: buffer.clone(),
old_buffer,
edit_position: None,
message_id: None,
snapshot,
last_equal_ranges: Default::default(),
transformation_transaction_id: None,
@@ -2545,6 +2648,7 @@ impl CodegenAlternative {
range,
request: None,
elapsed_time: None,
completion: None,
}
}
@@ -2634,20 +2738,20 @@ impl CodegenAlternative {
self.edit_position = Some(self.range.start.bias_right(&self.snapshot));
let api_key = model.api_key(cx);
let telemetry_id = model.telemetry_id();
let provider_id = model.provider_id();
let chunks: LocalBoxFuture<Result<BoxStream<Result<String>>>> =
let stream: LocalBoxFuture<Result<LanguageModelTextStream>> =
if user_prompt.trim().to_lowercase() == "delete" {
async { Ok(stream::empty().boxed()) }.boxed_local()
async { Ok(LanguageModelTextStream::default()) }.boxed_local()
} else {
let request = self.build_request(user_prompt, assistant_panel_context, cx)?;
self.request = Some(request.clone());
let chunks = cx
.spawn(|_, cx| async move { model.stream_completion_text(request, &cx).await });
async move { Ok(chunks.await?.boxed()) }.boxed_local()
cx.spawn(|_, cx| async move { model.stream_completion_text(request, &cx).await })
.boxed_local()
};
self.handle_stream(telemetry_id, provider_id.to_string(), chunks, cx);
self.handle_stream(telemetry_id, provider_id.to_string(), api_key, stream, cx);
Ok(())
}
@@ -2686,7 +2790,7 @@ impl CodegenAlternative {
let prompt = self
.builder
.generate_content_prompt(user_prompt, language_name, buffer, range)
.generate_inline_transformation_prompt(user_prompt, language_name, buffer, range)
.map_err(|e| anyhow::anyhow!("Failed to generate content prompt: {}", e))?;
let mut messages = Vec::new();
@@ -2712,7 +2816,8 @@ impl CodegenAlternative {
&mut self,
model_telemetry_id: String,
model_provider_id: String,
stream: impl 'static + Future<Output = Result<BoxStream<'static, Result<String>>>>,
model_api_key: Option<String>,
stream: impl 'static + Future<Output = Result<LanguageModelTextStream>>,
cx: &mut ModelContext<Self>,
) {
let start_time = Instant::now();
@@ -2742,6 +2847,7 @@ impl CodegenAlternative {
}
}
let http_client = cx.http_client().clone();
let telemetry = self.telemetry.clone();
let language_name = {
let multibuffer = self.buffer.read(cx);
@@ -2755,17 +2861,26 @@ impl CodegenAlternative {
self.diff = Diff::default();
self.status = CodegenStatus::Pending;
let mut edit_start = self.range.start.to_offset(&snapshot);
let completion = Arc::new(Mutex::new(String::new()));
let completion_clone = completion.clone();
self.generation = cx.spawn(|codegen, mut cx| {
async move {
let chunks = stream.await;
let stream = stream.await;
let message_id = stream
.as_ref()
.ok()
.and_then(|stream| stream.message_id.clone());
let generate = async {
let (mut diff_tx, mut diff_rx) = mpsc::channel(1);
let executor = cx.background_executor().clone();
let message_id = message_id.clone();
let line_based_stream_diff: Task<anyhow::Result<()>> =
cx.background_executor().spawn(async move {
let mut response_latency = None;
let request_start = Instant::now();
let diff = async {
let chunks = StripInvalidSpans::new(chunks?);
let chunks = StripInvalidSpans::new(stream?.stream);
futures::pin_mut!(chunks);
let mut diff = StreamingDiff::new(selected_text.to_string());
let mut line_diff = LineDiff::default();
@@ -2780,6 +2895,7 @@ impl CodegenAlternative {
response_latency = Some(request_start.elapsed());
}
let chunk = chunk?;
completion_clone.lock().push_str(&chunk);
let mut lines = chunk.split('\n').peekable();
while let Some(line) = lines.next() {
@@ -2861,9 +2977,10 @@ impl CodegenAlternative {
let error_message =
result.as_ref().err().map(|error| error.to_string());
if let Some(telemetry) = telemetry {
telemetry.report_assistant_event(AssistantEvent {
report_assistant_event(
AssistantEvent {
conversation_id: None,
message_id,
kind: AssistantKind::Inline,
phase: AssistantPhase::Response,
model: model_telemetry_id,
@@ -2871,8 +2988,12 @@ impl CodegenAlternative {
response_latency,
error_message,
language_name: language_name.map(|name| name.to_proto()),
});
}
},
telemetry,
http_client,
model_api_key,
&executor,
);
result?;
Ok(())
@@ -2936,6 +3057,7 @@ impl CodegenAlternative {
codegen
.update(&mut cx, |this, cx| {
this.message_id = message_id;
this.last_equal_ranges.clear();
if let Err(error) = result {
this.status = CodegenStatus::Error(error);
@@ -2943,6 +3065,7 @@ impl CodegenAlternative {
this.status = CodegenStatus::Done;
}
this.elapsed_time = Some(elapsed_time);
this.completion = Some(completion.lock().clone());
cx.emit(CodegenEvent::Finished);
cx.notify();
})
@@ -3487,15 +3610,7 @@ mod tests {
)
});
let (chunks_tx, chunks_rx) = mpsc::unbounded();
codegen.update(cx, |codegen, cx| {
codegen.handle_stream(
String::new(),
String::new(),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
let chunks_tx = simulate_response_stream(codegen.clone(), cx);
let mut new_text = concat!(
" let mut x = 0;\n",
@@ -3559,15 +3674,7 @@ mod tests {
)
});
let (chunks_tx, chunks_rx) = mpsc::unbounded();
codegen.update(cx, |codegen, cx| {
codegen.handle_stream(
String::new(),
String::new(),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
let chunks_tx = simulate_response_stream(codegen.clone(), cx);
cx.background_executor.run_until_parked();
@@ -3634,15 +3741,7 @@ mod tests {
)
});
let (chunks_tx, chunks_rx) = mpsc::unbounded();
codegen.update(cx, |codegen, cx| {
codegen.handle_stream(
String::new(),
String::new(),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
let chunks_tx = simulate_response_stream(codegen.clone(), cx);
cx.background_executor.run_until_parked();
@@ -3708,16 +3807,7 @@ mod tests {
)
});
let (chunks_tx, chunks_rx) = mpsc::unbounded();
codegen.update(cx, |codegen, cx| {
codegen.handle_stream(
String::new(),
String::new(),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
let chunks_tx = simulate_response_stream(codegen.clone(), cx);
let new_text = concat!(
"func main() {\n",
"\tx := 0\n",
@@ -3772,16 +3862,7 @@ mod tests {
)
});
let (chunks_tx, chunks_rx) = mpsc::unbounded();
codegen.update(cx, |codegen, cx| {
codegen.handle_stream(
String::new(),
String::new(),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
let chunks_tx = simulate_response_stream(codegen.clone(), cx);
chunks_tx
.unbounded_send("let mut x = 0;\nx += 1;".to_string())
.unwrap();
@@ -3855,6 +3936,26 @@ mod tests {
}
}
fn simulate_response_stream(
codegen: Model<CodegenAlternative>,
cx: &mut TestAppContext,
) -> mpsc::UnboundedSender<String> {
let (chunks_tx, chunks_rx) = mpsc::unbounded();
codegen.update(cx, |codegen, cx| {
codegen.handle_stream(
String::new(),
String::new(),
None,
future::ready(Ok(LanguageModelTextStream {
message_id: None,
stream: chunks_rx.map(Ok).boxed(),
})),
cx,
);
});
chunks_tx
}
fn rust_lang() -> Language {
Language::new(
LanguageConfig {

View File

@@ -33,21 +33,21 @@ pub enum AssistantEditKind {
Update {
old_text: String,
new_text: String,
description: String,
description: Option<String>,
},
Create {
new_text: String,
description: String,
description: Option<String>,
},
InsertBefore {
old_text: String,
new_text: String,
description: String,
description: Option<String>,
},
InsertAfter {
old_text: String,
new_text: String,
description: String,
description: Option<String>,
},
Delete {
old_text: String,
@@ -86,19 +86,37 @@ enum SearchDirection {
Diagonal,
}
// A measure of the currently quality of an in-progress fuzzy search.
//
// Uses 60 bits to store a numeric cost, and 4 bits to store the preceding
// operation in the search.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
struct SearchState {
score: u32,
cost: u32,
direction: SearchDirection,
}
impl SearchState {
fn new(score: u32, direction: SearchDirection) -> Self {
Self { score, direction }
fn new(cost: u32, direction: SearchDirection) -> Self {
Self { cost, direction }
}
}
struct SearchMatrix {
cols: usize,
data: Vec<SearchState>,
}
impl SearchMatrix {
fn new(rows: usize, cols: usize) -> Self {
SearchMatrix {
cols,
data: vec![SearchState::new(0, SearchDirection::Diagonal); rows * cols],
}
}
fn get(&self, row: usize, col: usize) -> SearchState {
self.data[row * self.cols + col]
}
fn set(&mut self, row: usize, col: usize, cost: SearchState) {
self.data[row * self.cols + col] = cost;
}
}
@@ -187,23 +205,23 @@ impl AssistantEdit {
"update" => AssistantEditKind::Update {
old_text: old_text.ok_or_else(|| anyhow!("missing old_text"))?,
new_text: new_text.ok_or_else(|| anyhow!("missing new_text"))?,
description: description.ok_or_else(|| anyhow!("missing description"))?,
description,
},
"insert_before" => AssistantEditKind::InsertBefore {
old_text: old_text.ok_or_else(|| anyhow!("missing old_text"))?,
new_text: new_text.ok_or_else(|| anyhow!("missing new_text"))?,
description: description.ok_or_else(|| anyhow!("missing description"))?,
description,
},
"insert_after" => AssistantEditKind::InsertAfter {
old_text: old_text.ok_or_else(|| anyhow!("missing old_text"))?,
new_text: new_text.ok_or_else(|| anyhow!("missing new_text"))?,
description: description.ok_or_else(|| anyhow!("missing description"))?,
description,
},
"delete" => AssistantEditKind::Delete {
old_text: old_text.ok_or_else(|| anyhow!("missing old_text"))?,
},
"create" => AssistantEditKind::Create {
description: description.ok_or_else(|| anyhow!("missing description"))?,
description,
new_text: new_text.ok_or_else(|| anyhow!("missing new_text"))?,
},
_ => Err(anyhow!("unknown operation {operation:?}"))?,
@@ -264,7 +282,7 @@ impl AssistantEditKind {
ResolvedEdit {
range,
new_text,
description: Some(description),
description,
}
}
Self::Create {
@@ -272,7 +290,7 @@ impl AssistantEditKind {
description,
} => ResolvedEdit {
range: text::Anchor::MIN..text::Anchor::MAX,
description: Some(description),
description,
new_text,
},
Self::InsertBefore {
@@ -285,7 +303,7 @@ impl AssistantEditKind {
ResolvedEdit {
range: range.start..range.start,
new_text,
description: Some(description),
description,
}
}
Self::InsertAfter {
@@ -298,7 +316,7 @@ impl AssistantEditKind {
ResolvedEdit {
range: range.end..range.end,
new_text,
description: Some(description),
description,
}
}
Self::Delete { old_text } => {
@@ -314,44 +332,29 @@ impl AssistantEditKind {
fn resolve_location(buffer: &text::BufferSnapshot, search_query: &str) -> Range<text::Anchor> {
const INSERTION_COST: u32 = 3;
const DELETION_COST: u32 = 10;
const WHITESPACE_INSERTION_COST: u32 = 1;
const DELETION_COST: u32 = 3;
const WHITESPACE_DELETION_COST: u32 = 1;
const EQUALITY_BONUS: u32 = 5;
struct Matrix {
cols: usize,
data: Vec<SearchState>,
}
impl Matrix {
fn new(rows: usize, cols: usize) -> Self {
Matrix {
cols,
data: vec![SearchState::new(0, SearchDirection::Diagonal); rows * cols],
}
}
fn get(&self, row: usize, col: usize) -> SearchState {
self.data[row * self.cols + col]
}
fn set(&mut self, row: usize, col: usize, cost: SearchState) {
self.data[row * self.cols + col] = cost;
}
}
let buffer_len = buffer.len();
let query_len = search_query.len();
let mut matrix = Matrix::new(query_len + 1, buffer_len + 1);
let mut matrix = SearchMatrix::new(query_len + 1, buffer_len + 1);
let mut leading_deletion_cost = 0_u32;
for (row, query_byte) in search_query.bytes().enumerate() {
let deletion_cost = if query_byte.is_ascii_whitespace() {
WHITESPACE_DELETION_COST
} else {
DELETION_COST
};
leading_deletion_cost = leading_deletion_cost.saturating_add(deletion_cost);
matrix.set(
row + 1,
0,
SearchState::new(leading_deletion_cost, SearchDirection::Diagonal),
);
for (col, buffer_byte) in buffer.bytes_in_range(0..buffer.len()).flatten().enumerate() {
let deletion_cost = if query_byte.is_ascii_whitespace() {
WHITESPACE_DELETION_COST
} else {
DELETION_COST
};
let insertion_cost = if buffer_byte.is_ascii_whitespace() {
WHITESPACE_INSERTION_COST
} else {
@@ -359,38 +362,35 @@ impl AssistantEditKind {
};
let up = SearchState::new(
matrix.get(row, col + 1).score.saturating_sub(deletion_cost),
matrix.get(row, col + 1).cost.saturating_add(deletion_cost),
SearchDirection::Up,
);
let left = SearchState::new(
matrix
.get(row + 1, col)
.score
.saturating_sub(insertion_cost),
matrix.get(row + 1, col).cost.saturating_add(insertion_cost),
SearchDirection::Left,
);
let diagonal = SearchState::new(
if query_byte == *buffer_byte {
matrix.get(row, col).score.saturating_add(EQUALITY_BONUS)
matrix.get(row, col).cost
} else {
matrix
.get(row, col)
.score
.saturating_sub(deletion_cost + insertion_cost)
.cost
.saturating_add(deletion_cost + insertion_cost)
},
SearchDirection::Diagonal,
);
matrix.set(row + 1, col + 1, up.max(left).max(diagonal));
matrix.set(row + 1, col + 1, up.min(left).min(diagonal));
}
}
// Traceback to find the best match
let mut best_buffer_end = buffer_len;
let mut best_score = 0;
let mut best_cost = u32::MAX;
for col in 1..=buffer_len {
let score = matrix.get(query_len, col).score;
if score > best_score {
best_score = score;
let cost = matrix.get(query_len, col).cost;
if cost < best_cost {
best_cost = cost;
best_buffer_end = col;
}
}
@@ -560,89 +560,84 @@ mod tests {
language_settings::AllLanguageSettings, Language, LanguageConfig, LanguageMatcher,
};
use settings::SettingsStore;
use text::{OffsetRangeExt, Point};
use ui::BorrowAppContext;
use unindent::Unindent as _;
use util::test::{generate_marked_text, marked_text_ranges};
#[gpui::test]
fn test_resolve_location(cx: &mut AppContext) {
{
let buffer = cx.new_model(|cx| {
Buffer::local(
concat!(
" Lorem\n",
" ipsum\n",
" dolor sit amet\n",
" consecteur",
),
cx,
)
});
let snapshot = buffer.read(cx).snapshot();
assert_eq!(
AssistantEditKind::resolve_location(&snapshot, "ipsum\ndolor").to_point(&snapshot),
Point::new(1, 0)..Point::new(2, 18)
);
}
assert_location_resolution(
concat!(
" Lorem\n",
"« ipsum\n",
" dolor sit amet»\n",
" consecteur",
),
"ipsum\ndolor",
cx,
);
{
let buffer = cx.new_model(|cx| {
Buffer::local(
concat!(
"fn foo1(a: usize) -> usize {\n",
" 40\n",
"}\n",
"\n",
"fn foo2(b: usize) -> usize {\n",
" 42\n",
"}\n",
),
cx,
)
});
let snapshot = buffer.read(cx).snapshot();
assert_eq!(
AssistantEditKind::resolve_location(&snapshot, "fn foo1(b: usize) {\n40\n}")
.to_point(&snapshot),
Point::new(0, 0)..Point::new(2, 1)
);
}
assert_location_resolution(
&"
«fn foo1(a: usize) -> usize {
40
{
let buffer = cx.new_model(|cx| {
Buffer::local(
concat!(
"fn main() {\n",
" Foo\n",
" .bar()\n",
" .baz()\n",
" .qux()\n",
"}\n",
"\n",
"fn foo2(b: usize) -> usize {\n",
" 42\n",
"}\n",
),
cx,
)
});
let snapshot = buffer.read(cx).snapshot();
assert_eq!(
AssistantEditKind::resolve_location(&snapshot, "Foo.bar.baz.qux()")
.to_point(&snapshot),
Point::new(1, 0)..Point::new(4, 14)
);
}
fn foo2(b: usize) -> usize {
42
}
"
.unindent(),
"fn foo1(b: usize) {\n40\n}",
cx,
);
assert_location_resolution(
&"
fn main() {
« Foo
.bar()
.baz()
.qux()»
}
fn foo2(b: usize) -> usize {
42
}
"
.unindent(),
"Foo.bar.baz.qux()",
cx,
);
assert_location_resolution(
&"
class Something {
one() { return 1; }
« two() { return 2222; }
three() { return 333; }
four() { return 4444; }
five() { return 5555; }
six() { return 6666; }
» seven() { return 7; }
eight() { return 8; }
}
"
.unindent(),
&"
two() { return 2222; }
four() { return 4444; }
five() { return 5555; }
six() { return 6666; }
"
.unindent(),
cx,
);
}
#[gpui::test]
fn test_resolve_edits(cx: &mut AppContext) {
let settings_store = SettingsStore::test(cx);
cx.set_global(settings_store);
language::init(cx);
cx.update_global::<SettingsStore, _>(|settings, cx| {
settings.update_user_settings::<AllLanguageSettings>(cx, |_| {});
});
init_test(cx);
assert_edits(
"
@@ -675,7 +670,7 @@ mod tests {
last_name: String,
"
.unindent(),
description: "".into(),
description: None,
},
AssistantEditKind::Update {
old_text: "
@@ -690,7 +685,7 @@ mod tests {
}
"
.unindent(),
description: "".into(),
description: None,
},
],
"
@@ -734,7 +729,7 @@ mod tests {
qux();
}"
.unindent(),
description: "implement bar".into(),
description: Some("implement bar".into()),
},
AssistantEditKind::Update {
old_text: "
@@ -747,7 +742,7 @@ mod tests {
bar();
}"
.unindent(),
description: "call bar in foo".into(),
description: Some("call bar in foo".into()),
},
AssistantEditKind::InsertAfter {
old_text: "
@@ -762,7 +757,7 @@ mod tests {
}
"
.unindent(),
description: "implement qux".into(),
description: Some("implement qux".into()),
},
],
"
@@ -814,7 +809,7 @@ mod tests {
}
"
.unindent(),
description: "pick better number".into(),
description: None,
},
AssistantEditKind::Update {
old_text: "
@@ -829,7 +824,7 @@ mod tests {
}
"
.unindent(),
description: "pick better number".into(),
description: None,
},
AssistantEditKind::Update {
old_text: "
@@ -844,7 +839,7 @@ mod tests {
}
"
.unindent(),
description: "pick better number".into(),
description: None,
},
],
"
@@ -865,6 +860,69 @@ mod tests {
.unindent(),
cx,
);
assert_edits(
"
impl Person {
fn set_name(&mut self, name: String) {
self.name = name;
}
fn name(&self) -> String {
return self.name;
}
}
"
.unindent(),
vec![
AssistantEditKind::Update {
old_text: "self.name = name;".unindent(),
new_text: "self._name = name;".unindent(),
description: None,
},
AssistantEditKind::Update {
old_text: "return self.name;\n".unindent(),
new_text: "return self._name;\n".unindent(),
description: None,
},
],
"
impl Person {
fn set_name(&mut self, name: String) {
self._name = name;
}
fn name(&self) -> String {
return self._name;
}
}
"
.unindent(),
cx,
);
}
fn init_test(cx: &mut AppContext) {
let settings_store = SettingsStore::test(cx);
cx.set_global(settings_store);
language::init(cx);
cx.update_global::<SettingsStore, _>(|settings, cx| {
settings.update_user_settings::<AllLanguageSettings>(cx, |_| {});
});
}
#[track_caller]
fn assert_location_resolution(
text_with_expected_range: &str,
query: &str,
cx: &mut AppContext,
) {
let (text, _) = marked_text_ranges(text_with_expected_range, false);
let buffer = cx.new_model(|cx| Buffer::local(text.clone(), cx));
let snapshot = buffer.read(cx).snapshot();
let range = AssistantEditKind::resolve_location(&snapshot, query).to_offset(&snapshot);
let text_with_actual_range = generate_marked_text(&text, &[range], false);
pretty_assertions::assert_eq!(text_with_actual_range, text_with_expected_range);
}
#[track_caller]

View File

@@ -1,3 +1,4 @@
use crate::SlashCommandWorkingSet;
use crate::{slash_command::SlashCommandCompletionProvider, AssistantPanel, InlineAssistant};
use anyhow::{anyhow, Result};
use chrono::{DateTime, Utc};
@@ -10,8 +11,8 @@ use futures::{
use fuzzy::StringMatchCandidate;
use gpui::{
actions, point, size, transparent_black, Action, AppContext, BackgroundExecutor, Bounds,
EventEmitter, Global, HighlightStyle, PromptLevel, ReadGlobal, Subscription, Task, TextStyle,
TitlebarOptions, UpdateGlobal, View, WindowBounds, WindowHandle, WindowOptions,
EventEmitter, Global, PromptLevel, ReadGlobal, Subscription, Task, TextStyle, TitlebarOptions,
UpdateGlobal, View, WindowBounds, WindowHandle, WindowOptions,
};
use heed::{
types::{SerdeBincode, SerdeJson, Str},
@@ -231,13 +232,13 @@ impl PickerDelegate for PromptPickerDelegate {
let element = ListItem::new(ix)
.inset(true)
.spacing(ListItemSpacing::Sparse)
.selected(selected)
.toggle_state(selected)
.child(h_flex().h_5().line_height(relative(1.)).child(Label::new(
prompt.title.clone().unwrap_or("Untitled".into()),
)))
.end_slot::<IconButton>(default.then(|| {
IconButton::new("toggle-default-prompt", IconName::SparkleFilled)
.selected(true)
.toggle_state(true)
.icon_color(Color::Accent)
.shape(IconButtonShape::Square)
.tooltip(move |cx| Tooltip::text("Remove from Default Prompt", cx))
@@ -273,7 +274,7 @@ impl PickerDelegate for PromptPickerDelegate {
})
.child(
IconButton::new("toggle-default-prompt", IconName::Sparkle)
.selected(default)
.toggle_state(default)
.selected_icon(IconName::SparkleFilled)
.icon_color(if default { Color::Accent } else { Color::Muted })
.shape(IconButtonShape::Square)
@@ -522,7 +523,11 @@ impl PromptLibrary {
editor.set_use_modal_editing(false);
editor.set_current_line_highlight(Some(CurrentLineHighlight::None));
editor.set_completion_provider(Some(Box::new(
SlashCommandCompletionProvider::new(None, None),
SlashCommandCompletionProvider::new(
Arc::new(SlashCommandWorkingSet::default()),
None,
None,
),
)));
if focus {
editor.focus(cx);
@@ -825,7 +830,7 @@ impl PromptLibrary {
.overflow_x_hidden()
.child(
h_flex()
.p(Spacing::Small.rems(cx))
.p(DynamicSpacing::Base04.rems(cx))
.h_9()
.w_full()
.flex_none()
@@ -866,17 +871,17 @@ impl PromptLibrary {
.size_full()
.relative()
.overflow_hidden()
.pl(Spacing::XXLarge.rems(cx))
.pt(Spacing::Large.rems(cx))
.pl(DynamicSpacing::Base16.rems(cx))
.pt(DynamicSpacing::Base08.rems(cx))
.on_click(cx.listener(move |_, _, cx| {
cx.focus(&focus_handle);
}))
.child(
h_flex()
.group("active-editor-header")
.pr(Spacing::XXLarge.rems(cx))
.pt(Spacing::XSmall.rems(cx))
.pb(Spacing::Large.rems(cx))
.pr(DynamicSpacing::Base16.rems(cx))
.pt(DynamicSpacing::Base02.rems(cx))
.pb(DynamicSpacing::Base08.rems(cx))
.justify_between()
.child(
h_flex().gap_1().child(
@@ -923,10 +928,8 @@ impl PromptLibrary {
status: cx.theme().status().clone(),
inlay_hints_style:
editor::make_inlay_hints_style(cx),
suggestions_style: HighlightStyle {
color: Some(cx.theme().status().predictive),
..HighlightStyle::default()
},
inline_completion_styles:
editor::make_suggestion_styles(cx),
..EditorStyle::default()
},
)),
@@ -938,13 +941,13 @@ impl PromptLibrary {
.child(
h_flex()
.h_full()
.gap(Spacing::XXLarge.rems(cx))
.gap(DynamicSpacing::Base16.rems(cx))
.child(div()),
)
.child(
h_flex()
.h_full()
.gap(Spacing::XXLarge.rems(cx))
.gap(DynamicSpacing::Base16.rems(cx))
.children(prompt_editor.token_count.map(
|token_count| {
let token_count: SharedString =
@@ -1050,7 +1053,7 @@ impl PromptLibrary {
IconName::Sparkle,
)
.style(ButtonStyle::Transparent)
.selected(prompt_metadata.default)
.toggle_state(prompt_metadata.default)
.selected_icon(IconName::SparkleFilled)
.icon_color(if prompt_metadata.default {
Color::Accent

View File

@@ -149,7 +149,7 @@ impl PromptBuilder {
if file_path.to_string_lossy().ends_with(".hbs") {
if let Ok(content) = params.fs.load(&file_path).await {
let file_name = file_path.file_stem().unwrap().to_string_lossy();
log::info!("Registering prompt template override: {}", file_name);
log::debug!("Registering prompt template override: {}", file_name);
handlebars.lock().register_template_string(&file_name, content).log_err();
}
}
@@ -194,7 +194,7 @@ impl PromptBuilder {
for path in Assets.list("prompts")? {
if let Some(id) = path.split('/').last().and_then(|s| s.strip_suffix(".hbs")) {
if let Some(prompt) = Assets.load(path.as_ref()).log_err().flatten() {
log::info!("Registering built-in prompt template: {}", id);
log::debug!("Registering built-in prompt template: {}", id);
let prompt = String::from_utf8_lossy(prompt.as_ref());
handlebars.register_template_string(id, LineEnding::normalize_cow(prompt))?
}
@@ -204,7 +204,7 @@ impl PromptBuilder {
Ok(())
}
pub fn generate_content_prompt(
pub fn generate_inline_transformation_prompt(
&self,
user_prompt: String,
language_name: Option<&LanguageName>,
@@ -310,8 +310,8 @@ impl PromptBuilder {
.render("terminal_assistant_prompt", &context)
}
pub fn generate_workflow_prompt(&self) -> Result<String, RenderError> {
self.handlebars.lock().render("edit_workflow", &())
pub fn generate_suggest_edits_prompt(&self) -> Result<String, RenderError> {
self.handlebars.lock().render("suggest_edits", &())
}
pub fn generate_project_slash_command_prompt(

View File

@@ -1,7 +1,8 @@
use crate::assistant_panel::ContextEditor;
use crate::SlashCommandWorkingSet;
use anyhow::Result;
use assistant_slash_command::AfterCompletion;
pub use assistant_slash_command::{SlashCommand, SlashCommandOutput, SlashCommandRegistry};
pub use assistant_slash_command::{SlashCommand, SlashCommandOutput};
use editor::{CompletionProvider, Editor};
use fuzzy::{match_strings, StringMatchCandidate};
use gpui::{AppContext, Model, Task, ViewContext, WeakView, WindowContext};
@@ -31,13 +32,15 @@ pub mod now_command;
pub mod project_command;
pub mod prompt_command;
pub mod search_command;
pub mod selection_command;
pub mod streaming_example_command;
pub mod symbols_command;
pub mod tab_command;
pub mod terminal_command;
pub mod workflow_command;
pub(crate) struct SlashCommandCompletionProvider {
cancel_flag: Mutex<Arc<AtomicBool>>,
slash_commands: Arc<SlashCommandWorkingSet>,
editor: Option<WeakView<ContextEditor>>,
workspace: Option<WeakView<Workspace>>,
}
@@ -51,11 +54,13 @@ pub(crate) struct SlashCommandLine {
impl SlashCommandCompletionProvider {
pub fn new(
slash_commands: Arc<SlashCommandWorkingSet>,
editor: Option<WeakView<ContextEditor>>,
workspace: Option<WeakView<Workspace>>,
) -> Self {
Self {
cancel_flag: Mutex::new(Arc::new(AtomicBool::new(false))),
slash_commands,
editor,
workspace,
}
@@ -68,9 +73,9 @@ impl SlashCommandCompletionProvider {
name_range: Range<Anchor>,
cx: &mut WindowContext,
) -> Task<Result<Vec<project::Completion>>> {
let commands = SlashCommandRegistry::global(cx);
let candidates = commands
.command_names()
let slash_commands = self.slash_commands.clone();
let candidates = slash_commands
.command_names(cx)
.into_iter()
.enumerate()
.map(|(ix, def)| StringMatchCandidate {
@@ -97,7 +102,7 @@ impl SlashCommandCompletionProvider {
matches
.into_iter()
.filter_map(|mat| {
let command = commands.command(&mat.string)?;
let command = slash_commands.command(&mat.string, cx)?;
let mut new_text = mat.string.clone();
let requires_argument = command.requires_argument();
let accepts_arguments = command.accepts_arguments();
@@ -126,7 +131,6 @@ impl SlashCommandCompletionProvider {
&command_name,
&[],
true,
false,
workspace.clone(),
cx,
);
@@ -167,8 +171,7 @@ impl SlashCommandCompletionProvider {
let mut flag = self.cancel_flag.lock();
flag.store(true, SeqCst);
*flag = new_cancel_flag.clone();
let commands = SlashCommandRegistry::global(cx);
if let Some(command) = commands.command(command_name) {
if let Some(command) = self.slash_commands.command(command_name, cx) {
let completions = command.complete_argument(
arguments,
new_cancel_flag.clone(),
@@ -211,7 +214,6 @@ impl SlashCommandCompletionProvider {
&command_name,
&completed_arguments,
true,
false,
workspace.clone(),
cx,
);

View File

@@ -14,7 +14,7 @@ use language_model::{
use semantic_index::{FileSummary, SemanticDb};
use smol::channel;
use std::sync::{atomic::AtomicBool, Arc};
use ui::{BorrowAppContext, WindowContext};
use ui::{prelude::*, BorrowAppContext, WindowContext};
use util::ResultExt;
use workspace::Workspace;
@@ -37,6 +37,10 @@ impl SlashCommand for AutoCommand {
"Automatically infer what context to add".into()
}
fn icon(&self) -> IconName {
IconName::Wand
}
fn menu_text(&self) -> String {
self.description()
}

View File

@@ -4,11 +4,11 @@ use assistant_slash_command::{
SlashCommandOutputSection, SlashCommandResult,
};
use collections::HashMap;
use context_servers::{
use context_server::{
manager::{ContextServer, ContextServerManager},
types::Prompt,
};
use gpui::{AppContext, Task, WeakView, WindowContext};
use gpui::{AppContext, Model, Task, WeakView, WindowContext};
use language::{BufferSnapshot, CodeLabel, LspAdapterDelegate};
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
@@ -19,15 +19,21 @@ use workspace::Workspace;
use crate::slash_command::create_label_for_command;
pub struct ContextServerSlashCommand {
server_id: String,
server_manager: Model<ContextServerManager>,
server_id: Arc<str>,
prompt: Prompt,
}
impl ContextServerSlashCommand {
pub fn new(server: &Arc<ContextServer>, prompt: Prompt) -> Self {
pub fn new(
server_manager: Model<ContextServerManager>,
server: &Arc<ContextServer>,
prompt: Prompt,
) -> Self {
Self {
server_id: server.id.clone(),
server_id: server.id(),
prompt,
server_manager,
}
}
}
@@ -74,33 +80,29 @@ impl SlashCommand for ContextServerSlashCommand {
_workspace: Option<WeakView<Workspace>>,
cx: &mut WindowContext,
) -> Task<Result<Vec<ArgumentCompletion>>> {
let Ok((arg_name, arg_value)) = completion_argument(&self.prompt, arguments) else {
return Task::ready(Err(anyhow!("Failed to complete argument")));
};
let server_id = self.server_id.clone();
let prompt_name = self.prompt.name.clone();
let manager = ContextServerManager::global(cx);
let manager = manager.read(cx);
let (arg_name, arg_val) = match completion_argument(&self.prompt, arguments) {
Ok(tp) => tp,
Err(e) => {
return Task::ready(Err(e));
}
};
if let Some(server) = manager.get_server(&server_id) {
if let Some(server) = self.server_manager.read(cx).get_server(&server_id) {
cx.foreground_executor().spawn(async move {
let Some(protocol) = server.client.read().clone() else {
let Some(protocol) = server.client() else {
return Err(anyhow!("Context server not initialized"));
};
let completion_result = protocol
.completion(
context_servers::types::CompletionReference::Prompt(
context_servers::types::PromptReference {
r#type: context_servers::types::PromptReferenceType::Prompt,
context_server::types::CompletionReference::Prompt(
context_server::types::PromptReference {
r#type: context_server::types::PromptReferenceType::Prompt,
name: prompt_name,
},
),
arg_name,
arg_val,
arg_value,
)
.await?;
@@ -138,11 +140,10 @@ impl SlashCommand for ContextServerSlashCommand {
Err(e) => return Task::ready(Err(e)),
};
let manager = ContextServerManager::global(cx);
let manager = manager.read(cx);
let manager = self.server_manager.read(cx);
if let Some(server) = manager.get_server(&server_id) {
cx.foreground_executor().spawn(async move {
let Some(protocol) = server.client.read().clone() else {
let Some(protocol) = server.client() else {
return Err(anyhow!("Context server not initialized"));
};
let result = protocol.run_prompt(&prompt_name, prompt_args).await?;
@@ -151,7 +152,7 @@ impl SlashCommand for ContextServerSlashCommand {
if result
.messages
.iter()
.any(|msg| !matches!(msg.role, context_servers::types::SamplingRole::User))
.any(|msg| !matches!(msg.role, context_server::types::Role::User))
{
return Err(anyhow!(
"Prompt contains non-user roles, which is not supported"
@@ -163,7 +164,7 @@ impl SlashCommand for ContextServerSlashCommand {
.messages
.into_iter()
.filter_map(|msg| match msg.content {
context_servers::types::SamplingContent::Text { text } => Some(text),
context_server::types::MessageContent::Text { text, .. } => Some(text),
_ => None,
})
.collect::<Vec<String>>()

View File

@@ -69,6 +69,10 @@ impl SlashCommand for DefaultSlashCommand {
text.push('\n');
}
if !text.ends_with('\n') {
text.push('\n');
}
Ok(SlashCommandOutput {
sections: vec![SlashCommandOutputSection {
range: 0..text.len(),

View File

@@ -1,5 +1,5 @@
use crate::slash_command::file_command::{FileCommandMetadata, FileSlashCommand};
use anyhow::Result;
use anyhow::{anyhow, Result};
use assistant_slash_command::{
ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection,
SlashCommandResult,
@@ -10,6 +10,7 @@ use gpui::{Task, WeakView, WindowContext};
use language::{BufferSnapshot, LspAdapterDelegate};
use std::sync::{atomic::AtomicBool, Arc};
use text::OffsetRangeExt;
use ui::prelude::*;
use workspace::Workspace;
pub(crate) struct DeltaSlashCommand;
@@ -27,6 +28,10 @@ impl SlashCommand for DeltaSlashCommand {
self.description()
}
fn icon(&self) -> IconName {
IconName::Diff
}
fn requires_argument(&self) -> bool {
false
}
@@ -38,7 +43,7 @@ impl SlashCommand for DeltaSlashCommand {
_workspace: Option<WeakView<Workspace>>,
_cx: &mut WindowContext,
) -> Task<Result<Vec<ArgumentCompletion>>> {
unimplemented!()
Task::ready(Err(anyhow!("this command does not require argument")))
}
fn run(
@@ -53,6 +58,7 @@ impl SlashCommand for DeltaSlashCommand {
let mut paths = HashSet::default();
let mut file_command_old_outputs = Vec::new();
let mut file_command_new_outputs = Vec::new();
for section in context_slash_command_output_sections.iter().rev() {
if let Some(metadata) = section
.metadata
@@ -79,6 +85,7 @@ impl SlashCommand for DeltaSlashCommand {
cx.background_executor().spawn(async move {
let mut output = SlashCommandOutput::default();
let mut changes_detected = false;
let file_command_new_outputs = future::join_all(file_command_new_outputs).await;
for (old_text, new_output) in file_command_old_outputs
@@ -91,6 +98,7 @@ impl SlashCommand for DeltaSlashCommand {
if let Some(file_command_range) = new_output.sections.first() {
let new_text = &new_output.text[file_command_range.range.clone()];
if old_text.chars().ne(new_text.chars()) {
changes_detected = true;
output.sections.extend(new_output.sections.into_iter().map(
|section| SlashCommandOutputSection {
range: output.text.len() + section.range.start
@@ -107,6 +115,10 @@ impl SlashCommand for DeltaSlashCommand {
}
}
if !changes_detected {
return Err(anyhow!("no new changes detected"));
}
Ok(output.to_event_stream())
})
}

Some files were not shown because too many files have changed in this diff Show More