57ebc7334d
Eliminate GPUI View, ViewContext, and WindowContext types ( #22632 )
...
There's still a bit more work to do on this, but this PR is compiling
(with warnings) after eliminating the key types. When the tasks below
are complete, this will be the new narrative for GPUI:
- `Entity<T>` - This replaces `View<T>`/`Model<T>`. It represents a unit
of state, and if `T` implements `Render`, then `Entity<T>` implements
`Element`.
- `&mut App` This replaces `AppContext` and represents the app.
- `&mut Context<T>` This replaces `ModelContext` and derefs to `App`. It
is provided by the framework when updating an entity.
- `&mut Window` Broken out of `&mut WindowContext` which no longer
exists. Every method that once took `&mut WindowContext` now takes `&mut
Window, &mut App` and every method that took `&mut ViewContext<T>` now
takes `&mut Window, &mut Context<T>`
Not pictured here are the two other failed attempts. It's been quite a
month!
Tasks:
- [x] Remove `View`, `ViewContext`, `WindowContext` and thread through
`Window`
- [x] [@cole-miller @mikayla-maki] Redraw window when entities change
- [x] [@cole-miller @mikayla-maki] Get examples and Zed running
- [x] [@cole-miller @mikayla-maki] Fix Zed rendering
- [x] [@mikayla-maki] Fix todo! macros and comments
- [x] Fix a bug where the editor would not be redrawn because of view
caching
- [x] remove publicness window.notify() and replace with
`AppContext::notify`
- [x] remove `observe_new_window_models`, replace with
`observe_new_models` with an optional window
- [x] Fix a bug where the project panel would not be redrawn because of
the wrong refresh() call being used
- [x] Fix the tests
- [x] Fix warnings by eliminating `Window` params or using `_`
- [x] Fix conflicts
- [x] Simplify generic code where possible
- [x] Rename types
- [ ] Update docs
### issues post merge
- [x] Issues switching between normal and insert mode
- [x] Assistant re-rendering failure
- [x] Vim test failures
- [x] Mac build issue
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com >
Co-authored-by: Cole Miller <cole@zed.dev >
Co-authored-by: Mikayla <mikayla@zed.dev >
Co-authored-by: Joseph <joseph@zed.dev >
Co-authored-by: max <max@zed.dev >
Co-authored-by: Michael Sloan <michael@zed.dev >
Co-authored-by: Mikayla Maki <mikaylamaki@Mikaylas-MacBook-Pro.local >
Co-authored-by: Mikayla <mikayla.c.maki@gmail.com >
Co-authored-by: joão <joao@zed.dev >
2025-01-26 03:02:45 +00:00
Piotr Osiewicz
59b441d002
chore: Use workspace fields for edition and publish ( #23291 )
...
This prepares us for an upcoming bump to Rust 2024 edition.
Release Notes:
- N/A
2025-01-17 17:39:22 +01:00
Piotr Osiewicz
9b464f483b
chore: Fix several style lints ( #17488 )
...
It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.
Release Notes:
- N/A
2024-09-06 11:58:39 +02:00
Marshall Bowers
5c028380fb
xtask: Add command for checking packages conform to certain standards ( #15236 )
...
This PR adds a new `xtask` command for checking that packages conform to
certain standards.
Still a work-in-progress, but right now it checks:
- If `[lints] workspace = true` is set
- If packages are using non-workspace dependencies
Release Notes:
- N/A
2024-07-25 19:20:08 -04:00
Marshall Bowers
93e7008ff9
xtask: Check for licenses that are duplicated instead of being symlinked ( #11777 )
...
This PR updates `cargo xtask licenses` to also check for license files
that are not symlinks.
Release Notes:
- N/A
2024-05-13 19:13:09 -04:00
Marshall Bowers
49345fefbd
Add xtask for finding crates with missing licenses ( #11776 )
...
This PR adds a new `cargo xtask licenses` command for finding crates
with missing license files.
A number of crates were uncovered that were missing a license file, and
have had the appropriate license file added.
Release Notes:
- N/A
2024-05-13 18:52:12 -04:00
白山風露
1af242a8e4
Windows: Enable clippy deny warnings ( #9920 )
...
~Waiting #9918~
Release Notes:
- N/A
2024-03-28 11:55:35 -04:00
Marshall Bowers
b202d984bc
Restore --all-targets for clippy ( #9346 )
...
This PR restores the `--all-targets` flag when running `cargo clippy`.
Without it, there are areas that Clippy does not check, as evidenced by
the violations that were caught once the flag was re-added.
Release Notes:
- N/A
2024-03-14 12:39:45 -04:00
Mikayla Maki
dea0de8688
Add rs-notify implementation of fs::watch ( #9040 )
...
This PR simplifies the Zed file system abstraction and implements
`Fs::watch` for linux and windows.
TODO:
- [x] Figure out why this fails to initialize the file watchers when we
have to initialize the config directory paths, but succeeds on
subsequent runs.
- [x] Fix macOS dependencies on old fsevents::Event crate
Release Notes:
- N/A
2024-03-08 22:18:44 -08:00
Marshall Bowers
ca6e1659eb
Move Clippy configuration to the workspace level ( #8891 )
...
This PR moves the Clippy configuration up to the workspace level.
We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table )
to configure the Clippy ruleset in the workspace's `Cargo.toml`.
Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:
```toml
[lints]
workspace = true
```
This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:
```json
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy"
}
}
}
}
```
Release Notes:
- N/A
2024-03-05 12:01:17 -05:00
Marshall Bowers
e66a8a8794
Enable clippy::crate_in_macro_def ( #8845 )
...
This PR enables the
[`clippy::crate_in_macro_def`](https://rust-lang.github.io/rust-clippy/master/index.html#/crate_in_macro_def )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-04 13:37:23 -05:00
Marshall Bowers
64bd0bc6ea
Enable clippy::redundant_closure_call ( #8840 )
...
This PR enables the
[`clippy::redundant_closure_call`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure_call )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-04 12:38:18 -05:00
Marshall Bowers
3b3be0b5fb
Enable clippy::iter_overeager_cloned ( #8839 )
...
This PR enables the
[`clippy::iter_overeager_cloned`](https://rust-lang.github.io/rust-clippy/master/index.html#/iter_overeager_cloned )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-04 12:22:11 -05:00
Marshall Bowers
108309b45f
Enable clippy::derivable_impls ( #8836 )
...
This PR enables the
[`clippy::derivable_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#/derivable_impls )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-04 11:47:07 -05:00
Marshall Bowers
3d557c9a0f
Enable clippy::iter_kv_map ( #8832 )
...
This PR enables the
[`clippy::iter_kv_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/iter_kv_map )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-04 10:54:33 -05:00
Marshall Bowers
8a67ff2ef2
Enable clippy::needless_update ( #8830 )
...
This PR enables the
[`clippy::needless_update`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_update )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-04 10:35:07 -05:00
Marshall Bowers
c5aa3d6780
Enable clippy::default_constructed_unit_structs ( #8778 )
...
This PR enables the
[`clippy::default_constructed_unit_structs`](https://rust-lang.github.io/rust-clippy/master/index.html#/default_constructed_unit_structs )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 12:07:53 -05:00
Marshall Bowers
2f3f7cccdd
Enable clippy::needless_lifetimes ( #8777 )
...
This PR enables the
[`clippy::needless_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_lifetimes )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 11:52:58 -05:00
Marshall Bowers
db02f38239
Enable clippy::explicit_counter_loop ( #8776 )
...
This PR enables the
[`clippy::explicit_counter_loop`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_counter_loop )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 11:40:22 -05:00
Marshall Bowers
ae545662dd
Enable clippy::needless_option_as_deref ( #8775 )
...
This PR enables the
[`clippy::needless_option_as_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_option_as_deref )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 11:16:27 -05:00
Marshall Bowers
62a9a8d30f
Enable clippy::identity_op ( #8773 )
...
This PR enables the
[`clippy::identity_op`](https://rust-lang.github.io/rust-clippy/master/index.html#/identity_op )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 11:05:08 -05:00
Marshall Bowers
232f95d3c6
Enable clippy::vec_init_then_push ( #8771 )
...
This PR enables the
[`clippy::vec_init_then_push`](https://rust-lang.github.io/rust-clippy/master/index.html#/vec_init_then_push )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 10:53:23 -05:00
Marshall Bowers
3b1b7ceed7
Enable clippy::redundant_guards ( #8770 )
...
This PR enables the
[`clippy::redundant_guards`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_guards )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 10:43:13 -05:00
Marshall Bowers
910c103a69
Enable clippy::bool_comparison ( #8769 )
...
This PR enables the
[`clippy::bool_comparison`](https://rust-lang.github.io/rust-clippy/master/index.html#/bool_comparison )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 10:34:30 -05:00
Marshall Bowers
ffa783e55d
Enable clippy::expect_fun_call ( #8768 )
...
This PR enables the
[`clippy::expect_fun_call`](https://rust-lang.github.io/rust-clippy/master/index.html#/expect_fun_call )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 10:27:37 -05:00
Marshall Bowers
20437044d5
Enable clippy::useless_conversion ( #8767 )
...
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 10:22:55 -05:00
Marshall Bowers
d3a531aba7
Enable clippy::needless_question_mark ( #8759 )
...
This PR enables the
[`clippy::needless_question_mark`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_question_mark )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 23:40:39 -05:00
Marshall Bowers
fe04edc0de
Enable clippy::useless_format ( #8758 )
...
This PR enables the
[`clippy::useless_format`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_format )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 23:31:58 -05:00
Marshall Bowers
6b71baa54e
Enable clippy::unnecessary_unwrap ( #8756 )
...
This PR enables the
[`clippy::unnecessary_unwrap`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_unwrap )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 23:10:56 -05:00
Marshall Bowers
8e9a4ce6eb
Enable clippy::nonminimal_bool ( #8755 )
...
This PR enables the
[`clippy::nonminimal_bool`](https://rust-lang.github.io/rust-clippy/master/index.html#/nonminimal_bool )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 22:57:37 -05:00
Marshall Bowers
7e05bb450a
Enable clippy::extra_unused_lifetimes ( #8754 )
...
This PR enables the
[`clippy::extra_unused_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/extra_unused_lifetimes )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 22:43:00 -05:00
Marshall Bowers
ffd5c6c26d
Enable clippy::explicit_auto_deref ( #8753 )
...
This PR enables the
[`clippy::explicit_auto_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_auto_deref )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 22:30:18 -05:00
Marshall Bowers
09c78c6bc3
Enable clippy::unnecessary_operation ( #8752 )
...
This PR enables the
[`clippy::unnecessary_operation`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_operation )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 22:19:56 -05:00
Marshall Bowers
085c7f1179
Enable clippy::option_map_unit_fn ( #8751 )
...
This PR enables the
[`clippy::option_map_unit_fn`](https://rust-lang.github.io/rust-clippy/master/index.html#/option_map_unit_fn )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 22:08:37 -05:00
Marshall Bowers
af6e97049b
Enable clippy::redundant_locals ( #8750 )
...
This PR enables the
[`clippy::redundant_locals`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_locals )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 21:57:40 -05:00
Marshall Bowers
e977db6b94
Enable clippy::search_is_some ( #8748 )
...
This PR enables the
[`clippy::search_is_some`](https://rust-lang.github.io/rust-clippy/master/index.html#/search_is_some )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 21:46:30 -05:00
Marshall Bowers
bce6b9b886
Enable clippy::option_as_ref_deref ( #8747 )
...
This PR enables the
[`clippy::option_as_ref_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/option_as_ref_deref )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 21:36:42 -05:00
Marshall Bowers
32c917ccb7
Enable clippy::needless_borrowed_reference ( #8746 )
...
This PR enables the
[`clippy::needless_borrowed_reference`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrowed_reference )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 21:24:56 -05:00
Marshall Bowers
f2686cf443
Enable clippy::drain_collect ( #8745 )
...
This PR enables the
[`clippy::drain_collect`](https://rust-lang.github.io/rust-clippy/master/index.html#/drain_collect )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 21:14:42 -05:00
Marshall Bowers
e2fe71fbbc
Enable clippy::needless_arbitrary_self_type ( #8743 )
...
This PR enables the
[`clippy::needless_arbitrary_self_type`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_arbitrary_self_type )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 21:04:49 -05:00
Marshall Bowers
16e365ec42
Enable clippy::unit_arg ( #8742 )
...
This PR enables the
[`clippy::unit_arg`](https://rust-lang.github.io/rust-clippy/master/index.html#/unit_arg )
rule and suppresses the false positive that it flags.
Release Notes:
- N/A
2024-03-02 20:59:41 -05:00
Marshall Bowers
d88c1ee8c8
Enable clippy::filter_map_identity ( #8741 )
...
This PR enables the
[`clippy::filter_map_identity`](https://rust-lang.github.io/rust-clippy/master/index.html#/filter_map_identity )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 20:48:29 -05:00
Marshall Bowers
0b8b723044
Enable clippy::unnecessary_find_map ( #8740 )
...
This PR enables the
[`clippy::unnecessary_find_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_find_map )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 20:39:03 -05:00
Marshall Bowers
e14f6b0b26
Enable clippy::manual_flatten ( #8739 )
...
This PR enables the
[`clippy::manual_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#/manual_flatten )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 20:28:26 -05:00
Marshall Bowers
1d80e76963
Enable clippy::unnecessary_filter_map ( #8738 )
...
This PR enables the
[`clippy::unnecessary_filter_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_filter_map )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 20:16:54 -05:00
Marshall Bowers
cf81943b17
Enable clippy::manual_find ( #8737 )
...
This PR enables the
[`clippy::manual_find`](https://rust-lang.github.io/rust-clippy/master/index.html#/manual_find )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 20:03:49 -05:00
Marshall Bowers
9da3eef9e1
Enable clippy::too_many_arguments ( #8734 )
...
This PR enables the
[`clippy::too_many_arguments`](https://rust-lang.github.io/rust-clippy/master/index.html#/too_many_arguments )
rule.
I opted to add `#[allow(clippy::too_many_arguments)]` on the individual
violations, as reworking them to take fewer arguments is a more involved
task.
Release Notes:
- N/A
2024-03-02 18:42:05 -05:00
Marshall Bowers
6a762a2517
Enable clippy::map_flatten ( #8733 )
...
This PR enables the
[`clippy::map_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#/map_flatten )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 18:24:22 -05:00
Marshall Bowers
cd772439f4
Enable clippy::to_string_in_format_args ( #8732 )
...
This PR enables the
[`clippy::to_string_in_format_args`](https://rust-lang.github.io/rust-clippy/master/index.html#/to_string_in_format_args )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 18:13:49 -05:00
Marshall Bowers
74876d90b8
Enable clippy::map_identity ( #8731 )
...
This PR enables the
[`clippy::map_identity`](https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-02 18:02:39 -05:00