From 0483c64bbf27d9edf2744cef476b65c2e9fa3991 Mon Sep 17 00:00:00 2001 From: Anthony Leonardo Gracio Date: Mon, 7 Oct 2024 20:01:35 +0000 Subject: [PATCH] Merge branch 'mr/25.0/lambourg-update-sources' into 'master' Update_Sources should not prevent the GPR2 project tree from loading See merge request eng/ide/ada_language_server!1720 (cherry picked from commit 89e8a0cb672e93320ee7860c5f81c176c0e135f3) f9155401 Update_Sources should not prevent the GPR2 project tree from loading 33fd8cdf Update tests Co-authored-by: Anthony Leonardo Gracio --- source/ada/lsp-ada_project_loading.adb | 9 +-------- testsuite/ada_lsp/project_config.missing_file/test.json | 2 +- testsuite/gpr_lsp/project_config.alire/hello.gpr | 2 +- testsuite/gpr_lsp/project_config.alire/test.json | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/source/ada/lsp-ada_project_loading.adb b/source/ada/lsp-ada_project_loading.adb index cd4a39343..d52293b16 100644 --- a/source/ada/lsp-ada_project_loading.adb +++ b/source/ada/lsp-ada_project_loading.adb @@ -370,16 +370,9 @@ package body LSP.Ada_Project_Loading is -- Special case for a Valid Project: check errors and then warnings if Project.Status = Valid_Project then if Project.GPR2_Messages.Has_Element - (Information => False, - Warning => False, - Error => True, - Lint => False) - then - Project.Status := Invalid_Project; - elsif Project.GPR2_Messages.Has_Element (Information => False, Warning => True, - Error => False, + Error => True, Lint => False) then Project.Status := Valid_Project_With_Warning; diff --git a/testsuite/ada_lsp/project_config.missing_file/test.json b/testsuite/ada_lsp/project_config.missing_file/test.json index 68f04dad4..01a5b28d8 100644 --- a/testsuite/ada_lsp/project_config.missing_file/test.json +++ b/testsuite/ada_lsp/project_config.missing_file/test.json @@ -95,7 +95,7 @@ } } }, - "message": "The project file has errors and could not be loaded." + "message": "The project file was loaded but contains Warnings." }, { "location": { diff --git a/testsuite/gpr_lsp/project_config.alire/hello.gpr b/testsuite/gpr_lsp/project_config.alire/hello.gpr index 3ff5dae46..7ec58bcba 100644 --- a/testsuite/gpr_lsp/project_config.alire/hello.gpr +++ b/testsuite/gpr_lsp/project_config.alire/hello.gpr @@ -1 +1 @@ -with "config/hello_config.gpr";project Hello is end Hello; +with "config/hello_config.gpr";project Hello is for Source_Dirs use ("src"); end Hello; diff --git a/testsuite/gpr_lsp/project_config.alire/test.json b/testsuite/gpr_lsp/project_config.alire/test.json index b8f462f9b..bc4c5c58a 100644 --- a/testsuite/gpr_lsp/project_config.alire/test.json +++ b/testsuite/gpr_lsp/project_config.alire/test.json @@ -55,7 +55,7 @@ "request": { "params": { "textDocument": { - "text": "with \"config/hello_config.gpr\";project Hello is end Hello;", + "text": "with \"config/hello_config.gpr\";project Hello is for Source_Dirs use (\"src\"); end Hello;", "version": 0, "uri": "$URI{hello.gpr}", "languageId": "Gpr"