File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -2403,16 +2403,26 @@ impl Editor {
24032403 self . set_status ( format ! (
24042404 "Workspace '{}' unrestricted; LSPs, debuggers and formatters available." ,
24052405 workspace. as_ref( ) . display( )
2406- ) )
2406+ ) ) ;
2407+
2408+ let docs = self
2409+ . documents_mut ( )
2410+ . filter ( |d| d. path ( ) . is_some_and ( |p| p. starts_with ( & workspace) ) )
2411+ . map ( |d| {
2412+ d. is_trusted = Some ( true ) ;
2413+ d. id
2414+ } )
2415+ . collect :: < Vec < _ > > ( ) ;
2416+ for doc_id in docs {
2417+ self . launch_language_servers ( doc_id) ;
2418+ }
2419+ self . config_events . 0 . send ( ConfigEvent :: Refresh ) ?;
24072420 } else {
24082421 self . set_status ( format ! (
24092422 "Workspace '{}' is already trusted." ,
24102423 workspace. as_ref( ) . display( )
24112424 ) ) ;
24122425 }
2413- self . documents_mut ( )
2414- . filter ( |d| d. path ( ) . is_some_and ( |p| p. starts_with ( & workspace) ) )
2415- . for_each ( |d| d. is_trusted = Some ( true ) ) ;
24162426 }
24172427 }
24182428 Ok ( ( ) )
@@ -2435,15 +2445,15 @@ impl Editor {
24352445 "Workspace '{}' restricted; LSPs, formatters and debuggers do not work." ,
24362446 workspace. as_ref( ) . display( )
24372447 ) ) ;
2448+ self . documents_mut ( )
2449+ . filter ( |d| d. path ( ) . is_some_and ( |p| p. starts_with ( & workspace) ) )
2450+ . for_each ( |d| d. is_trusted = Some ( false ) ) ;
24382451 } else {
24392452 self . set_status ( format ! (
24402453 "Workspace '{}' was already untrusted." ,
24412454 workspace. as_ref( ) . display( )
24422455 ) ) ;
24432456 }
2444- self . documents_mut ( )
2445- . filter ( |d| d. path ( ) . is_some_and ( |p| p. starts_with ( & workspace) ) )
2446- . for_each ( |d| d. is_trusted = Some ( false ) ) ;
24472457 }
24482458 }
24492459 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments