Post by Piotr TrojanekHi,
with the latest ada-mode 5.1.9 I get a runtime error when indenting
package aspects.
Test and patch attached.
Thanks!
+ (package_specification
+ ;; package P
The first line of this comment should be a shortcut to the file
containing the test code: test/p.ads. That way, you can use a binding to
`find-file-at-point' (C-F12 for me) to navigate to directly to the test.
I'd prefer a longer name for the test file, or include this test in an
existing package. "SPARK_Mode" is recognized by GNAT GPL 2014 (which is
what I'm testing with), so this can go in an existing package;
ada_mode-nominal.ads. That changes the test of ada-*-statement-keyword.
+ ;; with SPARK_Mode => On
+ ;; indenting 'with'
+ (save-excursion
+ (wisi-backward-token)
+ (+ (current-column) ada-indent-broken)))
There's a bug in the grammar here. At this point in the code, point is
on the token containing the aspect, which is P. But it should be
"package", so the indentation is dependent on the keyword, not the name.
Then you would not need "wisi-backward-token". And it changes
"package_specification" to "package_declaration".
Post by Piotr TrojanekNote that I do not know if my decision about
how to indent the package aspect is in line with the style promoted by
the ada-mode.
As Simon pointed out, aspects with types are aligned with "type", so
these should be aligned with "package". This looks better when there is
a list of aspects:
package Ada_Mode.Nominal
with
SPARK_Mode => On,
foo => bar
is
Full patch attached.
--
-- Stephe