@@ -58,7 +58,8 @@ package body LSP.Ada_Handlers.Locations is
5858 Value : constant LSP.Structures.Location :=
5959 (uri => URI,
6060 a_range => Locations.To_LSP_Range (Self, Unit, Token),
61- alsKind => LSP.Constants.Empty);
61+ alsKind => LSP.Constants.Empty,
62+ hidden => (Is_Set => False));
6263 begin
6364 if not Filter.Contains (Value) then
6465 Result.Append (Value);
@@ -423,13 +424,22 @@ package body LSP.Ada_Handlers.Locations is
423424
424425 begin
425426 if Doc /= null then
426- return Doc.To_LSP_Location (Sloc, Kinds);
427+ return Doc.To_LSP_Location
428+ (Segment => Sloc,
429+ Kinds => Kinds,
430+ Hidden => LSP.Utils.Is_From_Extended_Project
431+ (Self.Project_Tree, File));
432+
427433 else
428434 return
429435 (uri => URI,
430436 a_range => To_LSP_Range
431437 (Context.Get_AU (GNATCOLL.VFS.Create_From_UTF8 (File)), Sloc),
432- alsKind => Kinds);
438+ alsKind => Kinds,
439+ hidden =>
440+ (if LSP.Utils.Is_From_Extended_Project (Self.Project_Tree, File)
441+ then (Is_Set => True, Value => True)
442+ else (Is_Set => False)));
433443 end if ;
434444 end To_LSP_Location ;
435445
@@ -507,14 +517,22 @@ package body LSP.Ada_Handlers.Locations is
507517
508518 begin
509519 if Doc /= null then
510- return Doc.To_LSP_Location (Sloc, Kind);
520+ return Doc.To_LSP_Location
521+ (Segment => Sloc,
522+ Kinds => Kind,
523+ Hidden => LSP.Utils.Is_From_Extended_Project
524+ (Self.Project_Tree, Node.Unit.Get_Filename));
511525
512526 else
513527 return
514- (uri => URI,
528+ (uri => URI,
515529 a_range => To_LSP_Range (Node.Unit, Sloc),
516- alsKind => Kind);
517-
530+ alsKind => Kind,
531+ hidden =>
532+ (if LSP.Utils.Is_From_Extended_Project
533+ (Self.Project_Tree, Node.Unit.Get_Filename)
534+ then (Is_Set => True, Value => True)
535+ else (Is_Set => False)));
518536 end if ;
519537 end To_LSP_Location ;
520538
0 commit comments