Skip to content

Commit 9c6b908

Browse files
committed
Replace GPR2 Reporter to avoid warnings/errors
on stderr/stdout while locading fallback context or projects. Ref #1594
1 parent d7ce9a4 commit 9c6b908

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

source/ada/lsp-ada_handlers-project_loading.adb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -855,12 +855,13 @@ package body LSP.Ada_Handlers.Project_Loading is
855855
Project_Tree : in out GPR2.Project.Tree.Object;
856856
Success : out Boolean)
857857
is
858-
Project : GPR2.Project.Tree.View_Builder.Object :=
858+
Project : GPR2.Project.Tree.View_Builder.Object :=
859859
GPR2.Project.Tree.View_Builder.Create
860860
(Project_Dir => GPR2.Path_Name.Create_Directory ("."),
861861
Name => Name);
862-
Values : GPR2.Containers.Value_List;
863-
Opts : GPR2.Options.Object;
862+
Values : GPR2.Containers.Value_List;
863+
Opts : GPR2.Options.Object;
864+
Reporter : GPR2_Reporter;
864865
begin
865866
Project_Tree.Unload;
866867
-- Load all the dirs
@@ -878,7 +879,8 @@ package body LSP.Ada_Handlers.Project_Loading is
878879
(Project,
879880
Opts,
880881
With_Runtime => True,
881-
Absent_Dir_Error => GPR2.No_Error);
882+
Absent_Dir_Error => GPR2.No_Error,
883+
Reporter => Reporter);
882884

883885
if Success then
884886
Project_Tree.Update_Sources;

testsuite/ada_lsp/Did_Rename_Files.context_corruption/test.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,20 @@
684684
}
685685
},
686686
"alsKind": ["reference"]
687+
},
688+
{
689+
"uri": "$URI{main.adb}",
690+
"range": {
691+
"start": {
692+
"line": 4,
693+
"character": 12
694+
},
695+
"end": {
696+
"line": 4,
697+
"character": 13
698+
}
699+
},
700+
"alsKind": ["call"]
687701
}
688702
]
689703
}

0 commit comments

Comments
 (0)