@@ -4660,6 +4660,77 @@ async fn should_acknowledge_changes_in_settings_when_pulling_diagnostics() -> Re
46604660 Ok ( ( ) )
46614661}
46624662
4663+ #[ tokio:: test]
4664+ async fn should_apply_wrapped_biome_settings_from_did_change_configuration ( ) -> Result < ( ) > {
4665+ let factory = ServerFactory :: default ( ) ;
4666+ let ( service, client) = factory. create ( ) . into_inner ( ) ;
4667+ let ( stream, sink) = client. split ( ) ;
4668+ let mut server = Server :: new ( service) ;
4669+
4670+ let ( sender, mut receiver) = channel ( CHANNEL_BUFFER_SIZE ) ;
4671+ let reader = tokio:: spawn ( client_handler ( stream, sink, sender) ) ;
4672+
4673+ server. initialize ( ) . await ?;
4674+ server. initialized ( ) . await ?;
4675+
4676+ server
4677+ . open_document ( "import { b, a } from \" ./foo\" ;\n " )
4678+ . await ?;
4679+
4680+ let notification = wait_for_notification ( & mut receiver, |n| n. is_publish_diagnostics ( ) ) . await ;
4681+
4682+ assert ! ( notification. is_some( ) ) ;
4683+
4684+ let notification = notification. expect ( "notification" ) ;
4685+ assert ! ( matches!(
4686+ notification,
4687+ ServerNotification :: PublishDiagnostics ( _)
4688+ ) ) ;
4689+ if let ServerNotification :: PublishDiagnostics ( result) = notification {
4690+ assert ! (
4691+ !result. diagnostics. is_empty( ) ,
4692+ "should contain diagnostics before applying wrapped biome settings"
4693+ ) ;
4694+ }
4695+
4696+ sleep ( Duration :: from_millis ( 300 ) ) . await ;
4697+
4698+ server
4699+ . notify (
4700+ "workspace/didChangeConfiguration" ,
4701+ DidChangeConfigurationParams {
4702+ settings : serde_json:: json!( {
4703+ "biome" : {
4704+ "requireConfiguration" : true ,
4705+ "configurationPath" : null,
4706+ }
4707+ } ) ,
4708+ } ,
4709+ )
4710+ . await ?;
4711+
4712+ let notification = wait_for_notification ( & mut receiver, |n| n. is_publish_diagnostics ( ) ) . await ;
4713+
4714+ assert_eq ! (
4715+ notification,
4716+ Some ( ServerNotification :: PublishDiagnostics (
4717+ PublishDiagnosticsParams {
4718+ uri: uri!( "document.js" ) ,
4719+ version: Some ( 0 ) ,
4720+ diagnostics: vec![ ] ,
4721+ }
4722+ ) ) ,
4723+ "diagnostics should be cleared after applying wrapped biome settings from didChangeConfiguration"
4724+ ) ;
4725+
4726+ server. close_document ( ) . await ?;
4727+
4728+ server. shutdown ( ) . await ?;
4729+ reader. abort ( ) ;
4730+
4731+ Ok ( ( ) )
4732+ }
4733+
46634734#[ tokio:: test]
46644735async fn pull_plugin_diagnostics_for_vue_files ( ) -> Result < ( ) > {
46654736 let fs = MemoryFileSystem :: default ( ) ;
0 commit comments