mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Introduce HasTy
trait and SemanticModel
facade (#11963)
This commit is contained in:
parent
3f25561511
commit
37f260b5af
13 changed files with 569 additions and 318 deletions
|
@ -10,7 +10,7 @@ use crate::Db;
|
|||
/// Reads the content of file.
|
||||
#[salsa::tracked]
|
||||
pub fn source_text(db: &dyn Db, file: VfsFile) -> SourceText {
|
||||
let _ = tracing::trace_span!("source_text", file = ?file.debug(db)).enter();
|
||||
let _span = tracing::trace_span!("source_text", ?file).entered();
|
||||
|
||||
let content = file.read(db);
|
||||
|
||||
|
@ -22,7 +22,7 @@ pub fn source_text(db: &dyn Db, file: VfsFile) -> SourceText {
|
|||
/// Computes the [`LineIndex`] for `file`.
|
||||
#[salsa::tracked]
|
||||
pub fn line_index(db: &dyn Db, file: VfsFile) -> LineIndex {
|
||||
let _ = tracing::trace_span!("line_index", file = ?file.debug(db)).enter();
|
||||
let _span = tracing::trace_span!("line_index", file = ?file.debug(db)).entered();
|
||||
|
||||
let source = source_text(db, file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue