@@ -8,8 +8,8 @@ use ruff_db::files::{File, Files};
88use ruff_db:: system:: System ;
99use ruff_db:: vendored:: VendoredFileSystem ;
1010use ruff_db:: { Db as SourceDb , Upcast } ;
11+ use salsa:: Event ;
1112use salsa:: plumbing:: ZalsaDatabase ;
12- use salsa:: { Cancelled , Event } ;
1313use ty_ide:: Db as IdeDb ;
1414use ty_python_semantic:: lint:: { LintRegistry , RuleSelection } ;
1515use ty_python_semantic:: { Db as SemanticDb , Program } ;
@@ -76,24 +76,21 @@ impl ProjectDatabase {
7676 }
7777
7878 /// Checks all open files in the project and its dependencies.
79- pub fn check ( & self ) -> Result < Vec < Diagnostic > , Cancelled > {
79+ pub fn check ( & self ) -> Vec < Diagnostic > {
8080 let mut reporter = DummyReporter ;
8181 let reporter = AssertUnwindSafe ( & mut reporter as & mut dyn Reporter ) ;
82- self . with_db ( |db| db . project ( ) . check ( db , reporter) )
82+ self . project ( ) . check ( self , reporter)
8383 }
8484
8585 /// Checks all open files in the project and its dependencies, using the given reporter.
86- pub fn check_with_reporter (
87- & self ,
88- reporter : & mut dyn Reporter ,
89- ) -> Result < Vec < Diagnostic > , Cancelled > {
86+ pub fn check_with_reporter ( & self , reporter : & mut dyn Reporter ) -> Vec < Diagnostic > {
9087 let reporter = AssertUnwindSafe ( reporter) ;
91- self . with_db ( |db| db . project ( ) . check ( db , reporter) )
88+ self . project ( ) . check ( self , reporter)
9289 }
9390
9491 #[ tracing:: instrument( level = "debug" , skip( self ) ) ]
95- pub fn check_file ( & self , file : File ) -> Result < Vec < Diagnostic > , Cancelled > {
96- self . with_db ( |db| self . project ( ) . check_file ( db , file) )
92+ pub fn check_file ( & self , file : File ) -> Vec < Diagnostic > {
93+ self . project ( ) . check_file ( self , file)
9794 }
9895
9996 /// Returns a mutable reference to the system.
@@ -107,13 +104,6 @@ impl ProjectDatabase {
107104 Arc :: get_mut ( & mut self . system )
108105 . expect ( "ref count should be 1 because `zalsa_mut` drops all other DB references." )
109106 }
110-
111- pub ( crate ) fn with_db < F , T > ( & self , f : F ) -> Result < T , Cancelled >
112- where
113- F : FnOnce ( & ProjectDatabase ) -> T + std:: panic:: UnwindSafe ,
114- {
115- Cancelled :: catch ( || f ( self ) )
116- }
117107}
118108
119109impl Upcast < dyn SemanticDb > for ProjectDatabase {
0 commit comments