AdaCore / ada_language_server

Server implementing the Microsoft Language Protocol for Ada and SPARK
GNU General Public License v3.0
230 stars 54 forks source link

Range formatting request raises assertion_error in Extract_Original_Selection_From_Output #1086

Closed stephe-ada-guru closed 1 year ago

stephe-ada-guru commented 1 year ago

range_formatting_02.tgz.txt

The range formatting request fails with:

[ALS.MAIN] Range_Formatting_Response: Response 4 Error [ALS.OUT] {"jsonrpc":"2.0","id":4,"error":{"code":-32603,"message":""}}

The problem is the assert in laltools-partial_gnatpp.adb Extract_Original_Selection_From_Output. The code does not require the restriction that the assert tries to impose (it should use 'length, not 'size). Deleting the assert allows the test to succeed.

joaopsazevedo commented 1 year ago

This issue is now fixed in the the edge branch. Thank you for reporting and for the reproducer.