Skip to content

Commit 6ab8173

Browse files
committed
Merge branch 'topic/log' into 'master'
Use `window/logMessage` to send ALS log file path. See merge request eng/ide/ada_language_server!1398
2 parents c672051 + 2412e76 commit 6ab8173

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

source/ada/lsp-ada_handlers.adb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,6 +3379,7 @@ package body LSP.Ada_Handlers is
33793379
LSP.File_Monitors.File_Monitor_Access);
33803380

33813381
Response : LSP.Structures.InitializeResult;
3382+
Log_Info : LSP.Structures.LogMessageParams;
33823383
Token_Types : LSP.Structures.Virtual_String_Vector;
33833384
Token_Motifiers : LSP.Structures.Virtual_String_Vector;
33843385
begin
@@ -3402,6 +3403,11 @@ package body LSP.Ada_Handlers is
34023403
end if;
34033404

34043405
Self.Sender.On_Initialize_Response (Id, Response);
3406+
3407+
Log_Info.a_type := LSP.Enumerations.Log;
3408+
Log_Info.message.Append ("Log directory is ");
3409+
Log_Info.message.Append (Self.Tracer.Location);
3410+
Self.Sender.On_LogMessage_Notification (Log_Info);
34053411
end On_Initialize_Request;
34063412

34073413
---------------------------------

source/ada/lsp-gnatcoll_tracers.adb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ package body LSP.GNATCOLL_Tracers is
3939
Self.Out_Trace := Out_Trace;
4040
end Initialize;
4141

42+
--------------
43+
-- Location --
44+
--------------
45+
46+
overriding function Location
47+
(Self : Tracer) return VSS.Strings.Virtual_String is
48+
begin
49+
return VSS.Strings.Conversions.To_Virtual_String
50+
(Self.Server_Trace.Get_Stream_File.Display_Full_Name);
51+
end Location;
52+
4253
-----------
4354
-- Trace --
4455
-----------

source/ada/lsp-gnatcoll_tracers.ads

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ package LSP.GNATCOLL_Tracers is
6363
(Self : in out Tracer;
6464
Text : VSS.Stream_Element_Vectors.Stream_Element_Vector);
6565

66+
overriding function Location
67+
(Self : Tracer) return VSS.Strings.Virtual_String;
68+
6669
private
6770

6871
type Tracer is limited new LSP.Tracers.Tracer with record

source/server/lsp-tracers.ads

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,8 @@ package LSP.Tracers is
6161
Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) is abstract;
6262
-- Append raw data as text to output trace file
6363

64+
function Location (Self : Tracer) return VSS.Strings.Virtual_String
65+
is abstract;
66+
-- Return information about trace location on the filesystem.
67+
6468
end LSP.Tracers;

0 commit comments

Comments
 (0)