@@ -14,7 +14,7 @@ use pg_workspace::workspace::IsPathIgnoredParams;
1414use pg_workspace:: { Workspace , WorkspaceError } ;
1515use rustc_hash:: FxHashSet ;
1616use std:: collections:: BTreeSet ;
17- use std:: sync:: atomic:: { AtomicBool , AtomicU32 } ;
17+ use std:: sync:: atomic:: AtomicU32 ;
1818use std:: sync:: RwLock ;
1919use std:: {
2020 env:: current_dir,
@@ -33,7 +33,6 @@ pub(crate) struct TraverseResult {
3333 pub ( crate ) summary : TraversalSummary ,
3434 pub ( crate ) evaluated_paths : BTreeSet < PgLspPath > ,
3535 pub ( crate ) diagnostics : Vec < Error > ,
36- pub ( crate ) user_hints : Vec < String > ,
3736}
3837
3938pub ( crate ) fn traverse (
@@ -73,7 +72,6 @@ pub(crate) fn traverse(
7372 let unchanged = AtomicUsize :: new ( 0 ) ;
7473 let matches = AtomicUsize :: new ( 0 ) ;
7574 let skipped = AtomicUsize :: new ( 0 ) ;
76- let skipped_db_conn = AtomicBool :: new ( false ) ;
7775
7876 let fs = & * session. app . fs ;
7977 let workspace = & * session. app . workspace ;
@@ -86,7 +84,7 @@ pub(crate) fn traverse(
8684 . with_diagnostic_level ( cli_options. diagnostic_level )
8785 . with_max_diagnostics ( max_diagnostics) ;
8886
89- let ( duration, evaluated_paths, diagnostics, mut user_hints ) = thread:: scope ( |s| {
87+ let ( duration, evaluated_paths, diagnostics) = thread:: scope ( |s| {
9088 let handler = thread:: Builder :: new ( )
9189 . name ( String :: from ( "pglsp::console" ) )
9290 . spawn_scoped ( s, || printer. run ( receiver, recv_files) )
@@ -106,16 +104,15 @@ pub(crate) fn traverse(
106104 changed : & changed,
107105 unchanged : & unchanged,
108106 skipped : & skipped,
109- skipped_db_conn : & skipped_db_conn,
110107 messages : sender,
111108 remaining_diagnostics : & remaining_diagnostics,
112109 evaluated_paths : RwLock :: default ( ) ,
113110 } ,
114111 ) ;
115112 // wait for the main thread to finish
116- let ( diagnostics, user_hints ) = handler. join ( ) . unwrap ( ) ;
113+ let diagnostics = handler. join ( ) . unwrap ( ) ;
117114
118- ( elapsed, evaluated_paths, diagnostics, user_hints )
115+ ( elapsed, evaluated_paths, diagnostics)
119116 } ) ;
120117
121118 let errors = printer. errors ( ) ;
@@ -127,19 +124,6 @@ pub(crate) fn traverse(
127124 let suggested_fixes_skipped = printer. skipped_fixes ( ) ;
128125 let diagnostics_not_printed = printer. not_printed_diagnostics ( ) ;
129126
130- if duration. as_secs ( ) >= 2 {
131- user_hints. push ( format ! (
132- "The traversal took longer than expected ({}s). Consider using the `--skip-db` option if your Postgres connection is slow." ,
133- duration. as_secs( )
134- ) ) ;
135- }
136-
137- if skipped_db_conn. load ( Ordering :: Relaxed ) {
138- user_hints. push ( format ! (
139- "Skipped all checks requiring database connections." ,
140- ) ) ;
141- }
142-
143127 Ok ( TraverseResult {
144128 summary : TraversalSummary {
145129 changed,
@@ -154,7 +138,6 @@ pub(crate) fn traverse(
154138 } ,
155139 evaluated_paths,
156140 diagnostics,
157- user_hints,
158141 } )
159142}
160143
@@ -306,15 +289,10 @@ impl<'ctx> DiagnosticsPrinter<'ctx> {
306289 should_print
307290 }
308291
309- fn run (
310- & self ,
311- receiver : Receiver < Message > ,
312- interner : Receiver < PathBuf > ,
313- ) -> ( Vec < Error > , Vec < String > ) {
292+ fn run ( & self , receiver : Receiver < Message > , interner : Receiver < PathBuf > ) -> Vec < Error > {
314293 let mut paths: FxHashSet < String > = FxHashSet :: default ( ) ;
315294
316295 let mut diagnostics_to_print = vec ! [ ] ;
317- let mut hints_to_print = vec ! [ ] ;
318296
319297 while let Ok ( msg) = receiver. recv ( ) {
320298 match msg {
@@ -329,10 +307,6 @@ impl<'ctx> DiagnosticsPrinter<'ctx> {
329307 self . errors . fetch_add ( 1 , Ordering :: Relaxed ) ;
330308 }
331309
332- Message :: Hint ( hint) => {
333- hints_to_print. push ( hint) ;
334- }
335-
336310 Message :: Error ( mut err) => {
337311 let location = err. location ( ) ;
338312 if self . should_skip_diagnostic ( err. severity ( ) , err. tags ( ) ) {
@@ -409,7 +383,7 @@ impl<'ctx> DiagnosticsPrinter<'ctx> {
409383 }
410384 }
411385
412- ( diagnostics_to_print, hints_to_print )
386+ diagnostics_to_print
413387 }
414388}
415389
@@ -431,8 +405,6 @@ pub(crate) struct TraversalOptions<'ctx, 'app> {
431405 matches : & ' ctx AtomicUsize ,
432406 /// Shared atomic counter storing the number of skipped files
433407 skipped : & ' ctx AtomicUsize ,
434- /// Shared atomic bool tracking whether we used a DB connection
435- skipped_db_conn : & ' ctx AtomicBool ,
436408 /// Channel sending messages to the display thread
437409 pub ( crate ) messages : Sender < Message > ,
438410 /// The approximate number of diagnostics the console will print before
@@ -464,10 +436,6 @@ impl TraversalOptions<'_, '_> {
464436 self . messages . send ( msg. into ( ) ) . ok ( ) ;
465437 }
466438
467- pub ( crate ) fn set_skipped_db_conn ( & self , has_skipped : bool ) {
468- self . skipped_db_conn . store ( has_skipped, Ordering :: Relaxed ) ;
469- }
470-
471439 pub ( crate ) fn protected_file ( & self , pglsp_path : & PgLspPath ) {
472440 self . push_diagnostic (
473441 WorkspaceError :: protected_file ( pglsp_path. display ( ) . to_string ( ) ) . into ( ) ,
0 commit comments