bug#38566: 26.1; ada-mode 6.2.1 incorrect indentation with partial parsing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

bug#38566: 26.1; ada-mode 6.2.1 incorrect indentation with partial parsing

Ludovic Brenta
X-Debbugs-CC: [hidden email]
Package: emacs, ada-mode
Version: 26.1
Severity: minor

When we visit one of our larger source files which compiles and
is not yet modified, move point to after a "begin" keyword and hit
RET, ada-mode incorrectly re-indents the "begin" keyword and the
next (new and empty) line.

Expected:

       declare
         procedure Action (Airspace : Env_Volume.T; Info :
Curtain.Profile.Index.T) is
           [elided]
         end Action;
         procedure Action_Airspaces is new
Curtain.Profile.Index.Visit_Unskipped_Airspaces_G;
       begin* -- point is here initially; hit RET
         * -- point should come here after RET
         Airspace_Entry_Times_Set.Empty (Airspace_First_Entry_Times,
Profile_Query);
         -- The query causes the set to be initialised or resized if
necessary.
         Action_Airspaces (Profile.Curtain, Profile_Query);
       end;

Actual:

       declare
         procedure Action (Airspace : Env_Volume.T; Info :
Curtain.Profile.Index.T) is
           [elided]
         end Action;
         procedure Action_Airspaces is new
Curtain.Profile.Index.Visit_Unskipped_Airspaces_G;
         begin -- incorrectly changed indentation after RET
           * -- point is here after RET
         Airspace_Entry_Times_Set.Empty (Airspace_First_Entry_Times,
Profile_Query);
         -- The query causes the set to be initialised or resized if
necessary.
         Action_Airspaces (Profile.Curtain, Profile_Query);
       end;

If I forcibly disable partial parsing in this file, the bug disappears.

--
Ludovic Brenta.