text: Wrap BufferId into a newtype

This commit is contained in:
Piotr Osiewicz 2024-01-28 21:05:08 +01:00
parent 941e838be9
commit 5ab715aac9
34 changed files with 687 additions and 383 deletions

View file

@ -21,6 +21,7 @@ use std::{
path::{Path, PathBuf},
sync::Arc,
};
use text::BufferId;
use util::{http::FakeHttpClient, test::temp_tree, ResultExt};
#[gpui::test]
@ -511,9 +512,11 @@ async fn test_open_gitignored_files(cx: &mut TestAppContext) {
let prev_read_dir_count = fs.read_dir_call_count();
let buffer = tree
.update(cx, |tree, cx| {
tree.as_local_mut()
.unwrap()
.load_buffer(0, "one/node_modules/b/b1.js".as_ref(), cx)
tree.as_local_mut().unwrap().load_buffer(
BufferId::new(1).unwrap(),
"one/node_modules/b/b1.js".as_ref(),
cx,
)
})
.await
.unwrap();
@ -553,9 +556,11 @@ async fn test_open_gitignored_files(cx: &mut TestAppContext) {
let prev_read_dir_count = fs.read_dir_call_count();
let buffer = tree
.update(cx, |tree, cx| {
tree.as_local_mut()
.unwrap()
.load_buffer(0, "one/node_modules/a/a2.js".as_ref(), cx)
tree.as_local_mut().unwrap().load_buffer(
BufferId::new(1).unwrap(),
"one/node_modules/a/a2.js".as_ref(),
cx,
)
})
.await
.unwrap();