Improve context expansion (#10957)
Release Notes: - Improved expand excerpt indicators to allow unidirectional expansion. Also added the `editor::ExpandExcerptsUp` and `editor::ExpandExcerptsDown` actions, which can both take a `lines` parameter. Also added a `expand_excerpt_lines` setting which controls the default number of lines that the indicators and actions use. --------- Co-authored-by: conrad <conrad@zed.dev>
This commit is contained in:
parent
a0f91299dd
commit
a9e3d4ec4e
27 changed files with 904 additions and 328 deletions
|
@ -2662,8 +2662,8 @@ pub mod tests {
|
|||
});
|
||||
|
||||
cx.executor().run_until_parked();
|
||||
let editor =
|
||||
cx.add_window(|cx| Editor::for_multibuffer(multibuffer, Some(project.clone()), cx));
|
||||
let editor = cx
|
||||
.add_window(|cx| Editor::for_multibuffer(multibuffer, Some(project.clone()), true, cx));
|
||||
|
||||
let editor_edited = Arc::new(AtomicBool::new(false));
|
||||
let fake_server = fake_servers.next().await.unwrap();
|
||||
|
@ -2871,6 +2871,7 @@ pub mod tests {
|
|||
"main hint #5".to_string(),
|
||||
"other hint(edited) #0".to_string(),
|
||||
"other hint(edited) #1".to_string(),
|
||||
"other hint(edited) #2".to_string(),
|
||||
];
|
||||
assert_eq!(
|
||||
expected_hints,
|
||||
|
@ -2881,8 +2882,8 @@ pub mod tests {
|
|||
assert_eq!(expected_hints, visible_hint_labels(editor, cx));
|
||||
|
||||
let current_cache_version = editor.inlay_hint_cache().version;
|
||||
// We expect two new hints for the excerpts from `other.rs`:
|
||||
let expected_version = last_scroll_update_version + 2;
|
||||
// We expect three new hints for the excerpts from `other.rs`:
|
||||
let expected_version = last_scroll_update_version + 3;
|
||||
assert_eq!(
|
||||
current_cache_version,
|
||||
expected_version,
|
||||
|
@ -2970,8 +2971,8 @@ pub mod tests {
|
|||
assert!(!buffer_2_excerpts.is_empty());
|
||||
|
||||
cx.executor().run_until_parked();
|
||||
let editor =
|
||||
cx.add_window(|cx| Editor::for_multibuffer(multibuffer, Some(project.clone()), cx));
|
||||
let editor = cx
|
||||
.add_window(|cx| Editor::for_multibuffer(multibuffer, Some(project.clone()), true, cx));
|
||||
let editor_edited = Arc::new(AtomicBool::new(false));
|
||||
let fake_server = fake_servers.next().await.unwrap();
|
||||
let closure_editor_edited = Arc::clone(&editor_edited);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue