Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New diff map #22129

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
159c223
Stub in the structure of a DiffMap to go in the display map stack
maxbrunsfeld Dec 5, 2024
67ffe99
Start work on DiffMapSnapshot::chunks
maxbrunsfeld Dec 5, 2024
90c9ad4
Get DiffMapChunks working to some degree
maxbrunsfeld Dec 5, 2024
09082d1
Implement DiffMap::set_all_hunks_expanded
maxbrunsfeld Dec 5, 2024
d0a8b0f
Start work on returning edits from DiffMap::sync
maxbrunsfeld Dec 5, 2024
440b632
Start work on expanding and collapsing hunks
maxbrunsfeld Dec 6, 2024
011880c
Start work on expanding and collapsing hunks by range
maxbrunsfeld Dec 9, 2024
946ae93
Compute diff map edits in a single pass through the old and new trees
maxbrunsfeld Dec 10, 2024
023f923
Restructure DiffMap::sync to prepare for handling buffer edits
maxbrunsfeld Dec 11, 2024
3383353
Get DiffMap::sync working for a basic test
maxbrunsfeld Dec 11, 2024
a20715d
Start implementing DiffMap::buffer_rows
maxbrunsfeld Dec 11, 2024
61e42b9
Integrate DiffMap into the DisplayMap
maxbrunsfeld Dec 12, 2024
dac0a07
Merge branch 'main' into new-diff-map
maxbrunsfeld Dec 12, 2024
20ec116
Implement to_offset/to_point
ConradIrwin Dec 12, 2024
2630dfd
implement clip_point
ConradIrwin Dec 12, 2024
9dc5eba
better naming?
ConradIrwin Dec 12, 2024
a8a9177
implement text_summary_for_range
ConradIrwin Dec 12, 2024
6e724c1
seek on DiffMapBufferRows
ConradIrwin Dec 12, 2024
e53d8bb
wip
maxbrunsfeld Dec 12, 2024
c015553
Get assertions about DiffMap::chunks passing
maxbrunsfeld Dec 12, 2024
99edc95
Fix DiffMap::buffer_rows to handle last empty line of buffer
maxbrunsfeld Dec 12, 2024
ad87dfe
Get more editor tests passing
maxbrunsfeld Dec 12, 2024
dc814cb
Start integrating the new DiffMap into the editor
maxbrunsfeld Dec 12, 2024
cc4ecac
Fix dropping of ChangeSet in DiffMap
maxbrunsfeld Dec 12, 2024
9b526a4
Start work on providing git statuses for each line of diff map
maxbrunsfeld Dec 12, 2024
b552e32
Replace buffer rows iterators with row info iterators that also give …
maxbrunsfeld Dec 13, 2024
07eb573
Highlight background of expanded hunks
maxbrunsfeld Dec 13, 2024
9025fb2
Update more editor rendering to use the new DiffMap
maxbrunsfeld Dec 13, 2024
243d7c6
WIP - Failing diff map test for hunks staying expanded on diff updates
maxbrunsfeld Dec 13, 2024
41c5e45
Fix bugs in DiffMap's handling of edits and diff updates
ConradIrwin Dec 13, 2024
82fbe27
Fix some problems with expanding and collapsing diff hunks
maxbrunsfeld Dec 14, 2024
4369890
Move logic for defining edits outside of recompute_transforms
maxbrunsfeld Dec 14, 2024
2266b3c
Perform the same range expansion in `has_expanded_diff_hunks_in_ranges`
maxbrunsfeld Dec 14, 2024
1f28437
Sync display map immediately when updating diff state
maxbrunsfeld Dec 14, 2024
093c3d3
Add failing unit test for editing inside of an insertion hunk
maxbrunsfeld Dec 14, 2024
472fee6
When buffer is edited, compute DiffMap edits using deltas
maxbrunsfeld Dec 16, 2024
f6aa7df
Make EditorTestContext::assert_state_with_diff use new DiffMap
maxbrunsfeld Dec 16, 2024
241c7a6
Extract logic around custom text highlights out of InlayChunks iterator
maxbrunsfeld Dec 16, 2024
88b4628
rewrite diff map to not depend on inlay map
ConradIrwin Dec 16, 2024
2625719
Put DiffMap before InlayMap in DisplayMap
maxbrunsfeld Dec 16, 2024
2f5ea92
Fix bugs in DiffMap::sync
maxbrunsfeld Dec 16, 2024
87d50ee
Fix handling of modified empty lines in assert_state_with_diff helper
maxbrunsfeld Dec 17, 2024
5cc3bd1
Fix collapsing of hunks when base text changes
maxbrunsfeld Dec 17, 2024
9450de7
Remove more of the old DiffMap
maxbrunsfeld Dec 17, 2024
c160ce6
handle diff chunks with no trailing newline
ConradIrwin Dec 17, 2024
d600c58
fix test toggle diff hunks (again)
ConradIrwin Dec 17, 2024
d1239f6
fix test_edits_around_expanded_deletion_hunks
ConradIrwin Dec 17, 2024
2b68817
Fix test_{addition,deletion,modification}_reverts
ConradIrwin Dec 17, 2024
0b3715a
Add DisplayAnchor
ConradIrwin Dec 17, 2024
2cca833
Add cmp
ConradIrwin Dec 17, 2024
062b4a2
Merge branch 'main' into new-diff-map
ConradIrwin Dec 17, 2024
7adcf90
fix merge conflicts
ConradIrwin Dec 17, 2024
df81a91
WIPWIPWIPWIPW
ConradIrwin Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 28 additions & 4 deletions crates/collab/src/tests/editor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use editor::{
ConfirmCodeAction, ConfirmCompletion, ConfirmRename, ContextMenuFirst, Redo, Rename,
ToggleCodeActions, Undo,
},
display_map::RowInfo,
test::editor_test_context::{AssertionContextManager, EditorTestContext},
Editor,
};
Expand All @@ -20,7 +21,6 @@ use language::{
language_settings::{AllLanguageSettings, InlayHintSettings},
FakeLspAdapter,
};
use multi_buffer::MultiBufferRow;
use project::{
project_settings::{InlineBlameSettings, ProjectSettings},
SERVER_PROGRESS_THROTTLE_TIMEOUT,
Expand Down Expand Up @@ -2075,7 +2075,15 @@ async fn test_git_blame_is_forwarded(cx_a: &mut TestAppContext, cx_b: &mut TestA
let blame = editor_b.blame().expect("editor_b should have blame now");
let entries = blame.update(cx, |blame, cx| {
blame
.blame_for_rows((0..4).map(MultiBufferRow).map(Some), cx)
.blame_for_rows(
&(0..4)
.map(|row| RowInfo {
buffer_row: Some(row),
..Default::default()
})
.collect::<Vec<_>>(),
cx,
)
.collect::<Vec<_>>()
});

Expand Down Expand Up @@ -2114,7 +2122,15 @@ async fn test_git_blame_is_forwarded(cx_a: &mut TestAppContext, cx_b: &mut TestA
let blame = editor_b.blame().expect("editor_b should have blame now");
let entries = blame.update(cx, |blame, cx| {
blame
.blame_for_rows((0..4).map(MultiBufferRow).map(Some), cx)
.blame_for_rows(
&(0..4)
.map(|row| RowInfo {
buffer_row: Some(row),
..Default::default()
})
.collect::<Vec<_>>(),
cx,
)
.collect::<Vec<_>>()
});

Expand All @@ -2141,7 +2157,15 @@ async fn test_git_blame_is_forwarded(cx_a: &mut TestAppContext, cx_b: &mut TestA
let blame = editor_b.blame().expect("editor_b should have blame now");
let entries = blame.update(cx, |blame, cx| {
blame
.blame_for_rows((0..4).map(MultiBufferRow).map(Some), cx)
.blame_for_rows(
&(0..4)
.map(|row| RowInfo {
buffer_row: Some(row),
..Default::default()
})
.collect::<Vec<_>>(),
cx,
)
.collect::<Vec<_>>()
});

Expand Down
Loading
Loading