@@ -29,7 +29,6 @@ with VSS.Strings;
2929with VSS.Strings.Formatters.Integers ;
3030with VSS.Strings.Formatters.Strings ;
3131with VSS.Strings.Templates ;
32- with VSS.String_Vectors ;
3332
3433with Laltools.Common ;
3534with Laltools.Partial_GNATPP ;
@@ -91,7 +90,6 @@ with LSP.Search;
9190with LSP.Servers.FS_Watch ;
9291with LSP.Structures.LSPAny_Vectors ;
9392with LSP.Utils ;
94- with LSP.Enumerations ;
9593
9694package body LSP.Ada_Handlers is
9795
@@ -412,7 +410,7 @@ package body LSP.Ada_Handlers is
412410 Self.File_Monitor :=
413411 new LSP.Servers.FS_Watch.FS_Watch_Monitor (Self.Server);
414412 Self.Diagnostic_Sources :=
415- [new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source
413+ [new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source
416414 (Self'Unchecked_Access)];
417415
418416 Self.Load_Config_Files (CLI_Config_File);
@@ -455,6 +453,7 @@ package body LSP.Ada_Handlers is
455453
456454 Config_File_Processed : Boolean := False;
457455 New_Configuration : LSP.Ada_Configurations.Configuration;
456+ Messages : VSS.String_Vectors.Virtual_String_Vector;
458457 begin
459458 for F_Path of Candidates loop
460459 if not F_Path.Is_Empty then
@@ -465,7 +464,14 @@ package body LSP.Ada_Handlers is
465464 Self.Tracer.Trace_Text (" Trying config file: " & F_Path);
466465 if F.Is_Regular_File then
467466 Self.Tracer.Trace_Text (" Loading config file: " & F_Path);
468- New_Configuration.Read_File (F_Path);
467+ New_Configuration.Read_File (F_Path, Messages);
468+
469+ Self.Send_Messages
470+ (Show => True,
471+ Messages => Messages,
472+ Severity => LSP.Enumerations.Warning,
473+ File => F);
474+
469475 Config_File_Processed := True;
470476 else
471477 Self.Tracer.Trace_Text (F_Path & " doesn't exist" );
@@ -2453,9 +2459,17 @@ package body LSP.Ada_Handlers is
24532459 -- }
24542460 declare
24552461 New_Configuration : LSP.Ada_Configurations.Configuration;
2462+ Messages : VSS.String_Vectors.Virtual_String_Vector;
24562463 begin
24572464 -- Parse the configuration.
2458- New_Configuration.Read_JSON (Value.initializationOptions);
2465+ New_Configuration.Read_JSON
2466+ (Value.initializationOptions, Messages);
2467+
2468+ Self.Send_Messages
2469+ (Show => True,
2470+ Messages => Messages,
2471+ Severity => LSP.Enumerations.Warning,
2472+ File => GNATCOLL.VFS.No_File);
24592473
24602474 -- Set it as the current configuration.
24612475 -- This will also save it as the initial configuration (if not done
@@ -3812,6 +3826,37 @@ package body LSP.Ada_Handlers is
38123826 return Definition;
38133827 end Resolve_Name ;
38143828
3829+ -- -----------------
3830+ -- Send_Messages --
3831+ -- -----------------
3832+
3833+ overriding procedure Send_Messages
3834+ (Self : Message_Handler;
3835+ Show : Boolean;
3836+ Messages : VSS.String_Vectors.Virtual_String_Vector;
3837+ Severity : LSP.Enumerations.MessageType;
3838+ File : GNATCOLL.VFS.Virtual_File)
3839+ is
3840+ use GNATCOLL.VFS;
3841+ use VSS.Strings;
3842+ Prefix : constant VSS.Strings.Virtual_String :=
3843+ (if File /= No_File
3844+ then VSS.Strings.Virtual_String
3845+ (Self.To_URI (File.Display_Full_Name)) & " : "
3846+ else " " );
3847+ begin
3848+ for Message of Messages loop
3849+ if Show then
3850+ Self.Sender.On_ShowMessage_Notification
3851+ ((Severity, Prefix & Message));
3852+ end if ;
3853+
3854+ Self.Sender.On_LogMessage_Notification
3855+ ((Severity, Prefix & Message));
3856+ Self.Tracer.Trace_Text (Message);
3857+ end loop ;
3858+ end Send_Messages ;
3859+
38153860 -- ---------------------
38163861 -- Set_Configuration --
38173862 -- ---------------------
0 commit comments