Skip to content

Commit

Permalink
Merge branch 'mr/xfail_test' into 'edge'
Browse files Browse the repository at this point in the history
Xfail a test and fix .gpr loading for the GPR server

See merge request eng/ide/ada_language_server!1604
  • Loading branch information
setton committed Jul 3, 2024
2 parents b36dad1 + 2d1c7f2 commit e21aea7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
28 changes: 21 additions & 7 deletions source/gpr/lsp-gpr_documents.adb
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ package body LSP.GPR_Documents is
Self.Tree.Unload;

declare
Opts : GPR2.Options.Object;
Success : Boolean;
Opts : GPR2.Options.Object;
Success : Boolean;
Update_Log : GPR2.Log.Object;
begin
Opts.Add_Switch (GPR2.Options.P, String (Self.File.Value));

Expand All @@ -198,16 +199,29 @@ package body LSP.GPR_Documents is
Environment => LSP.GPR_Files.Environment);

if Success then
Success := Self.Tree.Set_Context (Configuration.Context);
Self.Tree.Update_Sources (Update_Log);
if Update_Log.Has_Error then
Self.Has_Messages := True;
else
Success := Self.Tree.Set_Context (Configuration.Context);
end if;
end if;

if not Success then
for C in Self.Tree.Log_Messages.Iterate loop
Self.Tracer.Trace (C.Element.Format);
Self.Messages.Append (C.Element);
end loop;
Self.Has_Messages := True;
end if;

-- Collect all messages coming from Load...
for C in Self.Tree.Log_Messages.Iterate loop
Self.Tracer.Trace (C.Element.Format);
Self.Messages.Append (C.Element);
end loop;

-- ... and all messages coming from Update_Sources
for C in Update_Log.Iterate loop
Self.Tracer.Trace (C.Element.Format);
Self.Messages.Append (C.Element);
end loop;
end;

Update_Diagnostics;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: 'C825-005.xrefs.extending'

# This test needs a change of behaviour in gpr2,
# see https://gitlab.adacore-it.com/eng/gpr/gpr-issues/-/issues/328
# see eng/gpr/gpr-issues#328
skip:
- ['XFAIL', 'True']
5 changes: 5 additions & 0 deletions testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
title: 'F131-024.xrefs.separate_body'

# This test is expected to fail until eng/libadalang/libadalang#1409
# is fixed.
skip:
- ['XFAIL', 'True']

0 comments on commit e21aea7

Please sign in to comment.