AdaCore / ada_language_server

Server implementing the Microsoft Language Protocol for Ada and SPARK
GNU General Public License v3.0
226 stars 54 forks source link

Formatting failure with `or terminate` #1185

Open pyjarrett opened 3 months ago

pyjarrett commented 3 months ago

When using the Ada & SPARK v24.0.4 plugin, I get a "Request textDocument/formatting failed" when trying to format https://github.com/pyjarrett/septum/blob/main/src/common/sp-cache.adb

Deleting elements from the file, it seems the formatter dies as a result of or terminate in this snippet:

select
    accept Wake;
or
    terminate;  -- changing this to `delay 1.0;` results in no formatter failure
end select;

The error text in the language server output is:

[Error - 10:49:10 PM] Request textDocument/formatting failed.
  Message: sp-cache.adb:17:1: Error formatting node (CompilationUnit). Keeping the initial input selection unchanged
pp-formatting.adb:1247