Commit log

cff094f v0.99.x preview

Joseph T. Lyons created

40030f3 Fix two mouse event bugs (#2835)

Click to expand commit body
This PR fixes two bugs we discovered in Zed's mouse event handling while
investigating an interesting and mysterious bug we we were seeing, where
spurious `MouseMoved` events would continuously be dispatched after
control-clicking.

Release Notes:

- Fixed a rendering glitch that could occur after control-clicking
certain elements.

Mikayla Maki created

6cc0b81 Add `ui_sans` as a font option in the theme (#2836)

Click to expand commit body
This adds IBM Plex as a font option available to use as `ui_sans`

Note: This PR adds a static list of accepted font types in `/font`, as
LICENSE files were causing the app to crash when Zed was trying to load
them as fonts.

Release Notes:

- N/A (No user facing changes)

Thanks @ForLoveOfCats for getting me unstuck ❤️

Nate Butler created

85af025 Add IBM Plex license

Nate Butler created

af388e7 Only load TTF fonts for now, additional font types will need to be manually added

Click to expand commit body
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>

Nate Butler and Julia created

183c292 Remove license causing unwrap error

Click to expand commit body
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>

Nate Butler and Julia created

b23f1c8 WIP add IBM Plex Sans

Click to expand commit body
(base) natebutler@Nate16 zed % cargo run
   Compiling zed v0.99.0 (/Users/natebutler/Code/zed/zed/crates/zed)
    Finished dev [unoptimized + debuginfo] target(s) in 9.15s
     Running `target/debug/Zed`
Thread "main" panicked with "called `Result::unwrap()` on an `Err` value: parse error" at crates/zed/src/main.rs:667:10
   0: backtrace::backtrace::libunwind::trace
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/libunwind.rs:93:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:176:9
   3: backtrace::capture::Backtrace::new
             at /Users/natebutler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:140:22
   4: Zed::init_panic_hook::{{closure}}
             at crates/zed/src/main.rs:436:29
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic_handler::{{closure}}
   7: std::sys_common::backtrace::__rust_end_short_backtrace
   8: _rust_begin_unwind
   9: core::panicking::panic_fmt
  10: core::result::unwrap_failed
  11: core::result::Result<T,E>::unwrap
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/core/src/result.rs:1089:23
  12: Zed::load_embedded_fonts
             at crates/zed/src/main.rs:664:5
  13: Zed::main
             at crates/zed/src/main.rs:80:5
  14: core::ops::function::FnOnce::call_once
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/core/src/ops/function.rs:250:5
  15: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/std/src/sys_common/backtrace.rs:134:18
  16: std::rt::lang_start::{{closure}}
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/std/src/rt.rs:166:18
  17: std::panicking::try
  18: std::rt::lang_start_internal
  19: std::rt::lang_start
             at /private/tmp/rust-20230613-7622-103lepv/rustc-1.70.0-src/library/std/src/rt.rs:165:17
  20: _mai

Nate Butler created

8ed5e8f Pass PaintContext to Element::paint (#2788)

Click to expand commit body
I want to use this on another branch, but it's a sweeping change, so
this prepares the ground for it. This can always be reverted if it
doesn't work out.

Nathan Sobo created

bed0d1d Fix language detection when file name begins with a `.` (#2833)

Click to expand commit body
I went to add in `zprofile` to the bash language config to get syntax
highlighting for it. After adding it in, Zed was still not highlighting
the file. I checked and saw that we are using `Path::extension()` in
`language_for_file()`, which [returns `None` when a file's name begins
with a
`.`](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.extension),
such as in the case of `.zprofile`. This PR adds a custom method, with
some tests, that just tries to grab the last component in the file name
if `Path::extension` returns `None`. Not sure if `ext` is the best name,
but I can't use `extension`.

Maybe this method should be called `extension_or_hidden_file_name()`?

Release Notes:

- Fixed a bug where language detection would fail for files starting
with `.` in their names.
- Added syntax highlighting for `.zprofile` files

Joseph T. Lyons created

c523ccc Fix code that identifies language via extension

Joseph T. Lyons created

0b93a30 Terminate synthetic drag state on mouse up w/ ctrl held

Click to expand commit body
Co-authored-by: Mikayla <mikayla@zed.dev>

Max Brunsfeld and Mikayla created

e3bb5e5 Fix failure to remove hovered region_ids on element removal

Click to expand commit body
Co-authored-by: Mikayla <mikayla@zed.dev>

Max Brunsfeld and Mikayla created

db96fb1 Merge remote-tracking branch 'origin/main' into paint-context

Nathan Sobo created

54ca5f1 Replace context methods that take a window id with methods on window handles (#2832)

Click to expand commit body
With this PR, I've eliminated almost all references to window ids
outside of the internals of GPUI. All public methods taking these ids
are now defined on `AnyWindowHandle`, which provides a more coherent
narrative around windows as a concept.

Nathan Sobo created

0dc70e6 Rename mac platform Window to MacWindow for clarity

Nathan Sobo created

fc96676 Use AppContext::update when updating windows so we handle effects

Nathan Sobo created

8e49d14 Minimize window id usage

Nathan Sobo created

afd89b2 Store AnyWindowHandles instead of usizes

Nathan Sobo created

c96b03a Piotr/optimize search selections with a limit (#2831)

Click to expand commit body
/cc @nathansobo @maxbrunsfeld 

Release Notes:
- Fixed scrollbar selections causing noticeable slowdowns with large
quantities of selections.

Piotr Osiewicz created

1e8a9cc Merge remote-tracking branch 'origin/main' into window-handles

Nathan Sobo created

b77c336 Return window handles from WeakItemHandle

Nathan Sobo created

b2d9ccc Move more window methods off AsyncAppContext

Nathan Sobo created

95cd96e Move debug_elements to AnyWindowHandle

Nathan Sobo created

4f10f0e Remove window methods from AsyncAppContext

Nathan Sobo created

1fd80ba Remove AsyncAppContext::remove_window

Nathan Sobo created

fe6a188 Remove unused dock code

Nathan Sobo created

0a4633f Remove more window id usage

Nathan Sobo created

da7dc9c Work with window handles instead of ids in drag code

Nathan Sobo created

d896d89 Store an AnyWindowHandle in WindowContext

Nathan Sobo created

662e196 Calculate the range for each color family in a theme (#2738)

Click to expand commit body
Release Notes:
- N/A (Internal theme stuff)

Nate Butler created

49f1f1c Remove window when closing workspace in test

Nathan Sobo created

1aff642 Do not highlgiht selections at all over the threshold

Piotr Osiewicz created

dba2fac Remove window via handles

Nathan Sobo created

f0da6b0 Remove TestAppContext::add_view

Click to expand commit body
Instead, we now call this on window handles.

Nathan Sobo created

0f33223 Remove unused method

Nathan Sobo created

d687c3d Merge remote-tracking branch 'origin/main' into window-handles

Nathan Sobo created

f2be318 Move window-related methods from TestAppContext to AnyWindowHandle

Nathan Sobo created

0197d49 Move activation simulation to AnyWindowHandle

Nathan Sobo created

486f5bc Get compiling

Nathan Sobo created

371c669 Address review feedback.

Click to expand commit body
Rename selected_rows to background_highlight_row_ranges.
Do not return any ranges if there are more than 50k results

Piotr Osiewicz created

b0fc6da Use display maps

Piotr Osiewicz created

241d395 Remove redundant argument

Piotr Osiewicz created

42e1221 Add upper bound limit. Remove dbg! statements

Piotr Osiewicz created

fa16895 Do not query start of range if it's end is the same as the previous hunk's

Piotr Osiewicz created

ca21626 Baseline: Improve selection rendering for large quantities from 270ms to 90ms

Piotr Osiewicz created

7288be4 Make LspAdapter::process_diagnostics synchronous (#2829)

Click to expand commit body
When editing rust code, the project diagnostics view sometimes fails to
update, so that you have to close the view and re-open it to see the
correct state.

This PR fixes one possible cause of that problem. There was an async
step in between *receiving* diagnostics from the language server and
updating the diagnostics, due to an async call to
`LspAdapter::process_diagnostics`. This could cause the following
sequence of events to happen:

1. Rust-analyzer sends us new diagnostics for a file `a.rs`
2. We call `process_diagnostics` with those diagnostics
3. Rust-analyzer sends us a `WorkDoneProgress` message, indicating that
the "flycheck" (aka `cargo check`) process has completed
4. We update the project diagnostics view due to this message.
5. The `process_diagnostics` call for `a.rs` completes
6. 💥 We have the new diagnostics for `a.rs`, but do not update the
project diagnostics view again.

This PR fixes this bug by simply making `process_diagnostics`
synchronous. There is no I/O or expensive computation happening in that
method. If we need to make it asynchronous in the future, we need to
introduce a queue that ensures that `publishDiagnostics` and
`workDoneProgress` messages are processed serially.

Release Notes:

- Fixed a bug where the project diagnostics view would sometimes fail to
update properly when using Rust-analyzer.

Max Brunsfeld created

d417993 Add syntax highlighting for Cargo.toml files (#2830)

Click to expand commit body
Release Notes:

- Added syntax highlighting for `Cargo.toml` files

Joseph T. Lyons created

dbf25ea Add syntax highlighting for Cargo.toml files

Joseph T. Lyons created

580c2ea Fix test name

Joseph T. Lyons created

4e33654 Make LspAdapter::process_diagnostics synchronous

Click to expand commit body
Co-authored-by: Nathan <nathan@zed.dev>

Max Brunsfeld and Nathan created