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

Valid Ada statement results in error messages when formatting #1138

Closed Joebeazelman closed 1 year ago

Joebeazelman commented 1 year ago

I am unable to format one of my files and the syntax highlighting only work partially. I believe both errors are related to the error message below.

It specifically refers to this line of code:

procedure Main is 
   ...
   --  LED renames Pico.GP18;
   Button renames Pico.GP21;
  begin
  ...
  end;
end main;

[Trace - 7:59:35 PM] Sending request 'textDocument/formatting - (93)'. Params: { "textDocument": { "uri": "file:///Users/joebeazelman/Projects/Repos/ADB_Controller/src/Main.adb" }, "options": { "tabSize": 3, "insertSpaces": true } }

[Trace - 7:59:35 PM] Received response 'textDocument/formatting - (93)' in 14ms. Request failed: Main.adb:1:1: Error formatting node (CompilationUnit). Keeping the initial input selection unchanged null template: <NoTypeObjectRenamingDecl ["Button"] Main.adb:26:4-26:29> (-32603). [Error - 7:59:35 PM] Request textDocument/formatting failed. Message: Main.adb:1:1: Error formatting node (CompilationUnit). Keeping the initial input selection unchanged null template: <NoTypeObjectRenamingDecl ["Button"] Main.adb:26:4-26:29> Code: -32603

reznikmm commented 1 year ago

Renaming without subtype is an Ada 2022 feature. ALS doesn't support all Ada 2022 features yet. We keeps this as an enhancement request. Thank you for the report.

Joebeazelman commented 1 year ago

This issue appears to be fixed in the latest build.

AnthonyLeonardoGracio commented 1 year ago

Indeed, it has been fixed. Thanks for noticing it! Closing the issue