Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic-merge committed Nov 13, 2024
2 parents e3c5a26 + 159f09a commit fed8719
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ all: coverage-instrument
ifeq ($(ALIRE),True)
alr build -- -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) $(GPRBUILD_FLAGS)
else
# We have our own s-memory.adb which overwrites the default System.Memory implementation
# For unclear reasons, this file is not recompiled when the version of GNAT was changed
# and we get link errors. As a workaround, we force its recompilation explicitly here.
$(GPRBUILD) -d -ws -c -u -P gnat/lsp_server.gpr -p $(BUILD_FLAGS) s-memory.adb
$(GPRBUILD) -P gnat/lsp_server.gpr -p $(COVERAGE_BUILD_FLAGS) \
-XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) $(GPRBUILD_CARGS)
endif
Expand Down
43 changes: 37 additions & 6 deletions source/ada/lsp-ada_handlers-project_loading.adb
Original file line number Diff line number Diff line change
Expand Up @@ -838,18 +838,49 @@ package body LSP.Ada_Handlers.Project_Loading is
(Self : in out Message_Handler'Class)
is
use GPR2;
use GPR2.Build.Source.Sets;

procedure For_All_Part_Action
(Kind : Unit_Kind;
View : GPR2.Project.View.Object;
Path : Path_Name.Object;
Index : Unit_Index;
Sep_Name : Optional_Name_Type);

-------------------------
-- For_All_Part_Action --
-------------------------

procedure For_All_Part_Action
(Kind : Unit_Kind;
View : GPR2.Project.View.Object;
Path : Path_Name.Object;
Index : Unit_Index;
Sep_Name : Optional_Name_Type)
is
pragma Unreferenced (Kind);
pragma Unreferenced (View);
pragma Unreferenced (Index);
pragma Unreferenced (Sep_Name);
begin
Self.Project_Predefined_Sources.Include (Path.Virtual_File);
end For_All_Part_Action;
begin
Self.Project_Predefined_Sources.Clear;

if Self.Project_Tree.Is_Defined
and then Self.Project_Tree.Has_Runtime_Project
then
for Source of Self.Project_Tree.Runtime_Project.Sources loop
if Source.Language = GPR2.Ada_Language then
Self.Project_Predefined_Sources.Include
(Source.Path_Name.Virtual_File);
end if;
-- Note that the following loop differs rather subtly from iterating
-- over the units in the runtime view: user projects are allowed to
-- override units from the runtime, and when they do the overridden
-- units should be ignored. We would incorrectly consider them if we
-- just iterated over the units of the runtime view.
for P of Self.Project_Tree.Namespace_Root_Projects loop
for Unit of P.Units (With_Externally_Built => True) loop
if Unit.Owning_View.Is_Runtime then
Unit.For_All_Part (For_All_Part_Action'Access);
end if;
end loop;
end loop;
end if;
end Update_Project_Predefined_Sources;
Expand Down

0 comments on commit fed8719

Please sign in to comment.