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]: ALS doesn't respect SignatureHelpClientCapabilities activeParameterSupport #1226

Open
brownts opened this issue Dec 16, 2024 · 1 comment
Assignees
Labels

Comments

@brownts
Copy link

brownts commented Dec 16, 2024

Environment

  • OS and Version: Linux / Ubuntu 22.04
  • IDE Version: Emacs 30
  • Ada & SPARK Extension Version: 26.0.202411173

Bug Summary and Reproducer

Bug Summary:

When an LSP client does not support the SignatureInformation.activeParameter (as activeParameterSupported is missing from the SignatureHelpClientCapabilities), then the field should not be provided by the Language Server, and additionally, the SignatureHelp.activeParameter should be set correctly by the Language Server in the textDocument/signatureHelp response.

Steps to reproduce:

Using an LSP client which does not support SignatureInformation.activeParameter, trigger signature help for a subroutine on the second parameter and the Language Server will indicate an index of 0 (i.e., first parameter) for the SignatureHelp.activeParameter field of the textDocument/signatureHelp response.

Expected behavior:

When an LSP client does not support SignatureInformation.activeParameter, the Language Server should indicate the correct parameter index in the SignatureHelp.activeParameter field of the textDocument/signatureHelp response.

Configuration and Logs

[ALS.MAIN] ALS version: 26.0.202411173 () (12:51:38.786)
[ALS.MAIN] Initializing server ... (12:51:38.786)
[ALS.MAIN] GPR PATH:  (12:51:38.786)
[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 (12:51:38.786)
[ALS.MAIN] Ada version used for predefined completion: ADA_2020 (12:51:38.793)
[ALS.IN] {"jsonrpc":"2.0","method":"initialize","params":{"processId":734948,"rootPath":"/home/troy/junk/gtkada_24.0.0_80c56171","clientInfo":{"name":"emacs","version":"GNU Emacs 30.0.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)\n of 2024
-09-07"},"rootUri":"file:///home/troy/junk/gtkada_24.0.0_80c56171","capabilities":{"general":{"positionEncodings":["utf-32","utf-16"]},"workspace":{"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"]},"applyEdit":true,"symbol":{"symb
olKind":{"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,"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":{"dynamicR
egistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"synchronization":{"willSave":true,"didSave":true,"willSaveWa
itUntil":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},"onTypeFor
matting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","ref
actor.inline","refactor.rewrite","source","source.organizeImports"]}},"resolveSupport":{"properties":["edit","command"]},"dataSupport":true},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown","plaintext"],"resolveAdditionalTextEditsSu
pport":true,"insertReplaceSupport":true,"deprecatedSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits","command","insertTextFormat","insertTextMode"]},"insertTextModeSupport":{"valueSet":[1,2]}},"contextSupport":true,"dynamicRegis
tration":true},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}},"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistratio
n":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}},"window":{"workDoneProgress":true,"showDocument":{"support":true}}},"initializationOptions":{"projectFile":"src/gtkada.gpr",
"defaultCharset":"UTF-8"},"workDoneToken":"1"},"id":8} (12:51:38.811)
[ALS.OUT] {"jsonrpc":"2.0","id":8,"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":["qu
ickfix","refactor.rewrite"],"resolveProvider":false},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"renameProvider":{"prepareProvider":true},"foldi
ngRangeProvider":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-di
r","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-ref
actor-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":[],"tokenModif
iers":[]},"range":true,"full":true},"typeHierarchyProvider":true,"workspace":{},"alsReferenceKinds":["reference","access","write","call","dispatching call","parent","child","overriding"]}}} (12:51:39.139)
[ALS.OUT] {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Log directory is /home/troy/.als/ada_ls_log.2024-12-16T125138.log"}} (12:51:39.139)
[ALS.IN] {"jsonrpc":"2.0","method":"initialized","params":{}} (12:51:39.219)

...

[ALS.IN] {"jsonrpc":"2.0","method":"textDocument/signatureHelp","params":{"textDocument":{"uri":"file:///home/troy/junk/gtkada_24.0.0_80c56171/src/glib.adb"},"position":{"line":102,"character":38}},"id":74} (12:52:03.045)
[ALS.OUT] {"jsonrpc":"2.0","id":74,"result":{"signatures":[{"label":"function Internal (Name : String; Thing : String) return GType","documentation":"","parameters":[{"label":"Name"},{"label":"Thing"}],"activeParameter":1}],"activeSignature":0,"activeParameter":0}} (12:52:03.047)

Other VS Code Extensions

No response

Additional context

No response

@brownts brownts added the bug label Dec 16, 2024
@eliericha eliericha self-assigned this Dec 17, 2024
@eliericha
Copy link
Contributor

Hello @brownts ,

Thank you for reporting this, we will look into it.

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

2 participants