AdaCore / ada_language_server

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

UB30-006 Fix exception raised when range formatting the whole document #1001

Closed joaopsazevedo closed 2 years ago

joaopsazevedo commented 2 years ago

If the user selects from the procedure name Main to the procedure end label Main, the whole file needs to be formatted. This PR fixes an exception that was being raised when converting from Source_Location_Range to Span.

procedure Main is

begin
   declare
   A : Integer;
      begin
      null;
      end;

end Main;