Commit graph

6785 commits

Author SHA1 Message Date
Antonio Scandurra
ef7ec265c8 Cycle message roles on click
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-06-06 18:45:08 +02:00
Antonio Scandurra
ac7178068f Include message headers in copied assistant text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-06-06 18:18:04 +02:00
Max Brunsfeld
cfcfc3bf6b Show notification when attempting to open local settings in a project w/ no folders 2023-06-06 09:03:57 -07:00
Antonio Scandurra
093ce8a9ac Simplify prompt
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-06-06 17:45:58 +02:00
Antonio Scandurra
2b1aeb07bc Show error message when requests to OpenAI fail
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-06-06 16:53:56 +02:00
Antonio Scandurra
9c59146026 Set assistant editor's title based on the first question/answer pair
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-06-06 15:59:10 +02:00
Antonio Scandurra
69b8267b6b Show the current model and allow clicking on it to change it 2023-06-06 13:13:44 +02:00
Antonio Scandurra
ada222078c Insert a user reply when hitting cmd-enter in an assistant message 2023-06-06 13:13:41 +02:00
Antonio Scandurra
f4f060667e Add assertion to pinpoint how deletion works across excerpts 2023-06-06 12:36:26 +02:00
Antonio Scandurra
337dda8e3a Only remove excerpts when an edit touches them 2023-06-06 12:27:05 +02:00
Antonio Scandurra
8032324470 Prevent moving across excerpts on Editor::delete 2023-06-06 12:26:53 +02:00
Antonio Scandurra
e46d1549d6 Retain selection's head (as opposed to its end) on insertion
This makes a difference when an edit spans two excerpts and the selection
start won't necessarily be the same as the selection end after the edit.
2023-06-06 10:12:15 +02:00
Nathan Sobo
23836eb251 Not working yet: Remove empty messages unless they contain the cursor
Problem is, I'm trying to trust the excerpt id of the selection head,
but it's a sentinel value and not the actual excerpt id of the message.
I think we probably need to resolve to offsets instead.
2023-06-05 22:58:08 -06:00
Max Brunsfeld
296a0bf510 Populate created local settings file with an empty JSON object and comments 2023-06-05 18:20:02 -07:00
Max Brunsfeld
cb975f1252 Add Zed > Preferences > Local Settings to application menu 2023-06-05 17:45:42 -07:00
Max Brunsfeld
0949ee84d8 🎨 Move OpenSettings action back to the zed crate 2023-06-05 17:43:05 -07:00
Mikayla Maki
a2d58068a7
Improve test generation and implement status propogation
co-authored-by: max <max@zed.dev>
2023-06-05 17:30:12 -07:00
Mikayla Maki
c12bdc894a
Silence not found errors 2023-06-05 15:19:59 -07:00
Max Brunsfeld
398b0f303c
Apply bounds to all windows when using start-local-collaboration script (#2570)
The `start-local-collaboration` script opens two instances of Zed, each
logged in as a different user, and each one taking up half of the
screen. But previously, when joining a remote project as one of the
collaborators, that newly-opened window would be full screen.

Now, each instance of Zed keeps *all* of its windows on its half of the
screen. This is implemented by respecting the `ZED_WINDOW_{SIZE,BOUNDS}`
env vars, even when joining *remote* projects.

Release Notes:

- N/A
2023-06-05 14:49:39 -07:00
Max Brunsfeld
3d1ba1b363 Apply bounds to all windows when using start-local-collaboration script 2023-06-05 14:36:21 -07:00
Max Brunsfeld
571151173c
Fix copilot state corruption when there are multiple buffers with the same remote id in different projects (#2569)
Fixes
https://linear.app/zed-industries/issue/Z-1511/thread-main-panicked-at-assertion-failed-left-==-right-left-local-0-1

Previously, when exchanging messages about buffers with a copilot
language server, we identified buffers using their **remote id**. This
caused problems when there were multiple projects open, where one or
more were remote, because buffers' remote ids are only unique within a
given project.

When you have multiple projects open, and one or more of the projects is
remote, it's pretty easy to have two buffers open with the same remote
id. In my testing, when this happened, copilot would stop working in
both buffers. But I believe that depending on the editing patterns that
occur in the two buffers, it could cause the crash reported in the
Linear issue above.

This PR changes our copilot logic to use buffers' local handle ids for
identifying them. This fixed the problems I was able to reproduce when
using copilot in both remote and local projects.

Release Notes:

- Fixed a crash that would sometimes occur when editing buffers after
having collaborated on a remote project.
2023-06-05 14:33:56 -07:00
Max Brunsfeld
12dd91c89c Use local ids, not remote ids, to identify buffers to copilot 2023-06-05 14:12:19 -07:00
Mikayla Maki
624467ebca
Add file and line number information to logs 2023-06-05 12:53:37 -07:00
Mikayla Maki
9a13a2ba2c
WIP: Add status bubbling to project panel 2023-06-05 12:53:04 -07:00
Joseph Lyons
311074e397 Remove code sending zed events to mixpanel 2023-06-05 15:33:17 -04:00
Mikayla Maki
49c5a3fa86
Add postgres migration 2023-06-05 12:17:21 -07:00
Joseph Lyons
70c5489c13 Stop sending editor events to mixpanel 2023-06-05 15:09:47 -04:00
Mikayla Maki
4ac5f7b14e
Add statuses to test integration 2023-06-05 12:06:23 -07:00
Mikayla Maki
e56fcd69b5
Track git status changes with the changed_paths system 2023-06-05 11:50:23 -07:00
Joseph Lyons
917d8949b7 Move app version into panic object 2023-06-05 14:17:48 -04:00
Julia
6b89243902
Update rust-bindgen dev-dependencies (#2563)
I did \*something\* Friday afternoon which changed something about my
system SDK to break the `media` crate's bindings generation. Some of the
types and consts were not being generated despite being able to prove
that they exist in the source, such as when running the header through
the preprocessor myself and feeding that through the generator. Updating
my OS, XCode, command line tools, and reinstalling Rust as well as
working from fresh clones of the repo had no effect.

Updating rust-bindgen resolved the issue and downgrading the version
back to the original version caused the issue to reappear. I'm still not
sure what happened to change the SDK but at this point with being able
to build the project again I'm not going to look a gift horse in the
mouth.

Release Notes:

- N/A
2023-06-05 09:21:07 -04:00
Antonio Scandurra
c872f581d1 Query rect_for_text_range on focused view instead of root element
This was causing IME input to be drawn in the wrong place when there
were splits or panels in the window.
2023-06-05 12:00:40 +02:00
Antonio Scandurra
bef6932da7 Avoid accidentally taking the api_key when requesting an assist 2023-06-05 11:25:21 +02:00
Julia
5790d6993e Update rust-bindgen dev-dependencies 2023-06-04 23:34:22 -04:00
Joseph Lyons
7c60f636d5 Fix typos 2023-06-02 22:02:19 -04:00
Mikayla Maki
ca077408d7
Fix bug where git statuses would not be initialized on startup
move git status queries to be on entry creation

co-authored-by: max <max@zed.dev>
2023-06-02 17:38:39 -07:00
Mikayla Maki
2f97c7a4f1
Remove stale comments
Implement status bubbling query with sum tree traversals

co-authored-by: max <max@zed.dev>
2023-06-02 16:41:01 -07:00
Mikayla Maki
e377459948
Remove stateful bubbling
co-authored-by: max <max@zed.dev>
2023-06-02 15:07:49 -07:00
Mikayla Maki
99a0e11e70
Abandoning stateful bubbling approach
co-authored-by: max <max@zed.dev>
2023-06-02 14:51:40 -07:00
Max Brunsfeld
46d2cbaa4c
Improve panic reports (#2560)
* Add an `identifying_backtrace` field that only contains symbols in
*our* own codebase, which can be used for better deduplication.
* In the main backtrace, include file and line numbers for all symbols
in our codebase
* Exclude any stack frames within the panic handling/hooking system
itself, so that the top line of the backtrace is where the panic
originated in our codebase.

This should improve our panic deduplication, and also make panic reports
a bit more readable.

example:

```
{
  "thread": "main",
  "payload": "wtf",
  "location_data": {
    "file": "crates/zed/src/zed.rs",
    "line": 459
  },
  "backtrace": [
    "zed::open_log_file::{{closure}}::{{closure}}::{{closure}}",
    "    crates/zed/src/zed.rs:459",
    "gpui::app::AppContext::spawn_internal::{{closure}}",
    "    crates/gpui/src/app.rs:2073",
    "gpui::executor::any_local_future::{{closure}}",
    "    crates/gpui/src/executor.rs:1026",
    "<core::pin::Pin<P> as core::future::future::Future>::poll",
    "<async_task::runnable::spawn_local::Checked<F> as core::future::future::Future>::poll",
    "async_task::raw::RawTask<F,T,S>::run",
    "async_task::runnable::Runnable::run",
    "<gpui::platform::mac::dispatcher::Dispatcher as gpui::platform::Dispatcher>::run_on_main_thread::trampoline",
    "    crates/gpui/src/platform/mac/dispatcher.rs:40",
    "<() as objc::message::MessageArguments>::invoke",
    "objc::message::platform::send_unverified",
    "objc::message::send_message",
    "<gpui::platform::mac::platform::MacForegroundPlatform as gpui::platform::ForegroundPlatform>::run",
    "    crates/gpui/src/platform/mac/platform.rs:366",
    "gpui::app::App::run",
    "    crates/gpui/src/app.rs:251",
    "Zed::main",
    "    crates/zed/src/main.rs:118",
    "core::ops::function::FnOnce::call_once",
    "std::sys_common::backtrace::__rust_begin_short_backtrace",
    "std::rt::lang_start::{{closure}}",
    "core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once",
    "std::rt::lang_start"
  ],
  "release_channel": "dev",
  "os_name": "macOS",
  "os_version": "12.6.1",
  "architecture": "aarch64",
  "panicked_on": 1685734744050,
  "identifying_backtrace": [
    "zed::open_log_file::{{closure}}::{{closure}}::{{closure}}",
    "gpui::app::AppContext::spawn_internal::{{closure}}",
    "gpui::executor::any_local_future::{{closure}}",
    "<gpui::platform::mac::dispatcher::Dispatcher as gpui::platform::Dispatcher>::run_on_main_thread::trampoline",
    "<gpui::platform::mac::platform::MacForegroundPlatform as gpui::platform::ForegroundPlatform>::run",
    "gpui::app::App::run",
    "Zed::main"
  ]
}
```

Release Notes:

N/A
2023-06-02 13:11:57 -07:00
Max Brunsfeld
7417835f06 Avoid writing spurious nulls to settings file when updating it programatically 2023-06-02 13:02:17 -07:00
Max Brunsfeld
f6a4706410 Improve panic reports
* Add an 'identifying_backtrace' field that only contains symbols in our
  codebase, which can be used for better deduplication.
* In the main backtrace, include file and line numbers for all symbols
  in our codebase
2023-06-02 12:37:39 -07:00
Joseph T. Lyons
00265c19a0
Add additional panic information to panic events (#2555)
Adds the following to the panic event

release_channel
os_name
os_version
architecture

Merge first: https://github.com/zed-industries/zed.dev/pull/322

Release Notes:

- N/A
2023-06-02 14:30:16 -04:00
Piotr Osiewicz
345fad3e9d
editor: add select previous command (#2556)
Added a `select previous` command to complement `select next`.
Release Notes:

- Added "Select previous" editor command, mirroring `Select next`.
Ticket number: Z-366
2023-06-02 17:32:34 +02:00
Antonio Scandurra
f00f16fe37 Show remaining tokens 2023-06-02 17:27:21 +02:00
Antonio Scandurra
3750e64d9f Save OpenAI API key in the keychain 2023-06-02 12:15:25 +02:00
Piotr Osiewicz
571d2f4966
Z-1074/search default label (#2547)
This commit adds a default "Project search" tooltip for empty search
panes. Fixes Linear ticket Z-1074
Release Notes:

- Added default tooltip to empty search panes.
([#1533](https://github.com/zed-industries/community/issues/1533)).
2023-06-02 11:42:40 +02:00
Antonio Scandurra
a81d164ea6 Allow saving the OpenAI API key in the assistant panel 2023-06-02 11:38:02 +02:00
Antonio Scandurra
d0aff65b1c Allow moving the assistant panel to other docks 2023-06-02 10:55:19 +02:00
Antonio Scandurra
55c8c6d3fb Allow adding new contexts 2023-06-02 10:29:22 +02:00
Antonio Scandurra
cf934ab696 Fix compile errors 2023-06-02 10:08:06 +02:00
Antonio Scandurra
20e65a533c Merge remote-tracking branch 'origin/main' into assistant-2 2023-06-02 09:32:11 +02:00
Mikayla Maki
3768851799
WIP: Git statuses 2023-06-01 23:27:49 -07:00
Joseph Lyons
c55aee84d3 Rename field to panicked_on 2023-06-02 01:33:25 -04:00
Joseph Lyons
cc055901e1 Add additional panic information to panic events 2023-06-01 23:34:39 -04:00
Mikayla Maki
5e43dcaab8
WIP: Add stateful status bubbling to worktree 2023-06-01 16:51:34 -07:00
Max Brunsfeld
0bd9d5b1fa
Zoom out all panes when opening a dock (#2554)
Fixes
https://linear.app/zed-industries/issue/Z-2051/center-zoom-isnt-unset-when-opening-project-panel

Release Notes:

- Fixed a bug where opening the project panel did not reset the zoom
state of a pane.
2023-06-01 15:26:46 -07:00
Max Brunsfeld
585d13d3db Unzoom all panes when opening a dock 2023-06-01 15:20:15 -07:00
Max Brunsfeld
a55eafa726
Fix ambiguous glob export warnings in rust 1.70 (#2553)
This fixes a warning that is introduced when upgrading to Rust 1.70.

Release Notes:

- N/A
2023-06-01 14:37:36 -07:00
Max Brunsfeld
e67e6e6f70 Fix ambiguous glob export warnings in rust 1.70 2023-06-01 14:07:59 -07:00
Joseph Lyons
0065f5715c Add panic events 2023-06-01 16:40:54 -04:00
Mikayla Maki
9d6b3744f7
Redraw the terminal on every wakeup (#2551)
For whatever reason, the optimizations of panes and workspace have
caused the terminal to notify less often then it should. This PR fixes
that oversight.
2023-06-01 10:56:13 -07:00
Mikayla Maki
40c6baf7cb
Redraw the terminal on every wakeup
co-authored-by: max <max@zed.dev>
2023-06-01 10:49:31 -07:00
Mikayla Maki
2390815d67
Make settings store handle no user settings
co-authored-by: max <max@zed.dev>
2023-06-01 10:09:04 -07:00
Julia
51c82da840 Avoid blocking forever on startup if config files do not exist
The files will still get created if the user opens their settings and
saves, otherwise everything will transparently work

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-06-01 12:04:45 -04:00
Kirill Bulatov
d8ce333cf8 Remove wrong assertion 2023-06-01 16:51:29 +03:00
Piotr Osiewicz
01621972c5
Change "Project search" to "Project Search" 2023-06-01 12:31:37 +02:00
Piotr Osiewicz
e1a6dc9077 search: Add a default tooltip for empty searches
Z-1074
2023-06-01 11:17:33 +02:00
Max Brunsfeld
788f97ec68
Add support for folder-specific settings (#2537)
This PR allows you to customize Zed's settings within a particular
folder by creating a `.zed/settings.json` file within that folder.

Todo

* [x] respect folder-specific settings for local projects
* [x] respect folder-specific settings in remote projects
* [x] pass a path when retrieving editor/language settings
* [x] pass a path when retrieving copilot settings
* [ ] update the `Setting` trait to make it clear which types of
settings are locally overridable

Release Notes:

* Added support for folder-specific settings. You can customize Zed's
settings within a particular folder by creating a `.zed` directory and a
`.zed/settings.json` file within that folder.
2023-05-31 16:27:08 -07:00
Max Brunsfeld
ae7606ce21 collab 0.12.5 2023-05-31 15:38:26 -07:00
Max Brunsfeld
0d281c1b89 🎨 2023-05-31 15:13:01 -07:00
Max Brunsfeld
0dd7694ff5 Make language_settings take a language, not a language name 2023-05-31 15:10:30 -07:00
Max Brunsfeld
03a351fb26 Make language settings accessors take an arc dyn file 2023-05-31 14:57:04 -07:00
Max Brunsfeld
38078b93cc v0.90.x dev 2023-05-31 14:44:48 -07:00
Max Brunsfeld
a2ab7c9eb9 Respect project-specific settings for copilot 2023-05-31 14:42:15 -07:00
Mikayla Maki
6f4fd74f43
Add a dock-keybinding-changed one-time notification (#2546)
This code is intended to be removed at a later date.

Release Notes:

- N/A
2023-05-31 14:28:12 -07:00
Mikayla Maki
bf2016adf5
Remove version check 2023-05-31 14:23:56 -07:00
Mikayla Maki
27ef0e2b52
De-morgans properly 2023-05-31 14:21:38 -07:00
Mikayla Maki
45b42c512d
fmt 2023-05-31 14:17:27 -07:00
Mikayla Maki
705e36827c
add version check 2023-05-31 14:16:37 -07:00
Mikayla Maki
b875d4ed40
Remove silly panic 2023-05-31 14:10:50 -07:00
Mikayla Maki
ed0b9acb0a
Add panic if version is 0.91 2023-05-31 14:06:36 -07:00
Mikayla Maki
ef80b539d1
Fix notification styling, minimize database reads 2023-05-31 13:56:41 -07:00
Max Brunsfeld
193474a346 🎨 2023-05-31 13:07:20 -07:00
Max Brunsfeld
c48fed26bd When revealing items, zoom-out any inactive panes 2023-05-31 13:05:50 -07:00
Mikayla Maki
4717ce1da3
WIP: Move statuses to entries
co-authored-by: julia <julia@zed.dev>
2023-05-31 12:55:31 -07:00
Max Brunsfeld
3f6aa94a5f Use active color for zoom button in a zoomed pane 2023-05-31 12:51:57 -07:00
Max Brunsfeld
893615236d Only include one border edge for zoomed panels 2023-05-31 12:45:55 -07:00
Max Brunsfeld
ac41564a8f Dismiss zoomed panels by closing their dock, not zooming them out 2023-05-31 12:45:55 -07:00
Mikayla Maki
22e4086658
WIP: Move statuses to be on their associated file entries in worktree
co-authored-by: Julia <julia@zed.dev>
2023-05-31 11:03:11 -07:00
Max Brunsfeld
76927b6d95 Make active panel's button close its dock 2023-05-31 10:29:59 -07:00
Max Brunsfeld
eeba72d775 Bump protocol version 2023-05-31 09:03:45 -07:00
Max Brunsfeld
8f95435548 Replicate project-specific settings when collaborating 2023-05-30 18:08:03 -07:00
Mikayla Maki
c9820fde61
WIP: Add toast when users attempt to use shift-escape for the first time 2023-05-30 17:48:41 -07:00
Mikayla Maki
584e5f7958
Fix usability issues with new panel system. (#2544)
This PR updates the dock key bindings according to the following model:

There are three bits: 
Visible: Opened / closed.
Focus: Panel focused / center focused.
Zoom: Zoomed / Not zoomed.

Each of these variables is 'sticky' in that they won't effect each other
unless they need to. 'Zooming' a panel conceptually merges the visible
and focus bits.

cmd-shift-j/b/r have all been removed.

cmd-j/b/r have been updated to mean 'toggle visibility of a certain
dock', firing them should *always* reveal the panel to you (where you
last left it), or hide it, without moving focus (unless the focused
element is invisible). This means that, when the terminal panel is
zoomed, cmd-j has the same effect as ctrl-`

ctrl-` and cmd-shift-e now toggle a panel's focus, without updating the
zoom state of a panel. Toggling the focus of a zoomed panel causes it to
automatically hide itself, without losing the zoom bit.

When focused or made visible, panels which cannot be zoomed
automatically unzoom everything else so as to preserve user intent of
'show me this panel' and 'everything stays where it is if I don't take
an action'

Release Notes:

- cmd-shift-j/b/r have been removed.  (preview only)
- cmd-j/b/r unconditionally show or hide their associated dock,
respecting zoom settings. (preview only)
- ctrl-` and cmd-shift-e now retain zoom state. (preview only)
- Fixed a bug where terminal dock tab would always be in the active
state (preview only)
- Fixed a bug where terminals would not always open in the terminal
panel
- Changed the look of zoomed panels to fill more of the screen (preview
only)
2023-05-30 16:39:06 -07:00
Mikayla Maki
0122cd61c5
fmt 2023-05-30 16:33:42 -07:00
Mikayla Maki
685e8d7007
Seperate pane and panel styling
co-authored-by: max <max@zed.dev>
2023-05-30 16:23:16 -07:00
Mikayla Maki
9c707eff27
Rework new terminal actions 2023-05-30 16:10:07 -07:00
Mikayla Maki
e80ab5f096
Fix focus bug with new docks
co-authored-by: max <max@zed.dev>
2023-05-30 15:40:30 -07:00
Mikayla Maki
5e4a9abd09
Fix bug in panel button dispatch 2023-05-30 15:17:42 -07:00
Mikayla Maki
5065804388
WIP: iron out bugs in interaction between toggle and toggle focus key bindings
co-authored-by: max <max@zed.dev>
2023-05-30 14:55:49 -07:00
Julia
8f0fc918e9
TextStyle::default() ask system for known existing font family (#2542)
Rather than assuming a specific family exists, try a set of specific
names and if they fail, just grab any old font that the system reports
as existing

Closes
https://linear.app/zed-industries/issue/Z-445/thread-main-panicked-at-called-resultunwrap-on-an-err-value-could-not

Release Notes:

* Fixed crash that could happen if system did not have a specific
fallback font
2023-05-30 16:25:07 -04:00
Mikayla Maki
9c9af5ed94
Remove focus side effects from toggle dock commands
co-authored-by: max <max@zed.dev>
2023-05-30 12:32:00 -07:00
Joseph Lyons
501f9ab2c6 Scrape email from feedback editor 2023-05-30 15:06:35 -04:00
Mikayla Maki
1a23fe91b4
WIP: Remove focus side effects from toggle dock commands
co-authored-by: max <max@zed.dev>
2023-05-30 12:00:15 -07:00
Mikayla Maki
84f98f13c4
Seperate open and zoom bits conceptually for new panels
co-authored-by: max <max@zed.dev>
2023-05-30 11:52:14 -07:00
Julia
31516b7863 TextStyle::default() ask system for known existing font family
Rather than assuming a specific family exists, try a set of specific
names and if they fail, just grab any old font that the system reports
as existing

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-05-30 14:46:27 -04:00
Antonio Scandurra
69e8a166e4 Start on assistant::QuoteSelection 2023-05-30 15:25:53 +02:00
Antonio Scandurra
dc365472a6 Merge remote-tracking branch 'origin/main' into assistant-2 2023-05-30 15:11:06 +02:00
Antonio Scandurra
bd494037bb Call ItemHandle::added_to_pane when an item is added to a pane 2023-05-30 14:46:41 +02:00
Max Brunsfeld
ed0fa2404c Use settings JSON schema when editing local settings files 2023-05-29 14:31:54 -07:00
Max Brunsfeld
89446c7fd4 Start work on respecting project-specific settings 2023-05-29 14:25:49 -07:00
Antonio Scandurra
88eb2b2163 Move history navigation logic to Workspace
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-05-29 19:47:59 +02:00
Antonio Scandurra
6d3464fd1f Make Pane::add_item a proper Pane method
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-05-29 19:16:22 +02:00
Antonio Scandurra
890c42a75a Show time in assistant messages 2023-05-29 16:23:16 +02:00
Kirill Bulatov
d593377e45 Improves project search panel shortcut handling
* ESC (project_search::ToggleFocus) toggles focus from
  include/exclude fields to the editor

* Cmd+Shift+F (workspace::NewSearch) can be triggered from the editor,
and moves focus to the query editor
2023-05-29 16:58:06 +03:00
Antonio Scandurra
52e8bf2928 Show custom header for assistant messages 2023-05-29 15:57:55 +02:00
Antonio Scandurra
404bebab63 Set markdown as the assistant's buffer languages 2023-05-29 11:34:26 +02:00
Kirill Bulatov
fdad1adaf6 Update LSP to the newest version 2023-05-28 21:55:08 +03:00
Max Brunsfeld
e4530471de
Make worktree UpdatedEntries events fully describe all changes (#2533)
This PR makes the worktree's change events more useful in a few ways:

* The changes are now described by a cheaply clone-able collection, so
that they can be used in background tasks. Right now, I'm using a simple
Arc slice.
* The `UpdatedEntries` event now captures not only changes due to FS
changes, but also newly-loaded paths that are discovered during the
initial scan.
* The `UpdatedGitRepositories` event now includes repositories whose
work-dir changed but git dir didn't change. A boolean flag is included,
to indicate whether the git content changed.
* The `UpdatedEntries` and `UpdatedGitRepositories` events are now
*used* to compute the worktree's `UpdateWorktree` messages, used to sync
changes to guests. This unifies two closely-related code paths, and
makes the host more efficient when collaborating, because the
`UpdateWorktree` message computation used to require walking the entire
`entries` tree on every FS change.
2023-05-26 15:55:14 -07:00
Max Brunsfeld
1f42bfc1bd Include repositories with workdir changes in worktree UpdatedGitRepsositories event 2023-05-26 15:47:37 -07:00
Max Brunsfeld
2db57b5139 Adjust diagnostic transformation test to not wait for two buffer notifications 2023-05-26 15:47:37 -07:00
Max Brunsfeld
02b95ef320 Derive worktree update messages from existing change events 2023-05-26 15:47:37 -07:00
Kirill Bulatov
5fda9e934d Shorten full paths with ~ 2023-05-27 01:21:38 +03:00
Kirill Bulatov
3a3c1c5a5b Add a test
co-authored-by: Mikayla <mikayla@zed.dev>
2023-05-27 01:12:22 +03:00
Nathan Sobo
ffbfbe422b WIP: Not sure I actually want to rip this out 2023-05-26 16:11:58 -06:00
Nathan Sobo
3904971bd8 Hide assistant gutter 2023-05-26 15:38:03 -06:00
Nathan Sobo
8f6e67f440 Cancel assists on escape 2023-05-26 14:49:27 -06:00
Max Brunsfeld
6628c4df28 Store worktree changes in a sorted arc slice, not a HashMap
We don't need to look-up change types by an arbitrary key, but we
do need to iterate it. It would also be useful to be able to
cheaply clone the changes, to use them in a background task.
2023-05-26 09:24:15 -07:00
Max Brunsfeld
59bfd40679 Make stricter assertions about change events in random worktree test 2023-05-26 09:24:15 -07:00
Max Brunsfeld
f890eefdef Include paths loaded during initial scan in worktree UpdatedEntries event 2023-05-26 09:24:15 -07:00
Nathan Sobo
80080a43e4 Start on an assistant panel based on multi-buffers
Each message is represented as a multibuffer excerpt to allow for
fluid editing of the conversation transcript.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-05-26 10:09:55 -06:00
Kirill Bulatov
cf2bbfc85a Better display labels for external files 2023-05-26 18:18:32 +03:00
Kirill Bulatov
508533ebb7 Track abs paths in history 2023-05-26 17:31:35 +03:00
Kirill Bulatov
2fdc960704 Properly display labels for currently opened external files 2023-05-26 15:44:44 +03:00
Kirill Bulatov
b75c27da6f Simplify selected index handling 2023-05-26 14:15:58 +03:00
Kirill Bulatov
364631a155 Add absolute paths to historic elements 2023-05-26 14:03:44 +03:00
Kirill Bulatov
5501dd741c Fix duplicate item creation in project panel 2023-05-26 02:07:25 +03:00
Julia
5e39ba596e Clean up final remaining code paths calling old diff update method 2023-05-25 14:41:09 -04:00
Julia
f40c498491 Fix tests 2023-05-25 14:29:28 -04:00
Julia
8d662edb6c Remove concept of git diff refresh from Item trait 2023-05-25 14:29:28 -04:00
Julia
cede296b04 Project level git diff recalc handling
This avoids an issue where in a many-buffer multi-buffer, each modified
buffer could complete its recalc independently, causing a cascade of
repeated notifies

Now all recalcs started at the same time must complete before
 A: Starting another recalc pass
 B: The master notify occurring

Each buffer can still show its new diff if something else triggers it
to notify earlier, this is desirable and does not have the same negative
effects as the notify cascade as those re-layouts would need to happen
anyway

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-05-25 14:10:27 -04:00
Max Brunsfeld
54421b11f3 wip 2023-05-25 14:10:27 -04:00
Kirill Bulatov
ae3bdd755e
Support OnTypeFormatting LSP request (#2517)
Supports
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_onTypeFormatting

rust-analyzer uses this feature to add matching brackets semantically,
e.g.
before:
![Screenshot 2023-05-23 at 17 46
42](https://github.com/zed-industries/zed/assets/2690773/020e8448-23e6-4a38-8dbb-c9edf18062f7)

after:
![Screenshot 2023-05-23 at 17 46
49](https://github.com/zed-industries/zed/assets/2690773/4d140af3-aca6-451d-ac61-e2a9bb31caea)

`use_on_type_format` settings entry was added, enabled by default, to
disable the new feature.

Release Notes:

* Support `OnTypeFormatting` LSP protocol feature, allowing
rust-analyzer to add matching brackets
2023-05-25 18:35:47 +03:00
Kirill Bulatov
739d5ca373 Have proper undo for both client and host 2023-05-25 18:29:57 +03:00
Antonio Scandurra
4185a178e7 Prevent bottom dock from becoming too large or too small 2023-05-25 15:29:59 +02:00
Antonio Scandurra
aa8c0475b1 Don't show navigation controls for terminal panel 2023-05-25 15:15:20 +02:00
Kirill Bulatov
e2ff829f98 Use Transaction instead of ProjectTransaction
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-05-25 16:12:14 +03:00
Antonio Scandurra
414b97adce Add search bar to terminal panel 2023-05-25 14:46:10 +02:00
Antonio Scandurra
c2f3ac24a4 Prevent zoom from being restored when focusing a modal 2023-05-25 12:11:11 +02:00