Skip to content

Commit 76c8ebb

Browse files
committed
Don't dump callHierarchy/incomingCalls response
to trace file to avoid stack overflow on a long response. Fixes #1468
1 parent b285740 commit 76c8ebb

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

source/server/lsp-secure_message_loggers.adb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,28 @@ package body LSP.Secure_Message_Loggers is
175175
Self.Output.New_Line (Ok);
176176
end On_FoldingRange_Response;
177177

178+
-------------------------------
179+
-- On_IncomingCalls_Response --
180+
-------------------------------
181+
182+
overriding procedure On_IncomingCalls_Response
183+
(Self : in out Client_Response_Logger;
184+
Id : LSP.Structures.Integer_Or_Virtual_String;
185+
Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null)
186+
is
187+
Ok : Boolean := True;
188+
begin
189+
-- Hide response, because it could be lengthly and expose names
190+
Self.Output.Put ("'callHierarchy/incomingCalls'", Ok);
191+
Self.Put_Id (Id, Ok);
192+
Self.Output.Put (" result : len=", Ok);
193+
194+
Self.Output.Put
195+
(VSS.Strings.To_Virtual_String (Value.Length'Wide_Wide_Image), Ok);
196+
197+
Self.Output.New_Line (Ok);
198+
end On_IncomingCalls_Response;
199+
178200
----------------------------
179201
-- On_References_Response --
180202
----------------------------

source/server/lsp-secure_message_loggers.ads

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ package LSP.Secure_Message_Loggers is
8080
Id : LSP.Structures.Integer_Or_Virtual_String;
8181
Value : LSP.Structures.Symbol_Result);
8282

83+
overriding procedure On_IncomingCalls_Response
84+
(Self : in out Client_Response_Logger;
85+
Id : LSP.Structures.Integer_Or_Virtual_String;
86+
Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null);
87+
8388
type Server_Notification_Logger is
8489
new LSP.Server_Notification_Loggers.Server_Notification_Logger
8590
with null record;

0 commit comments

Comments
 (0)