-
Notifications
You must be signed in to change notification settings - Fork 60
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
[Bug]: Questions about forthcoming gnatformat support in ALS #1216
Comments
The code base for ALS includes gnatformat (certainly as of release 25.0.20241014), and as you can see from #1217 the fact that names are getting title-cased implies that at least |
Hello @brownts.
We want to completely replace GNATpp and any other formatting tool by GNATformat, both in VS Code and GNATstudio, as soon as possible. However, for VSCode that has been done. For GNATstudio, it's a work in progress. Therefore, it was required to have ALS using GNATpp as its default formatter. This is configured here as you correctly noticed. In VSCode, we added a setting that allows users to control if they want to use GNATformat or GNATpp. By default, this settings is set to use GNATformat. This is done here as you correctly noticed too. This VSCode setting is sent to ALS through a With this mechanism, VS Code by default will use GANTformat (with a setting to change back to GNATpp) and GNAT Studio will continue to use GNATpp for now (it does not send a This should explain why there seems to be a discrepancy.
For now, the editors should not pull any settings from the project file (and here I assume you mean the .gpr project file). Everything should be handled by ALS, which indeed reads the project file.
No, but let us know is there's a use case for it and we will of course consider it.
Yes, when
I guess the reason The above should answer your questions but feel free ask more if something was not clear. |
Hi @joaopsazevedo, thanks for the detailed response. Please see my comments below.
Yes, this all makes sense, thank you. I'm coming from the perspective of supporting ALS in Emacs and therefore, the reason I'm trying to understand the defaults as set by the server alone. Emacs has two major LSP clients (Eglot and As a result, it seems the documentation with regards to
Yes, I was referring to the .gpr project file. Does "Everything should be handled by ALS" assume that
Possibly, see my comment directly above, although I'd much prefer the .editorconfig solution below if possible since it doesn't require the presence of the ALS to get at the settings.
This question was really a follow-on to if a new ALS command was created for extracting formatting options from the .gpr file.
I think using settings from .editorconfig would be more flexible. Most editors are aware of these configuration files and can automatically handle them to configure themselves. This means, if the settings exist in .editorconfig, editors which aren't using ALS for formatting (or which aren't using
Thanks I look forward to giving it a try. Using |
Environment
Bug Summary and Reproducer
I have a few questions in anticipation of the inclusion of
gnatformat
in the ALS:When I look in settings.md, it says by default this option is enabled. I also noticed in package.json, that the default for VSCode seems to be "true", which matches the description in settings.md. However, when looking in lsp-ada_configurations.ads, it appears the default value in the
Configuration
type setsUse_Gnatformat
to false. Is this a discrepancy or isUse_Gnatformat
defaulted to true elsewhere?Is the expectation that the editor will pull these settings from the project file in order to adjust the its internal indentation and continuation amounts? If so, is there a plan for ALS to support a command for extracting this information from the project file? Also, when
useGnatFormat
is false, would it also support extracting similar settings from the Pretty_Printer section?It seems that the settings provided in
Format
are almost identical to the settings you'd find in.editorconfig
. Was there a reason to add aFormat
section, rather than use an existing.editorconfig
?Configuration and Logs
Other VS Code Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: