Max Brunsfeld and Nathan Sobo
cefb63936d
Tweak diagnostic header styling
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-01-25 15:33:49 -08:00
Nathan Sobo and Max Brunsfeld
0c6fd157ee
Scale diagnostic headers icons with editor font and right align w/ line numbers
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-01-25 12:40:53 -07:00
Max Brunsfeld and Nathan Sobo
1a672929e0
Adjust BlockMap tests to reflect new tiebreaking behavior
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-01-12 12:11:55 -08:00
Max Brunsfeld and Nathan Sobo
6ad9ff10c1
Ensure path headers appear before first diagnostic header
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-01-12 10:51:28 -08:00
Max Brunsfeld
b5ee095da9
Deduplicate path names in the project diagnostics view
2022-01-12 10:51:08 -08:00
Antonio Scandurra
0742640b39
Correctly report line boundaries when a map contains both folds and wraps
...
This fixes the randomized test failures that were occurring on main.
2022-01-10 11:26:48 +01:00
Nathan Sobo and Antonio Scandurra
d7a78e14ac
Allow disk-based diagnostic progress begin/end events to interleave
...
When multiple saves occur, we can have multiple start events followed by multiple end events. We don't want to update our project diagnostics view until all pending progress is finished.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-01-06 09:32:08 -07:00
Nathan Sobo
6d6a82655a
Create blocks with anchors to allow a bias to be specified
...
This allows us to respect the bias on anchors we use to create excerpt headers so that they always remain above any content inserted at the start of an excerpt.
2021-12-30 01:03:19 -08:00
Nathan Sobo
7f786ca8a6
WIP: Start moving toward a simpler interface for detecting prev/next line boundaries
2021-12-27 22:11:05 -08:00
Max Brunsfeld
a86ba57983
Add Editor::remove_blocks
2021-12-22 17:30:14 -08:00
Antonio Scandurra and Max Brunsfeld
eec1748dc7
Render excerpt headers using DisplayMap::insert_blocks
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-12-21 18:32:27 +01:00
Antonio Scandurra
91c786a8db
WIP: Insert blocks in BlockMap for MultiBuffer headers
2021-12-21 17:38:03 +01:00
Max Brunsfeld
6444fcd442
Integrate MultiBuffer::buffer_rows into the display map
2021-12-16 13:53:32 -08:00
Antonio Scandurra
0fc2db6d6e
Account for folds when inserting/removing block decorations
2021-12-16 16:44:15 +01:00
Antonio Scandurra
de679cae78
Re-enable creating multiple blocks at once in BlockMap tests
2021-12-16 12:41:48 +01:00
Antonio Scandurra
64e2f6d506
Ensure BlockMap::clip_point always yield a valid buffer location
2021-12-16 12:29:37 +01:00
Antonio Scandurra
ec39c9d335
Allow specifying MAX_EXCERPTS via an env variable in random tests
2021-12-16 12:28:54 +01:00
Max Brunsfeld and Nathan Sobo
3e2f684545
Fix prev_row_boundary when a wrap follows a fold
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 18:30:09 -08:00
Max Brunsfeld and Nathan Sobo
4c22774694
Always clip buffer points when clipping display points
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 17:58:24 -08:00
Max Brunsfeld
f898dc6dae
Guard against inverted ranges when building edits in unfold
...
The multibuffer lets you refer to offsets inside of headers,
so it's possible to create a fold that appears non-empty,
but which spans zero characters in the underlying buffers.
Fold ranges are biased inward: the start is biased right, and
the end is biased left.
Because of these two things, it's possible to create a fold
that becomes "inverted" when you insert text at that position.
2021-12-15 17:29:15 -08:00
cec0c5912c
Create multiple excerpts in random BlockMap test
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 10:21:11 -08:00
80abd84050
Create MultiBuffers with more than one fragment in more randomized tests
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-12-15 18:38:37 +01:00
Antonio Scandurra and Nathan Sobo
5118f27a90
Overhaul MultiBuffer::chunks
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 17:22:04 +01:00
Antonio Scandurra and Nathan Sobo
bcdb4ffd88
Allow edits at the end of MultiBuffer
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 16:45:01 +01:00
Antonio Scandurra and Nathan Sobo
7bbaa1d930
Don't insert a newline after the last excerpt of a MultiBuffer
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 16:39:09 +01:00
Antonio Scandurra and Nathan Sobo
ae0fa75abe
Start testing the integration of display layers with MultiBuffers
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-15 16:05:26 +01:00
Nathan Sobo and Max Brunsfeld
6c5b27af1d
Group diagnostics by primary
...
Render primary message above the excerpt and supporting messages as block decorations with a `Below` disposition. This is still super rough.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-12-14 18:26:42 -07:00
Nathan Sobo
c8b43e3078
Move multi_buffer to editor crate
2021-12-10 17:37:53 -07:00
Max Brunsfeld
a758bd4f8d
Fill in some missing methods on MultiBuffer, MultiBufferSnapshot
2021-12-10 14:27:04 -08:00
Antonio Scandurra and Nathan Sobo
7524974f19
Get everything compiling again
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-10 17:15:16 +01:00
Nathan Sobo and Max Brunsfeld
87d16c271e
Get Editor compiling with MultiBuffer as its buffer
...
There's a bunch of unimplemented methods in MultiBuffer, but everything compiles.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-12-08 19:23:04 -07:00
5f8e406c18
Fill out ExcerptList API
...
This restores the improvements that we had made on the `project-diagnostics-generic` branch.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-08 10:04:22 -08:00
Max Brunsfeld
6a44a7448e
Consolidate Edit types in editor crate
2021-12-08 09:33:55 -08:00
Max Brunsfeld
fa379885f1
Give more specific names to all snapshot and text iterator types
2021-12-08 09:24:00 -08:00
Nathan Sobo
811696670a
Start on a new FragmentList
...
Here I'm exploring a new approach to the project-wide diagnostics view that can exactly mirror the contents of cargo check. The `FragmentList` composes an arbitrary list of fragments from other buffers and presents them as if they were a single buffer.
2021-12-04 06:57:56 -07:00
Nathan Sobo and Max Brunsfeld
5ae46709b0
Fix alignment of blocks adjacent to other blocks
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-12-01 17:58:44 -07:00
Nathan Sobo and Max Brunsfeld
ee693a8d2b
Get all tests passing with new blocks API
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-12-01 17:52:34 -07:00
Nathan Sobo and Max Brunsfeld
512a10b037
Use new BlockMap API to render diagnostics
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-12-01 17:22:40 -07:00
Max Brunsfeld and Nathan Sobo
0c714210ff
Start work on generalizing the BlockMap to allow arbitrary elements
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-01 15:25:55 -08:00
Antonio Scandurra and Nathan Sobo
3b536f153f
Introduce text::Buffer::subscribe
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-01 15:55:05 +01:00
Antonio Scandurra
47c467dafc
Bump FoldMap's version in FoldMap::sync (and not in DisplayMap)
2021-12-01 12:05:02 +01:00
Max Brunsfeld and Nathan Sobo
faba276fdc
WIP - maintain foldmap with Buffer::edits_since
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-30 17:23:02 -08:00
Max Brunsfeld
924e1578ea
Use &Snapshot directly instead of impl Into<Content<'a>>
...
The text::Buffer and its snapshot already used the same representation
for their content, so we can just make Buffer deref to a Snapshot.
2021-11-30 13:32:11 -08:00
Nathan Sobo and Max Brunsfeld
d3f28166cb
Rename buffer crate to text and name its entrypoint after the crate
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-11-30 12:26:12 -07:00
Nathan Sobo and Antonio Scandurra
0ed488d93b
Avoid building up pending edits when soft wrapping is disabled
...
This was causing us to get slower over time as we stacked up hundreds of thousands of pending edits whenever soft wrap was disabled.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2021-11-30 08:28:29 -07:00
Antonio Scandurra
6f5ca6064b
Use anchor_after in randomized tests to match BlockMap
2021-11-19 18:04:31 +01:00
Antonio Scandurra and Nathan Sobo
8e74cc178e
Invalidate active diagnostics when they are removed
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-19 16:15:22 +01:00
Antonio Scandurra and Nathan Sobo
61d8848b31
Make BlockMap::sync private
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-19 15:44:19 +01:00
Antonio Scandurra
dfbfa86548
WIP
2021-11-19 15:31:33 +01:00
Antonio Scandurra and Nathan Sobo
2664dad2bc
Allow styling of invalid diagnostics
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-19 14:35:00 +01:00