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

Strange error in the standard HelloWorld program. #1161

Open Nucl3arSn3k opened 11 months ago

Nucl3arSn3k commented 11 months ago

I'm running the standard HelloWorld program in Ada,however,VSCode is throwing an error, specifically Project file has error and can't be loaded. The program compiles and runs fine,so I'm unclear as to why the linter is throwing an error.

joaopsazevedo commented 11 months ago

Hello @Nucl3arSn3k.

If you're getting that error but the program compiles and runs fine, I guess ALS is not using the same gpr as the one you're using to build the project.

You can configure what gpr ALS will use as shown here: https://github.com/AdaCore/ada_language_server/wiki/Getting-Started#currect-project-file-configuration

Alternatively, in your project root directory, you can create a .vscode/settings.json file with the following content:

{
    "ada.projectFile": "relative_or_full_path_of_your_project.gpr"
}
reznikmm commented 11 months ago

@Nucl3arSn3k Can you provide a reproducer? Source of your project? Have you tried Getting Started tutorial?

Nucl3arSn3k commented 11 months ago

Here is the code of my program. I followed the getting started tutorial

`with Ada.Text_IO;

procedure My_Hello_World is begin Ada.Text_IO.Put_Line ("Hello, World!"); end My_Hello_World;`

Joebeazelman commented 10 months ago

This error is relate to my issue #1160. I've already done so, but in my issue, @reznikmm shows how to turn on error logging. You might want to turn it on and include the dump file here as well so to help find the source of the issue. Execute the following command in your terminal:

echo "ALS.MAIN=yes" > $HOME/.als/traces.cfg

Open the project again and perform a compilation and quit out of VSCode. This will generate the dump file. Post the file here and make sure you remove any sensitive information.