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

ISO 8859-1 encoded GPR file not recognized #1130

Closed brownts closed 1 year ago

brownts commented 1 year ago

Starting with v23.0.14, we've noticed some of our GPR files can no longer be handled by the VSCode/ALS extension. It appears to be related to Latin-1 characters in the GPR file. Reverting back to v23.0.12 of the extension does not have this problem, so is our current workaround.

This is problematic though as navigation and other functionality is no longer available as a result of this issue. I assume this is due to the recent switch to using libgpr2 for handling of GPR files as indicated in the release notes.

Attached is a screenshot and reproducer for this issue with a simple project and a Latin-1 character encoding for the gpr file.

gpr_hello_world_project.zip

iso_8859-1_gpr

JHag6694 commented 1 year ago

Same problem for me.

In my case, there was only 1 character in 1 comment of 1 .gpr file. So, I have changed the comment to avoid the problem with 23.0.14.

reznikmm commented 1 year ago

I'm able to reproduce this. I didn't find in the documentation any mention what encoding the .gpr files should be. But since migration to libgpr2 .gpr are supposed to be UTF-8.

brownts commented 1 year ago

It would seem reasonable to assume that all gpr-based tools handle gpr files in a consistent manner. Both gprbuild and gprclean (see VA25-035) handle Latin-1 encoded files, so it would seem logical that ALS would be able to handle those same files too.

reznikmm commented 1 year ago

Should be fixed in 23.0.15