Skip to content
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]: textDocument/rangeFormatting using GNATpp ignores tabSize #1233

Open
brownts opened this issue Jan 16, 2025 · 3 comments
Open

[Bug]: textDocument/rangeFormatting using GNATpp ignores tabSize #1233

brownts opened this issue Jan 16, 2025 · 3 comments
Labels

Comments

@brownts
Copy link

brownts commented Jan 16, 2025

Environment

  • OS and Version: Linux
  • IDE Version: Emacs 30
  • Ada & SPARK Extension Version: 26.0.202412191

Bug Summary and Reproducer

Bug Summary:

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.

[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/rangeFormatting","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"options":{"tabSize":8,"insertSpaces":true,"trimTrailingWhitespace":true,"insertFinalNewline":true,"trimFinalNewlines":true},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":19}}},"id":12} (18:14:09.337)
[ALS.OUT] {"jsonrpc":"2.0","id":12,"result":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":19}},"newText":"   Put_Line (\"Hello\");"}]} (18:14:09.348)

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 a tabSize 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

[ALS.MAIN] ALS version: 26.0.202412191 () (18:13:53.156)
[ALS.MAIN] Initializing server ... (18:13:53.156)
[ALS.MAIN] GPR PATH:  (18:13:53.156)
[ALS.MAIN] PATH: /home/troy/.cargo/bin:/home/troy/bin:/home/troy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-10-oracle/bin:/usr/lib/jvm/java-10-oracle/db/bin (18:13:53.156)
[ALS.MAIN] Trying config file: /home/troy/.config/als/config.json (18:13:53.156)
[ALS.MAIN] /home/troy/.config/als/config.json doesn't exist (18:13:53.156)
[ALS.MAIN] Trying config file: /home/troy/ada/indent_test/.als.json (18:13:53.156)
[ALS.MAIN] Loading config file: /home/troy/ada/indent_test/.als.json (18:13:53.156)
[ALS.MAIN] Ada version used for predefined completion: ADA_2020 (18:13:53.161)
[ALS.IN] {"jsonrpc":"2.0","method":"initialize","params":{"processId":1361467,"rootPath":"/home/troy/ada/indent_test","clientInfo":{"name":"emacs","version":"GNU Emacs 29.1.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)\n of 2023-07-30"},"rootUri":"file:///home/troy/ada/indent_test","capabilities":{"general":{"positionEncodings":["utf-32","utf-16"]},"workspace":{"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"]},"applyEdit":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"workspaceFolders":true,"configuration":true,"semanticTokens":{"refreshSupport":false},"codeLens":{"refreshSupport":true},"diagnostics":{"refreshSupport":false},"fileOperations":{"didCreate":false,"willCreate":false,"didRename":true,"willRename":true,"didDelete":false,"willDelete":false}},"textDocument":{"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUntil":true},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"requests":{"range":true,"full":true},"tokenModifiers":["declaration","definition","implementation","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"overlappingTokenSupport":true,"multilineTokenSupport":true,"tokenTypes":["modifier","comment","keyword","string","number","regexp","operator","namespace","type","struct","class","interface","enum","typeParameter","function","method","member","property","event","macro","variable","parameter","label","enumConstant","enumMember","dependent","concept"],"formats":["relative"]},"rename":{"dynamicRegistration":true,"prepareSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"resolveSupport":{"properties":["edit","command"]},"dataSupport":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"],"resolveAdditionalTextEditsSupport":true,"insertReplaceSupport":true,"deprecatedSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits","command"]},"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true},"contextSupport":true,"dynamicRegistration":true},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}},"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":false},"typeHierarchy":{"dynamicRegistration":true},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":true},"diagnostic":{"dynamicRegistration":false,"relatedDocumentSupport":false},"linkedEditingRange":{"dynamicRegistration":true},"inlineCompletion":null},"window":{"workDoneProgress":true,"showDocument":{"support":true}}},"initializationOptions":{"defaultCharset":"UTF-8"},"workDoneToken":"1"},"id":1} (18:13:53.175)
[ALS.MAIN] Processing initializationOptions from initialize request (18:13:53.177)
[ALS.OUT] {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"triggerCharacters":[".",",","'","("],"resolveProvider":true},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":[",","("],"retriggerCharacters":["\b"]},"declarationProvider":true,"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"workDoneProgress":false,"codeActionKinds":["quickfix","refactor.rewrite"],"resolveProvider":false},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["als-other-file","als-suspend-execution","als-reload-project","als-open-project-file","als-open-log-file","als-show-dependencies","als-source-dirs","als-executables","als-mains","als-project-file","als-object-dir","als-named-parameters","als-auto-import","als-suppress-separate","als-refactor-extract-subprogram","als-refactor-introduce-parameter","als-refactor-pull_up_declaration","als-refactor-replace-type","als-refactor-sort_dependencies","als-refactor-add-parameters","als-refactor-remove-parameters","als-refactor-move-parameter","als-refactor-change-parameter-mode","als-refactor-change_parameters_type","als-refactor-change_parameters_default_value"]},"callHierarchyProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","function","keyword","modifier","comment","string","number","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","modification","documentation","defaultLibrary"]},"range":true,"full":true},"typeHierarchyProvider":true,"workspace":{},"alsReferenceKinds":["reference","access","write","call","dispatching call","parent","child","overriding"]}}} (18:13:53.178)
[ALS.OUT] {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Log file is: /home/troy/.als/ada_ls_log.2025-01-16T181353.log"}} (18:13:53.178)
[ALS.IN] {"jsonrpc":"2.0","method":"initialized","params":{}} (18:13:53.339)
[ALS.IN] {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"ada":{"defaultCharset":"UTF-8"}}}} (18:13:53.340)
[ALS.MAIN] Processing received workspace/didChangeConfiguration notification (18:13:53.340)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb","languageId":"ada","version":0,"text":"with Ada.Text_IO; use Ada.Text_IO;\n\nprocedure Indent_Test is\nbegin\nPut_Line (\"Hello\");\nend Indent_Test;\n"}}} (18:13:53.340)
[ALS.MAIN] Scheduling a reload because the project tree is not defined (18:13:53.340)
[ALS.PROJECT] Reload_Project was called. Releasing current project context. (18:13:53.340)
[ALS.PROJECT] Found ada.projectFile = indent_test.gpr (18:13:53.340)
[ALS.PROJECT] Loading project: indent_test.gpr (18:13:53.340)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/range","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":0,"character":0},"end":{"line":6,"character":0}}},"id":2} (18:13:53.340)
[ALS.PROJECT] Loading project with GPR2 (18:13:53.340)
[ALS.IN] {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":2}} (18:13:53.352)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/range","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":0,"character":0},"end":{"line":6,"character":0}}},"id":3} (18:13:53.353)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":0}},"context":{"diagnostics":[]}},"id":4} (18:13:53.353)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"position":{"line":4,"character":0}},"id":5} (18:13:53.353)
[ALS.PROJECT] GPR2 messages after load: (18:13:53.607)
   [ALS.PROJECT] No GPR2 messages (18:13:53.607)
[ALS.PROJECT] Updating project sources (18:13:53.607)
[ALS.PROJECT] GPR2 messages after updating sources: (18:13:53.808)
   [ALS.PROJECT] No GPR2 messages (18:13:53.808)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"position":{"line":4,"character":0}},"id":6} (18:13:53.839)
[ALS.PROJECT] Prepend Context Id: file:///home/troy/ada/indent_test/indent_test.gpr (18:13:53.845)
[ALS.PROJECT] Project status after loading: 
_ALS.PROJECT_ (PROJECT_TYPE => CONFIGURED_PROJECT,
_ALS.PROJECT_  STATUS => VALID_PROJECT,
_ALS.PROJECT_  PROJECT_FILE => {GNATCOLL.VFS.VIRTUAL_FILE\0 object},
_ALS.PROJECT_  MISSING_ADA_RUNTIME => FALSE,
_ALS.PROJECT_  GPR2_MESSAGES => {GPR2.LOG.OBJECT\0 object}) (18:13:53.845)
[ALS.MAIN] Creating fallback context (18:13:53.845)
[ALS.OUT] {"jsonrpc":"2.0","id":1,"method":"client/registerCapability","params":{"registrations":[{"id":"1","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/home/troy/ada/indent_test/*","kind":7}]}}]}} (18:13:53.845)
[ALS.IN] {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":3}} (18:13:53.847)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/range","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":0,"character":0},"end":{"line":6,"character":0}}},"id":7} (18:13:53.847)
[ALS.IN] {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":7}} (18:13:53.847)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/range","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":0,"character":0},"end":{"line":6,"character":0}}},"id":8} (18:13:53.847)
[ALS.IN] {"jsonrpc":"2.0","id":1,"result":null} (18:13:53.848)
[ALS.OUT] {"jsonrpc":"2.0","id":3,"method":"window/workDoneProgress/create","params":{"token":"ada_ls-1361725-indexing-1"}} (18:13:53.861)
[ALS.MAIN] In Message_Handler Text_Document_Did_Open URI: (18:13:53.861)
[ALS.MAIN] file:///home/troy/ada/indent_test/indent_test.adb (18:13:53.861)
[ALS.OUT] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/troy/ada/indent_test","diagnostics":[]}} (18:13:53.861)
[ALS.IN] {"jsonrpc":"2.0","id":3,"result":null} (18:13:53.861)
[ALS.MAIN] Out Message_Handler Text_Document_Did_Open (18:13:53.880)
[ALS.OUT] {"jsonrpc":"2.0","id":2,"error":{"code":-32800,"message":"Request was canceled"}} (18:13:53.881)
[ALS.OUT] {"jsonrpc":"2.0","id":3,"error":{"code":-32800,"message":"Request was canceled"}} (18:13:53.881)
[ALS.OUT] {"jsonrpc":"2.0","id":7,"error":{"code":-32800,"message":"Request was canceled"}} (18:13:53.881)
[ALS.OUT] {"jsonrpc":"2.0","id":6,"result":{"contents":[{"language":"ada","value":"procedure Put_Line\n  (Item : String)"},"at a-textio.ads (507:4)",{"language":"ada","value":"  Post   =>\n    Line_Length'Old = Line_Length\n    and Page_Length'Old = Page_Length,\n  Global => (In_Out => File_System)"}]}} (18:13:53.881)
[ALS.OUT] {"jsonrpc":"2.0","id":8,"result":{"data":[0,5,3,0,256,0,4,7,0,256,0,13,3,0,256,0,4,7,0,256,2,10,11,11,1,2,0,8,11,256,1,4,11,11,0]}} (18:13:53.896)
[ALS.OUT] {"jsonrpc":"2.0","id":4,"result":[{"title":"Name parameters in the call","kind":"refactor.rewrite","command":{"title":"","command":"als-named-parameters","arguments":[{"context":"file:///home/troy/ada/indent_test/indent_test.gpr","where":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"position":{"line":4,"character":10}},"versioned_documents":true}]}}]} (18:13:53.896)
[ALS.OUT] {"jsonrpc":"2.0","id":5,"result":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":8}},"kind":2}]} (18:13:53.898)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"begin","title":"Indexing","percentage":0}}} (18:13:53.898)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"}},"id":9} (18:13:53.950)
[ALS.OUT] {"jsonrpc":"2.0","id":9,"result":{"data":[0,5,3,0,256,0,4,7,0,256,0,13,3,0,256,0,4,7,0,256,2,10,11,11,1,2,0,8,11,256,1,4,11,11,0]}} (18:13:54.025)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"45/1526 files","percentage":2}}} (18:13:54.362)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"148/1526 files","percentage":9}}} (18:13:54.872)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"271/1526 files","percentage":17}}} (18:13:55.400)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"428/1526 files","percentage":28}}} (18:13:55.903)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"602/1526 files","percentage":39}}} (18:13:56.418)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"772/1526 files","percentage":50}}} (18:13:56.918)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"935/1526 files","percentage":61}}} (18:13:57.424)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"1098/1526 files","percentage":71}}} (18:13:57.924)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"1208/1526 files","percentage":79}}} (18:13:58.443)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"1367/1526 files","percentage":89}}} (18:13:58.943)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"report","message":"1508/1526 files","percentage":98}}} (18:13:59.444)
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-1361725-indexing-1","value":{"kind":"end"}}} (18:13:59.476)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"position":{"line":4,"character":0}},"id":10} (18:14:05.765)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":0}},"context":{"diagnostics":[]}},"id":11} (18:14:05.766)
[ALS.OUT] {"jsonrpc":"2.0","id":10,"result":{"contents":[{"language":"ada","value":"procedure Put_Line\n  (Item : String)"},"at a-textio.ads (507:4)",{"language":"ada","value":"  Post   =>\n    Line_Length'Old = Line_Length\n    and Page_Length'Old = Page_Length,\n  Global => (In_Out => File_System)"}]}} (18:14:05.767)
[ALS.OUT] {"jsonrpc":"2.0","id":11,"result":[{"title":"Name parameters in the call","kind":"refactor.rewrite","command":{"title":"","command":"als-named-parameters","arguments":[{"context":"file:///home/troy/ada/indent_test/indent_test.gpr","where":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"position":{"line":4,"character":10}},"versioned_documents":true}]}}]} (18:14:05.768)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/rangeFormatting","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"options":{"tabSize":8,"insertSpaces":true,"trimTrailingWhitespace":true,"insertFinalNewline":true,"trimFinalNewlines":true},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":19}}},"id":12} (18:14:09.337)
[ALS.MAIN] On Range_Formatting (18:14:09.338)
[ALS.MAIN] Format_Selection (18:14:09.338)
[ALS.MAIN] Computing Range_Formatting Text_Edits (18:14:09.348)
[ALS.OUT] {"jsonrpc":"2.0","id":12,"result":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":19}},"newText":"   Put_Line (\"Hello\");"}]} (18:14:09.348)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb","version":1},"contentChanges":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":19}},"rangeLength":19,"text":"   Put_Line (\"Hello\");"}]}} (18:14:09.349)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":0}},"context":{"diagnostics":[]}},"id":13} (18:14:09.855)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/range","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"},"range":{"start":{"line":0,"character":0},"end":{"line":6,"character":0}}},"id":14} (18:14:09.855)
[ALS.OUT] {"jsonrpc":"2.0","id":13,"result":null} (18:14:09.855)
[ALS.IN] {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":14}} (18:14:09.855)
[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///home/troy/ada/indent_test/indent_test.adb"}},"id":15} (18:14:09.855)
[ALS.OUT] {"jsonrpc":"2.0","id":14,"result":{"data":[0,5,3,0,256,0,4,7,0,256,0,13,3,0,256,0,4,7,0,256,2,10,11,11,1,2,3,8,11,256,1,4,11,11,0]}} (18:14:09.858)
[ALS.OUT] {"jsonrpc":"2.0","id":15,"result":{"data":[0,5,3,0,256,0,4,7,0,256,0,13,3,0,256,0,4,7,0,256,2,10,11,11,1,2,3,8,11,256,1,4,11,11,0]}} (18:14:09.858)
[ALS.IN] {"jsonrpc":"2.0","method":"shutdown","params":null,"id":16} (18:14:12.261)
[ALS.OUT] {"jsonrpc":"2.0","id":16,"result":null} (18:14:12.261)
[ALS.IN] {"jsonrpc":"2.0","method":"exit","params":null} (18:14:12.262)

Other VS Code Extensions

No response

Additional context

No response

@brownts brownts added the bug label Jan 16, 2025
@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @brownts,

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.

Regards,

@kittybwained
Copy link

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.

@kittybwained
Copy link

Oops, I should have looked harder: https://docs.adacore.com/live/wave/gnatformat/html/user-guide/user-guide/configuration.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants