Commit Graph
72 Commits
Author SHA1 Message Date
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
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
Kirill Bulatov 9f5314e938 Unify highlights in *Map 2023-09-14 22:08:12 +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 12ffbe54fb Unify text and inlay highlights 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 480d8c511b Theme hints and suggestions differently 2023-06-29 22:39:18 +03:00
Kirill Bulatov dfb30218ca Remove mutex usage from *Map contents 2023-06-29 22:25:50 +03:00
Kirill Bulatov 8c03e9e122 Move InlayId generation back to InlayCache 2023-06-29 22:25:49 +03:00
Kirill Bulatov 49c00fd571 Generate InlayIds in InlayMap, prepare InlayCache for refactoring 2023-06-29 22:25:49 +03:00
Kirill BulatovandAntonio Scandurra 10765d69f4 Move inlay map to be the first one
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill BulatovandAntonio Scandurra d2fef07782 Remove the SuggestionMap
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill BulatovandAntonio Scandurra 568a67c4d7 Implement more InlaySnapshot methods
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov 7397b8028c Simplify inlay hint version handling 2023-06-29 22:25:48 +03:00
Kirill Bulatov b5233b3ad5 Rename the new map 2023-06-29 22:25:48 +03:00
Kirill Bulatov 4c3c0eb796 Draft the hint render data flow 2023-06-29 22:25:48 +03:00
Kirill Bulatov 2ead3de7de Add basic infrastructure for inlay hints map 2023-06-29 22:25:48 +03:00
Max BrunsfeldandAntonio Scandurra 4f8607039c Add is_tab field to chunks
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-05-08 19:36:51 +03:00
Nathan Sobo 8136d8a8a6 Fix formatting 2023-04-06 15:54:44 -06:00
Nathan Sobo de9bf6dfbd Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
Mikayla Maki 81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07:00
Antonio Scandurra af4c4c7cf0 Speed up tab searching in TabMap::sync by looking for \t only
Instead of looking for `\n` as a stopping condition, we cap the range
we pass to `SuggestionSnapshot::chunks` to stop on the next line. This
makes character searching faster, because looking for a single character
uses `memchr`. Also, this avoids an extra conditional in a tight loop such
as the chunk scanning one contained in `TabMap::sync`.
2023-03-30 10:03:13 +02:00
Antonio Scandurra 79346b0706 Use + instead of | to break out of tab expansion in TabMap::sync 2023-03-30 09:49:07 +02:00
Mikayla Maki ae3b3ea458 Merge branch 'main' into copilot 2023-03-29 16:57:38 -07:00
Max Brunsfeld 0c07a373a8 🎨 2023-03-29 14:43:01 -07:00
Antonio Scandurra 49447128a9 Make edits smaller when tab expansion changes on a line 2023-03-29 21:40:37 +02:00
Antonio Scandurra b86f8188d1 Expand edit to end of the line when old/new row exceeds max expansion 2023-03-29 16:49:21 +02:00
Antonio Scandurra 719d0f0abf Rename skip_leading_tab to inside_leading_tab 2023-03-29 14:53:28 +02:00
Antonio Scandurra 813f722925 Increment input_column correctly when inside the leading tab 2023-03-29 14:52:50 +02:00
Max Brunsfeld 5c1f82ae3d Don't use TabMap::expand_tabs in line_indent_for_buffer_row 2023-03-28 17:37:57 -07:00
Max Brunsfeld 08e93e9321 Only expand tabs up until a limited column 2023-03-28 16:40:04 -07:00
Max Brunsfeld c23feeab3a 🎨 Make expand_tabs and collapse_tabs instance methods on TabSnapshot 2023-03-28 14:10:43 -07:00
Antonio Scandurra 6715e5247c Rework SuggestionMap to take highlight style when retrieving chunks 2023-03-28 09:42:01 -07:00
Antonio Scandurra 9c8732a355 Integrate SuggestionMap into the rest of DisplayMap 2023-03-21 16:39:02 +01:00
Mikayla Makiandmax 75bea91245 Convert code folding to be in terms of buffer points instead of display points
Co-authored-by: max <max@zed.dev>
2023-03-14 16:48:03 -07:00
Max Brunsfeld 6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Mikayla Maki 0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
ForLoveOfCatsandMikayla 8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
Antonio Scandurra 3174b08082 Update old snapshot when only the tab size changes 2022-08-03 12:23:02 +02:00
Antonio Scandurra 1e94eb74f4 Don't ignore new tab snapshot in WrapMap if only tab size changed 2022-08-03 12:16:46 +02:00
Antonio Scandurra d1f155337f Recompute layers above tab map entirely when tab size changes
Previously, we wouldn't generate any `TabEdit` when the tab size
changed, causing coordinate spaces in `WrapMap` and `BlockMap` to
become outdated.

This commit generates a synthetic edit that covers the entire `TabMap`
to ensure layers above are synchronized.
2022-08-03 11:06:17 +02:00
Keith Simmons 755636d10e Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Antonio Scandurra 91d4c835ad Introduce TabMap::line_len 2022-04-14 12:55:33 +02:00
Keith Simmons 1812480cbb Tab size is pulled properly from settings instead of hardcoded 2022-04-06 10:23:37 -07:00
Nathan Sobo 951fd1ab36 Merge branch 'main' into select-on-rename 2022-03-11 15:30:07 -07:00
Nathan Sobo e6b1fea117 WIP 2022-03-10 11:32:14 -07:00
Nathan Sobo 49e38e6e00 Eliminate ToFoldPoint trait
Just make it a method on FoldMap
2022-03-09 20:49:18 -07:00
Antonio Scandurra ab26a175a4 Opt into language-aware features when getting buffer chunks
We use chunks a lot to transform points and sync the various display maps,
and always querying tree-sitter or the LSP diagnostics in those cases is
unnecessarily expensive.
2022-02-03 11:21:30 +01:00