Open Lucretia opened 4 months ago
Hello @Lucretia,
It would be useful to have the logs of the Ada Language Server itself, in order to know what the server's response on textDocument/symbol
request. For that, just create a ~/.als/traces.cfg
file with the following contents:
>ada_ls_log.$T.log:buffer_size=0
ALS.MAIN=yes
ALS.IN=yes
ALS.OUT=yes
This will produce ada_ls_log.<timestamp>.log
files for each Ada Language Server instance that is launched (one for Ada code, another one for GPR files). Could you try to reproduce the failures once you have created this traces.cfg
file and send us the logs?
Regards,
You might want to look near the end as it wasn't until then I tried F12 on the GL.Convert symbol, which is from another project in the workspace.
You can find the source here. I've been working from the ch2/<dir>
project dirs.
Hello,
In one of the logs I see:
[ALS.MAIN] GPR2.PROJECT_ERROR - /home/laguest/src/mine-new/self-learning/cgpiogl/ch2/2.4_files/./filesgpr: fatal error, cannot load the project tree
[ALS.MAIN] [/home/laguest/.vscode-insiders/extensions/adacore.ada-24.0.6/x64/linux/ada_language_server]
...
[ALS.MAIN] /home/laguest/src/mine-new/self-learning/cgpiogl/ch2/2.4_files/./filesgpr project file "/home/laguest/src/mine-new/self-learning/cgpiogl/ch2/2.4_files/./filesgpr" not found
So it seems that the path your have specified for ada.projectFile
does not exit (at least the server does not find it). I would suggest to double-check that first, it might be the primary cause for the requests' failures.
Regards,
Yeah, I fixed that. But the error I reported was NOT on that project, it was on the earlier ones, where the GPR file was correct.
I suggest you grab my sources, add sdl, then open the ch2/<project>/.vscode/?.code-workspace
then try to edit gl.ads, just add something at the end. You'll get no end of popups with errors in them.
I am missing a lot of dependencies in order to properly load your sources, it would be great if you could attach a self-contained archive, or at least tell me how to grab all the missing dependencies.
You don't need sdlada_image, just delete that from toml.
You can uncomment the url line for sdlada and it should build, that is the only dependency. The opengl source is within the same repo, ../../
back.
And where can I find with "config/first_config.gpr";
, which is included for instance in ch2/2.1_first/first.gpr
?
That's generated by alire.
It still fails after uncommenting the sdlada
line and doing alr build
. Please provide a smaller reproducer, either based on Alire or not, but that works from scratch: it will make debugging way easier for us.
Did you remove the other sdlada line with the path?
An easier way for you to test is to create a project, open it in vscode, add a dependency and then add that dependency as a folder within the workspace, then try to get any kind of assistance, auto-complete, go to symbol, etc. Won't work.
An easier way for you to test is to create a project, open it in vscode, add a dependency and then add that dependency as a folder within the workspace, then try to get any kind of assistance, auto-complete, go to symbol, etc. Won't work.
Add a dependency in the Alire .toml file?
In my case it was a dependency on the project added to the workspace, so I could edit that at the same time.
In my case it was a dependency on the project added to the workspace, so I could edit that at the same time.
if you add anew dependency you should reload the project from VS Code, otherwise the navigation won't work: this is expected. Also you should make sure to set the ada.projectFile
setting, in order to specify what root project the Ada Language Server should use if there are multiple .gpr files in the same workspace
This isn't hard. Just try it. Create a project, add sdlada (or some other project) as a dependency, then add them both into the workspace, and set the gpr profect in settings, try editing the project which isn't the main one.
If we ask for a detailed reproducer it's because what you are describing works fine in usual cases, as you can see in the attached screenshot: here I have a default.gpr
root project (located in a folder called basic_prj
) that imports a to_import.gpr
project file located in another directory (../to_import
). I have then added the imported project's source directory in my workspace as you have described (via the Ada: Add Missing Source Directories To Worskpace
command).
I can perfectly edit the imported project's sources: I have completion, tooltips and all other expected features. So there must be something specific with your configuration: having a proper reproduced with detailed steps (or a self containex archive) would greatly help. I understand that it's some work for you and I am very sorry for that, but it would be hard to solve that issue otherwise.
Environment
Bug Summary and Reproducer
Bug Summary: Keep getting failure popups and crash logs to console
Steps to reproduce: Create a workspace, set the project gpr to the main project, add dependencies, edit source from dependency.
Expected behavior: I expect it to work as normal.
Configuration and Logs
Other VS Code Extensions
No response
Additional context
No response