Wrapping up bedrock implementation
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#![cfg_attr(not(feature = "local_fs"), allow(dead_code))]
|
||||
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use ignore::gitignore::Gitignore;
|
||||
use std::io;
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use thiserror::Error;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
|
||||
/// Maximum file size allowed for treesitter parsing (3MB).
|
||||
const MAX_FILE_SIZE: usize = 3 * 1000 * 1000;
|
||||
|
||||
@@ -2,10 +2,10 @@ mod file_tree_state;
|
||||
|
||||
use crate::file_tree_store::file_tree_state::FileTreeMapStore;
|
||||
use crate::{BuildTreeError, Entry, FileId, FileMetadata, Repository};
|
||||
use ignore::gitignore::Gitignore;
|
||||
use std::sync::Arc;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::ModelHandle;
|
||||
use ignore::gitignore::Gitignore;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FileTreeEntry {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use crate::file_tree_store::FileTreeEntry;
|
||||
use crate::file_tree_store::{FileTreeDirectoryEntryState, FileTreeEntryState};
|
||||
use crate::{BuildTreeError, DirectoryEntry, Entry};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use ignore::gitignore::Gitignore;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::iter;
|
||||
use std::sync::Arc;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(super) struct FileTreeMapStore {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::entry::{DirectoryEntry, Entry, FileId, FileMetadata};
|
||||
use crate::file_tree_store::{FileTreeEntry, FileTreeEntryState};
|
||||
use std::sync::Arc;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use std::sync::Arc;
|
||||
|
||||
fn std_path(s: &str) -> StandardizedPath {
|
||||
StandardizedPath::try_new(s).expect("test path should be valid")
|
||||
|
||||
@@ -2,8 +2,8 @@ use crate::entry::{DirectoryEntry, Entry, FileId, FileMetadata};
|
||||
use crate::file_tree_store::{FileTreeEntry, FileTreeEntryState};
|
||||
use crate::file_tree_update::*;
|
||||
use crate::local_model::LocalRepoMetadataModel;
|
||||
use std::path::{Path, PathBuf};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
// ── Helpers ──────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use thiserror::Error;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use thiserror::Error;
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
use galaxyui::SingletonEntity;
|
||||
|
||||
@@ -49,8 +49,8 @@ use crate::file_tree_update::{
|
||||
flatten_entry_metadata, DirectoryNodeMetadata, FileNodeMetadata, FileTreeEntryUpdate,
|
||||
RepoMetadataUpdate, RepoNodeMetadata,
|
||||
};
|
||||
use ignore::gitignore::Gitignore;
|
||||
use galaxyui::ModelContext;
|
||||
use ignore::gitignore::Gitignore;
|
||||
|
||||
/// Maximum depth to traverse when building file trees
|
||||
const MAX_TREE_DEPTH: usize = 200;
|
||||
|
||||
@@ -13,6 +13,9 @@ mod tests {
|
||||
use crate::watcher::DirectoryWatcher;
|
||||
use futures::channel::oneshot;
|
||||
use futures::executor::block_on;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::r#async::FutureExt as _;
|
||||
use galaxyui::App;
|
||||
use ignore::gitignore::Gitignore;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
@@ -20,9 +23,6 @@ mod tests {
|
||||
use std::rc::Rc;
|
||||
use std::time::Duration;
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::r#async::FutureExt as _;
|
||||
use galaxyui::App;
|
||||
|
||||
impl LocalRepoMetadataModel {
|
||||
fn new_for_test() -> Self {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use std::path::Path;
|
||||
use std::{collections::HashSet, future::Future, path::PathBuf};
|
||||
|
||||
#[cfg(test)]
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
#[cfg(test)]
|
||||
use galaxyui::r#async::FutureId;
|
||||
use galaxyui::{AppContext, Entity, ModelContext, ModelHandle};
|
||||
#[cfg(test)]
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
|
||||
use crate::DirectoryWatcher;
|
||||
use crate::Repository;
|
||||
|
||||
@@ -2,9 +2,9 @@ use std::fs;
|
||||
|
||||
use crate::repositories::{stub_git_repository, RepoDetectionSource};
|
||||
use crate::{repositories::DetectedRepositories, watcher::DirectoryWatcher};
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::App;
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
|
||||
#[test]
|
||||
fn test_detect_possible_git_repo_non_existent_directory() {
|
||||
|
||||
@@ -8,13 +8,13 @@ use std::time::Duration;
|
||||
use std::path::Path;
|
||||
|
||||
use futures::future::ready;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use ignore::gitignore::Gitignore;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::r#async::{BoxFuture, SpawnedFutureHandle};
|
||||
#[cfg(feature = "local_fs")]
|
||||
use galaxyui::SingletonEntity;
|
||||
use galaxyui::{Entity, ModelContext, ModelHandle};
|
||||
#[cfg(feature = "local_fs")]
|
||||
use ignore::gitignore::Gitignore;
|
||||
|
||||
#[cfg(feature = "local_fs")]
|
||||
use crate::watcher::DirectoryWatcher;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use serde_json::{json, Value};
|
||||
use strum_macros::{EnumDiscriminants, EnumIter};
|
||||
use galaxy_core::{
|
||||
register_telemetry_event,
|
||||
telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc},
|
||||
};
|
||||
use serde_json::{json, Value};
|
||||
use strum_macros::{EnumDiscriminants, EnumIter};
|
||||
|
||||
#[derive(Clone, EnumDiscriminants)]
|
||||
#[strum_discriminants(derive(EnumIter))]
|
||||
|
||||
@@ -11,10 +11,10 @@ use crate::watcher::{DirectoryWatcher, TaskQueue};
|
||||
use crate::{CanonicalizedPath, RepoMetadataError, Repository, RepositoryUpdate};
|
||||
use futures::channel::mpsc;
|
||||
use futures::StreamExt as _;
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::r#async::Timer;
|
||||
use galaxyui::{App, ModelContext, ModelHandle};
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
|
||||
#[test]
|
||||
fn test_add_repository_success() {
|
||||
|
||||
Reference in New Issue
Block a user