You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the default value for useGnatformat (which I believe defaults to "false" these days) or even explicitly setting useGnatformat to "false" in .als.json (thus enabling GNATpp as the formatter), the Language Server's range formatted text appears to have ignored the tabSize specified as part of the textDocument/rangeFormatting request and instead uses an indentation level of 3. If I instead configure useGnatFormat to "true", then the tabSize is used as expected and the text is formatted using the correct amount of indentation. Additionally, the GPR file does not contain any formatting configuration for the pretty printer.
The following log snippet shows the relevant request and response. See below for full log details.
I've attached an example application with an non-indented "Put_Line" statement. When I attempt to range format the line with useGnatformat set to "false" and a tabSize of 8, the resultant text from the Ada Language Server only contains an indentation of 3 spaces.
Having useGnatformat set to false by default on the latest release was an unexpected consequence of the patches that implemented the als.json file support: GNATpp's integration is clearly deprecated, and we want to push for GNATformat.
So we won't fix GNATpp's back-end, just set useGnatformat to true for now: we'll make sure to re-enable it by default in the next pre-release/release.
How does one configure gnatformat? It's my understanding that gnatpp could be configured using package Pretty_Printer in the GPR file, but I cant find much on configuring gnatformat. I'd like to be able to tweak it instead of being forced to use the defaults.
Environment
Bug Summary and Reproducer
Bug Summary:
When using the default value for
useGnatformat
(which I believe defaults to "false" these days) or even explicitly settinguseGnatformat
to "false" in.als.json
(thus enabling GNATpp as the formatter), the Language Server's range formatted text appears to have ignored thetabSize
specified as part of thetextDocument/rangeFormatting
request and instead uses an indentation level of 3. If I instead configureuseGnatFormat
to "true", then thetabSize
is used as expected and the text is formatted using the correct amount of indentation. Additionally, the GPR file does not contain any formatting configuration for the pretty printer.The following log snippet shows the relevant request and response. See below for full log details.
Steps to reproduce:
I've attached an example application with an non-indented "Put_Line" statement. When I attempt to range format the line with
useGnatformat
set to "false" and atabSize
of 8, the resultant text from the Ada Language Server only contains an indentation of 3 spaces.indent_test.zip
Expected behavior:
I expect the range formatted text to be indented 8 spaces instead of 3.
Configuration and Logs
Other VS Code Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: