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

Links in Problems view are broken #1165

Closed rocher closed 10 months ago

rocher commented 10 months ago

After an unsuccessful compilation, there are several lines in the problems view, indicating a compile error. When clicking on any of theses links, the expected behavior is that vscode opens that file, in an editor window, at that precise line/column.

Instead, I get an error message in the editor window because the file could not be found. In the title of the tab appears the filename and "/" and the number of problems in that file.

Is this a bug? Or a wrong configuration I have?

reznikmm commented 10 months ago

How do you trigger the compilation?

Suggested way to compile is to use "autodiscovered" tasks (list ada: check current file or ada: build current project). In this case the extension adds -gnatef:

-gnatef   Full source path in brief error messages and JSON output

This way problems have full path to files instead of base names and VS Code works fine. If you compile with your own task instead, then add -gnatef option to the compiler/gprbuild options.

rocher commented 10 months ago

Yep! Adding this option to my task definition works fine.

Thanks Max!!