@@ -302,12 +302,47 @@ package body LSP.Ada_Handlers.Symbols is
302
302
303
303
for Child of Node.Children loop
304
304
if not Child.Is_Null then
305
- Walk (Child, Next_Level, Children);
305
+ Walk
306
+ (Node => Child,
307
+ Nested_Level => Next_Level,
308
+ Vector => Children);
306
309
exit when Self.Is_Canceled.all ;
307
310
end if ;
308
311
end loop ;
309
312
310
313
case Node.Kind is
314
+ when Libadalang.Common.Ada_Ada_Node_List_Range =>
315
+
316
+ -- Check if we are dealing with a list of with-clauses nodes
317
+ -- ('namespace' symbol kind). If yes, create a 'fake' parent
318
+ -- item called 'With clauses' and put every with-clause within it.
319
+ if Children.Length > 0 then
320
+ declare
321
+ First_Item : constant LSP.Structures.DocumentSymbol :=
322
+ LSP.Structures.Get_DocumentSymbol_Constant_Reference
323
+ (Children, 1 );
324
+ Package_Deps_Item : LSP.Structures.DocumentSymbol;
325
+ begin
326
+ if First_Item.kind = Namespace then
327
+ Package_Deps_Item :=
328
+ (name => VSS.Strings.To_Virtual_String
329
+ (" With clauses" ),
330
+ detail => VSS.Strings.Empty_Virtual_String,
331
+ kind => Namespace,
332
+ deprecated => (Is_Set => False),
333
+ tags => LSP.Constants.Empty,
334
+ a_range => First_Item.a_range,
335
+ selectionRange => First_Item.a_range,
336
+ children => Children,
337
+ others => <>);
338
+ Vector.Append (Package_Deps_Item);
339
+ else
340
+ for J in 1 .. Children.Length loop
341
+ Vector.Append (Children (J));
342
+ end loop ;
343
+ end if ;
344
+ end ;
345
+ end if ;
311
346
when Libadalang.Common.Ada_Basic_Decl =>
312
347
declare
313
348
Decl : constant Libadalang.Analysis.Basic_Decl :=
0 commit comments