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

Navigation issue with Generic Package Instantiation with formal package parameters #1141

Closed brownts closed 7 months ago

brownts commented 1 year ago

We've noticed that a lot of our generic instantiation formal parameters didn't properly resolve when hovering over them. After some investigation, it appears that ALS doesn't properly resolve parameters to generic instantiations which are formal package parameters. I've created an attached reproducer for this issue.

test_1.zip

The screenshot below demonstrates the issue. In this example, hovering over the My_Float_Funcs (line 24) doesn't provide any information and attempting to "Go to Definition" results in the "No definition found" message. Additionally, this seems to be isolated to when the package is used as a parameter in the generic instantiation, since this doesn't happen when performing the same action on line 29 where the package is used to call the Sqrt function.

ada_lsp_formal_parameter_pkg_issue

setton commented 1 year ago

Hello Troy,

Thank you for the complete reproducer, this helps. We'll have a look.

Nicolas

(PS: If you happen to be an AdaCore customer, don't hesitate to open tickets on the language server or the VS Code extension directly on AdaCore support, as we deal with those in priority - you can also send links to GitHub issues there)

Roldak commented 7 months ago

As mentioned on the corresponding AdaCore support ticket, this seems fixed in the latest version of the ALS, so I'm closing this issue!