-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide more control over formatting. #1076
Comments
I'm not from Adacore but Gnat Studio edits the .gpr project file when setting formatting options.
|
@kevlar700; yes, Gnat Studio calls gnatpp more directly; it doesn't go thru the LSP interface. |
Hello @stephe-ada-guru , The Ada Language Server normally reads the gnatpp options specified in your project file, is it not the case for you? |
@AnthonyLeonardoGracio I was not aware of the gnatpp package in a project file (and I did not make the connection that it implies that ada_language_server reads those options). I gather the list of options is given by "gnatpp --help"; that is quite extensive, but it's not powerful enough to match my style, nor Eurocontrol's. --source-line-breaks may be enough for Emacs indent. I'll have to experiment and submit more suggestions for the controls I need. Thanks for the nudge :). |
Adding a Pretty_Printer package in the project file does allow setting --source-line-breaks. But it's inconvenient to have to add that in every project file, so it would be better if als accepted all pretty printer parameters via the LSP interface. |
What binary does the formatting and where is it located? I added the
properly formats this code
|
ada_language_server uses the gnatpp code to do formatting. That code supports several options that control the formatting. In particular, some combination of settings results in "just indent", which is what Emacs ada-mode wants when the user invokes indent-line.
So it would be nice if there was a way to pass those options to the server, perhaps via an LSP extension command ada_format_options.
In addition, the gnatpp code has a set of formatting rules that can be specified in a file (at least, it did last time I looked; it seems that feature was only intended for internal development). It would be nice to allow the user to specify a file to replace the formatting rules; then we could implement any formatting style using ada_language_server.
The text was updated successfully, but these errors were encountered: