AdaCore / ada_language_server

Server implementing the Microsoft Language Protocol for Ada and SPARK
GNU General Public License v3.0
226 stars 54 forks source link

“More than one .gpr found” when ada.projectFile is already configured #1168

Closed nytpu closed 2 months ago

nytpu commented 8 months ago

On Neovim using nvim-lspconfig, when a program has multiple GPR files in the project root but the ada.projectFile option is configured, ALS still prints this warning when starting:

LSP[als] More than one .gpr found.
Note: you can configure a project  through the ada.projectFile setting.

Note that ALS still functions perfectly after dismissing the warning message as long as projectFile was set correctly, this is purely a cosmetic issue. The warning does not appear and everything still functions as normal if I move all the GPR files to a subdirectory and point projectFile at the new location; it only occurs when there's multiple GPRs in the project root.

AnthonyLeonardoGracio commented 8 months ago

Hello !

I suspect that the warning gets emitted before the configuration is sent to the Ada Language Server, maybe because neovim does not send the ada.projectFile setting when initializing the server. We'll have a look.

Regards,

AnthonyLeonardoGracio commented 2 months ago

Closing this issue, since it's related to NeoVim, and can't be reproduced with VS Code, which is LSP-client reference implementation.

Don't hesitate to come back with a suggestion for us to fit NeoVim's initialization sequence if you find any.