Commit Graph
355 Commits
Author SHA1 Message Date
Marshall Bowers 9735912965 Enable clippy::clone_on_copy (#8728)
This PR enables the
[`clippy::clone_on_copy`](https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_copy)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:37:48 -05:00
Marshall Bowers 4b81b15cad Enable clippy::useless_conversion (#8724)
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-02 16:31:47 -05:00
Piotr Osiewicz 0f584cb353 chore: Extract languages from zed crate (#8270)
- Moves languages module from `zed` into a separate crate. That way we
have less of a long pole at the end of compilation.
- Removes moot dependencies on editor/picker. This is totally harmless
and might help in the future if we decide to decouple picker from
editor.

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

Release Notes:

- N/A
2024-02-23 15:56:08 +01:00
FelipeandConrad Irwin a82f4857f4 Add settings to control gutter elements (#7665)
The current gutter was a bit too big for my taste, so I added some
settings to change which visual elements are shown, including being able
to hide the gutter completely.

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

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

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

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

## Screenshots:

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

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

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

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


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



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

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-22 20:37:13 -07:00
vultixandNathan Sobo 8aa5319210 Add documentation to many core editor types (#7919)
Hopefully this makes it a bit easier for new contributors to dive into
the codebase :)

Release Notes:

- Improved documentation for many core editor types

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-17 09:03:05 -07:00
Conrad Irwinandfdionisi 1a82470897 Open URLs with cmd-click (#7312)
Release Notes:

- Added ability to cmd-click on URLs in all buffers

---------

Co-authored-by: fdionisi <code@fdionisi.me>
2024-02-02 22:05:28 -07:00
Conrad Irwin 450cf9dd06 Fix rendering of diagnostic blocks
- Distinct colors to make it not confusing
- Avoid overflowing the edge of the editor when the message is long
2024-01-23 16:28:58 -07:00
Mikayla c05edee2b5 Port the rest of the app 2024-01-21 20:26:33 -08:00
Piotr Osiewicz 9506fa461f Start documenting display_map module 2024-01-18 16:38:06 +01:00
Piotr OsiewiczandKirill 6cbc49e5f0 Editor docs (#4097)
Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-01-18 00:48:37 +01:00
a98d048905 gpui: Make TextSystem::line_wrapper non-fallible. (#4022)
Editors WrapMap could become desynchronised if user had an invalid font
specified in their config. Compared to Zed1, WrapMap ignored the
resolution failure instead of panicking. Now, if there's an invalid font
in the user config, we just fall back to an arbitrary default.


Release Notes:
- Fixed the editor panic in presence of invalid font name in the config
(fixes https://github.com/zed-industries/community/issues/2397)

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-01-11 18:52:00 +01:00
Mikayla 7ef88397c9 Fix seg fault when using the WindowContext::on_window_should_close() API 2024-01-10 11:26:11 -08:00
Max BrunsfeldandMikayla 588976d27a Remove 2 suffix for editor
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 10:58:57 -08:00
Piotr Osiewicz 7f6bb3d1eb Extract multi_buffer module out of editor (#3170)
Release Notes:

- N/A
2023-10-25 19:31:47 +02:00
Kirill Bulatov e7b5880af0 Combine both text and inlay highlights in randomized tests 2023-09-14 23:53:56 +03:00
Kirill Bulatov f9b70718ac Store hints in the map, not the snapshot 2023-09-14 23:36:33 +03:00
Kirill Bulatov 4e9f0adcef Improve inlay hint cache lookup 2023-09-14 23:31:50 +03:00
Kirill Bulatov 8ae3f79235 Restructure inlay highlights data for proper access 2023-09-14 23:05:22 +03:00
Kirill Bulatov 396efec6e1 Uncomment the rest of the tests 2023-09-14 22:18:26 +03:00
Kirill Bulatov 47e0535f1c Randomize inlay highlight range start 2023-09-14 22:08:12 +03:00
Kirill Bulatov 129fb62182 Consider offsets in inlay chunks 2023-09-14 22:08:12 +03:00
Kirill BulatovandAntonio Scandurra a9de6c3dba Properly handle inlay highlights in the InlayMap
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-09-14 22:08:12 +03:00
Kirill Bulatov 80b96eb05b Add inlay highlight test 2023-09-14 22:08:12 +03:00
Kirill Bulatov 42bd2be2f3 Implement inlay highlighting 2023-09-14 22:08:12 +03:00
Kirill Bulatov 890a587254 Use standalone inlay background highlights 2023-09-14 22:08:12 +03:00
Kirill Bulatov 9f5314e938 Unify highlights in *Map 2023-09-14 22:08:12 +03:00
Kirill Bulatov 6c00cd8a35 Do not combine inlay and text highlights on the *Map level 2023-09-14 22:08:12 +03:00
Kirill Bulatov 852427e87b Use inlay highlights in randomized tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 7cd60d6afb Simplify and restore client resolve capabilities 2023-08-25 14:26:17 +03:00
Kirill Bulatov dcf570bb03 Fix resolve status conversion 2023-08-25 14:26:17 +03:00
Kirill Bulatov bcaff0a18a Propagate inlay background highlights to data storage 2023-08-25 14:26:17 +03:00
Kirill Bulatov 4b78678923 Prepare background highlights for inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov 12ffbe54fb Unify text and inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov 420f8b7b15 Prepare for inlay and text highlight unification 2023-08-25 14:26:17 +03:00
Kirill BulatovandAntonio 4cc9f2f525 Highlight inlay hint parts on cmd-hover
Co-Authored-By: Antonio <antonio@zed.dev>
2023-08-25 14:26:17 +03:00
Kirill Bulatov f8874a726c Attempt to highlight inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov 6c5761d05b Pass inlay highlight information 2023-08-25 14:26:17 +03:00
Kirill Bulatov 477fc865f5 Properly resolve inlay label parts' locations and buffers 2023-08-25 14:26:17 +03:00
Kirill Bulatov 80e8714241 Send inlay hint resolve requests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 3434990b70 Store inlay hint resolve data 2023-08-25 14:26:17 +03:00
Max Brunsfeld a127b0d3e6 Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
Kirill Bulatov d7f6b5e1a0 Remove InlayProperties 2023-07-05 16:17:14 +03:00
Kirill Bulatov 6ba1c3071a Simplify inlay map data 2023-07-05 15:23:56 +03:00
Kirill Bulatov 43d4f04331 Do not add extra spaces to hints 2023-07-03 11:17:12 +03:00
Kirill BulatovandAntonio Scandurra bb9ade5b6f Fix wrap map test
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill BulatovandAntonio Scandurra 2b59f27c3b Fix fold map tests
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov 15e0feb91d Move highlights from fold to inlay randomized tests 2023-06-29 22:39:18 +03:00
Kirill Bulatov 480d8c511b Theme hints and suggestions differently 2023-06-29 22:39:18 +03:00
Kirill BulatovandAntonio Scandurra 3312c9114b Improve inlay hint highlights
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Antonio Scandurra f77b680db9 Account for inlay biases when clipping a point 2023-06-29 22:25:50 +03:00