mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
[red-knot] Migrate CLI to Salsa (#11972)
This commit is contained in:
parent
262053f85c
commit
4d385b60c8
36 changed files with 345 additions and 7840 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue