Merge branch 'main' into collab-panel

This commit is contained in:
Mikayla
2023-08-15 03:25:45 -07:00
54 changed files with 1233 additions and 679 deletions
+23 -19
View File
@@ -7952,7 +7952,8 @@ async fn test_mutual_editor_inlay_hint_cache_update(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, edits_made,
inlay_cache.version(),
edits_made,
"Host editor update the cache version after every cache/view change",
);
});
@@ -7975,7 +7976,8 @@ async fn test_mutual_editor_inlay_hint_cache_update(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, edits_made,
inlay_cache.version(),
edits_made,
"Guest editor update the cache version after every cache/view change"
);
});
@@ -7995,7 +7997,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
"Host should get hints from the 1st edit and 1st LSP query"
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(inlay_cache.version, edits_made);
assert_eq!(inlay_cache.version(), edits_made);
});
editor_b.update(cx_b, |editor, _| {
assert_eq!(
@@ -8009,7 +8011,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
"Guest should get hints the 1st edit and 2nd LSP query"
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(inlay_cache.version, edits_made);
assert_eq!(inlay_cache.version(), edits_made);
});
editor_a.update(cx_a, |editor, cx| {
@@ -8034,7 +8036,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
4th query was made by guest (but not applied) due to cache invalidation logic"
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(inlay_cache.version, edits_made);
assert_eq!(inlay_cache.version(), edits_made);
});
editor_b.update(cx_b, |editor, _| {
assert_eq!(
@@ -8050,7 +8052,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
"Guest should get hints from 3rd edit, 6th LSP query"
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(inlay_cache.version, edits_made);
assert_eq!(inlay_cache.version(), edits_made);
});
fake_language_server
@@ -8076,7 +8078,8 @@ async fn test_mutual_editor_inlay_hint_cache_update(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, edits_made,
inlay_cache.version(),
edits_made,
"Host should accepted all edits and bump its cache version every time"
);
});
@@ -8097,7 +8100,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version,
inlay_cache.version(),
edits_made,
"Guest should accepted all edits and bump its cache version every time"
);
@@ -8263,7 +8266,8 @@ async fn test_inlay_hint_refresh_is_forwarded(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, 0,
inlay_cache.version(),
0,
"Host should not increment its cache version due to no changes",
);
});
@@ -8278,7 +8282,8 @@ async fn test_inlay_hint_refresh_is_forwarded(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, edits_made,
inlay_cache.version(),
edits_made,
"Guest editor update the cache version after every cache/view change"
);
});
@@ -8295,7 +8300,8 @@ async fn test_inlay_hint_refresh_is_forwarded(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, 0,
inlay_cache.version(),
0,
"Host should not increment its cache version due to no changes",
);
});
@@ -8310,7 +8316,8 @@ async fn test_inlay_hint_refresh_is_forwarded(
);
let inlay_cache = editor.inlay_hint_cache();
assert_eq!(
inlay_cache.version, edits_made,
inlay_cache.version(),
edits_made,
"Guest should accepted all edits and bump its cache version every time"
);
});
@@ -8318,13 +8325,10 @@ async fn test_inlay_hint_refresh_is_forwarded(
fn extract_hint_labels(editor: &Editor) -> Vec<String> {
let mut labels = Vec::new();
for (_, excerpt_hints) in &editor.inlay_hint_cache().hints {
let excerpt_hints = excerpt_hints.read();
for (_, inlay) in excerpt_hints.hints.iter() {
match &inlay.label {
project::InlayHintLabel::String(s) => labels.push(s.to_string()),
_ => unreachable!(),
}
for hint in editor.inlay_hint_cache().hints() {
match hint.label {
project::InlayHintLabel::String(s) => labels.push(s),
_ => unreachable!(),
}
}
labels