This commit is contained in:
Josh Thomas 2025-08-27 15:37:29 -05:00
parent 269d4bceae
commit 4e3446f6ee
14 changed files with 577 additions and 1668 deletions

View file

@ -1,22 +1,33 @@
mod bridge;
mod db;
pub mod db;
mod document;
mod vfs;
mod lsp_system;
mod system;
pub use document::ClosingBrace;
pub use document::DocumentStore;
pub use document::LanguageId;
pub use document::LineIndex;
pub use document::TemplateTagContext;
pub use document::TextDocument;
pub use db::Database;
pub use document::{TextDocument, LanguageId};
pub use system::{FileSystem, StdFileSystem};
/// File classification for routing to analyzers.
///
/// [`FileKind`] determines how a file should be processed by downstream analyzers.
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub enum FileKind {
/// Python source file
Python,
/// Django template file
Template,
/// Other file type
Other,
}
/// Stable, compact identifier for files across the subsystem.
///
/// [`FileId`] decouples file identity from paths/URIs, providing efficient keys for maps and
/// Salsa inputs. Once assigned to a file (via its URI), a [`FileId`] remains stable for the
/// lifetime of the VFS, even if the file's content or metadata changes.
/// lifetime of the system.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub(crate) struct FileId(u32);
pub struct FileId(u32);
impl FileId {
/// Create a [`FileId`] from a raw u32 value.
@ -27,6 +38,7 @@ impl FileId {
/// Get the underlying u32 index value.
#[must_use]
#[allow(dead_code)]
pub fn index(self) -> u32 {
self.0
}