[red-knot] Migrate CLI to Salsa (#11972)

This commit is contained in:
Micha Reiser 2024-07-04 09:23:45 +02:00 committed by GitHub
parent 262053f85c
commit 4d385b60c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 345 additions and 7840 deletions

View file

@ -1,9 +1,9 @@
use countme::Count;
use ruff_source_file::LineIndex;
use salsa::DebugWithDb;
use std::ops::Deref;
use std::sync::Arc;
use ruff_source_file::LineIndex;
use crate::vfs::VfsFile;
use crate::Db;
@ -16,6 +16,7 @@ pub fn source_text(db: &dyn Db, file: VfsFile) -> SourceText {
SourceText {
inner: Arc::from(content),
count: Count::new(),
}
}
@ -35,6 +36,7 @@ pub fn line_index(db: &dyn Db, file: VfsFile) -> LineIndex {
#[derive(Clone, Eq, PartialEq)]
pub struct SourceText {
inner: Arc<str>,
count: Count<Self>,
}
impl SourceText {